anyer-beach-2016-raja-david

Alkisah

Anyer Beach, West Java (2016)

Image

papandayan-2014-raja-david

Alkisah

Dead trees, Papandayan Mountain, West Java (2014)

Image
Programming, Teknologi

Using argparse to pass arguments into python script

Artikel ini juga tersedia dalam terjemahan Bahasa indonesia dengan judul Memakai argparse untuk memberikan argumen pada skrip python.

While doing some QA tasks, I got a case which I need to add and delete domain names from hundreds of categorized text files time after time.

Since it was repetitive and cost me time to perform it, I decided to create python script for automating that case.

Inspired by simplicity of linux command: ls which has several arguments with distinct functionalities, I also want my python script to be able to run multiple functions.

To accommodate that, I need to separate the input arguments.

After doing internet research, I found argparse solving this issue. With argparse library, user can pass arguments into python script.

Let’s write this argparse script.

Continue reading

Standard

fisher-anyer-beach-2016-raja-david

Alkisah

Fisherman, Anyer Beach, West Java (2016)

Image
Programming, Teknologi

Memakai argparse untuk memberikan argumen pada skrip python

You can read Using argparse to pass arguments into python script if you prefer this article in english translation.

Beberapa waktu yang lalu aku berhadapan dengan kasus menambah dan menghapus nama domain dari ratusan kategori file teks.

Berpikir kasus ini bakalan datang berulang-ulang, aku ambil keputusan bikin skrip python untuk menghemat waktu.

Sempat terinspirasi dari perintah linux: ls yang punya beberapa argumen dengan fungsi unik. Harapanku bahasa python juga punya library untuk bisa menerima lebih dari 1 masukan argumen.

Setelah riset di internet, aku temuin argparse bisa selesaikan masalah argumen masukan ini. Untuk praktiknya, setiap fungsi bisa memiliki argumen masukan terpisah.

Berikut adalah contoh implementasinya.

Continue reading

Standard

twilight-2017-raja-david

Alkisah

Twilight, Jakarta (2017)

Image
Business, Product, UX/UI

(Part 3/Final part) Creating business dashboard: Implementation

Artikel ini juga tersedia dalam terjemahan Bahasa indonesia dengan judul Merancang dashboard bisnis: Praktik membuat dashboard.

Continuing from previous article: elements and design process, now we practise to create a business dashboard.

This time, we use manufacturing KPIs in the dashboard.

Case:

pengusaha_kain

Suppose a production manager from a fabric company wants to monitor factory performance. He gets frustrated because he can’t get factory progress data in real-time.

Data resources are available but the data processing was done manually. This situation makes him receiving today’s report in the next day.


1. Identify user requirements

In this step, we approach the manager to elicit his requirements.

Suppose that here are the results:

Continue reading

Standard