The Python Package Index Project
Project description
About
The Python Package Index Project (pypipr)
Setup
Install with pip
python -m pip install pypipr
Test with
from pypipr.pypipr import Pypipr
Pypipr.test_print()
Pypipr Class
test_print()
memastikan module sudah terinstal dan dapat dijalankan
from pypipr.pypipr import Pypipr
Pypipr.test_print()
pypipr
sets_ordered()
Hanya mengambil nilai unik dari suatu list
from pypipr.pypipr import sets_ordered
array = [2, 3, 12, 3, 3, 42, 42, 1, 43, 2, 42, 41, 4, 24, 32, 42, 3, 12, 32, 42, 42]
print([i for i in sets_ordered(array)])
list_unique()
sama seperti sets_ordered()
from pypipr.pypipr import list_unique
array = [2, 3, 12, 3, 3, 42, 42, 1, 43, 2, 42, 41, 4, 24, 32, 42, 3, 12, 32, 42, 42]
print([i for i in list_unique(array)])
chunck_array()
membagi array menjadi potongan dengan besaran yg diinginkan
from pypipr.pypipr import chunck_array
array = [2, 3, 12, 3, 3, 42, 42, 1, 43, 2, 42, 41, 4, 24, 32, 42, 3, 12, 32, 42, 42]
print([i for i in chunck_array(array, 5)])
iconsole
print_colorize()
print ke console dengan warna
from pypipr.iconsole import print_colorize
print_colorize("Print some text")
@Log()
/ Log decorator
akan melakukan print ke console. Mempermudah pembuatan log karena tidak perlu mengubah fungsi yg sudah ada. Berguna untuk memberikan informasi proses program yg sedang berjalan.
from pypipr.iconsole import log
@log("Calling some function")
def some_function():
...
return
print_log
akan melakukan print ke console. Berguna untuk memberikan informasi proses program yg sedang berjalan.
from pypipr.iconsole import print_log
print_log("Standalone Log")
input_char()
meminta masukan satu huruf tanpa menekan enter. Char tidak ditampilkan.
from pypipr.iconsole import input_char
input_char("Input Char without print : ")
input_char()
meminta masukan satu huruf tanpa menekan enter. Char ditampilkan.
from pypipr.iconsole import input_char_echo
input_char_echo("Input Char n : ")
idatetime
datetime_now()
memudahkan dalam membuat tanggal dan waktu untuk suatu timezone
from pypipr.idatetime import datetime_now
datetime_now("Asia/Jakarta")
datetime_now("GMT")
datetime_now("Etc/GMT+7")
iconstant
WINDOWS
True apabila berjalan di platform Windows
from pypipr.iconstant import WINDOWS
print(WINDOWS)
LINUX
True apabila berjalan di platform Linux
from pypipr.iconstant import LINUX
print(LINUX)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.