Saturday, 14 April 2018

Berkenalan dengan Django

Status : Draft

Referensi


  1. Django Rest Framework with React Tutorial, https://wsvincent.com/django-rest-framework-react-tutorial/

Sunday, 10 December 2017

Mengekstrak Data dari apbd.jakarta.go.id

Status : Draft 

Mendapat email dari Mokhtar Ebrahim, beliau mengatakan, jika konten web, menggunakan javascript dan/atau meload content melalui ajax call,  BeautifulSoup dan Scrappy tidak akan dapat melakukannya, pilihan yang tepat untuk tugas ini adalah Selenium [5]

Referensi

  1. APBD Elektronik Pemerintah Provinsi DKI Jakarta, http://apbd.jakarta.go.id/
  2. How to scrape websites with Python and BeautifulSoup, https://medium.freecodecamp.org/how-to-scrape-websites-with-python-and-beautifulsoup-5946935d93fe
  3. Scrappy, An open source and collaborative framework for extracting the data you need from websites. In a fast, simple, yet extensible way, https://scrapy.org
  4. Mewariskan Semangat Bung Hatta kepada Para Pemuda Karang Taruna di Rukun Tetangga, http://pemerintahan.openthinklabs.com/2017/12/mewariskan-semangat-bung-hatta-kepada-para-pemuda-karang-taruna-di-rukun-tetangga.html
  5. Selenium, https://www.seleniumhq.org
  6. 20+ Python Web Scraping Examples (Beautifulsoup & Selenium), https://likegeeks.com/python-web-scraping/

Monday, 12 June 2017

Python untuk Pengembangan IoT

Status : Draft

Referensi


  1. Zerynth,  middleware for smart devices, IoT and Industry 4.0 applications, https://www.zerynth.com/

Wednesday, 7 June 2017

PySide : Instalasi

Status : Draft

Ketika melakukan instalasi via pip ( sudo pip install PySide), saya mendapatkan error seperti berikut :

    /usr/bin/ld: /usr/local/lib/python2.7.9/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC
    /usr/local/lib/python2.7.9/lib/libpython2.7.a: error adding symbols: Bad value
    collect2: error: ld returned 1 exit status
    libshiboken/CMakeFiles/libshiboken.dir/build.make:381: recipe for target 'libshiboken/libshiboken-python2.7.so.1.2.4' failed
    make[2]: *** [libshiboken/libshiboken-python2.7.so.1.2.4] Error 1
    CMakeFiles/Makefile2:204: recipe for target 'libshiboken/CMakeFiles/libshiboken.dir/all' failed
    make[1]: *** [libshiboken/CMakeFiles/libshiboken.dir/all] Error 2
    Makefile:127: recipe for target 'all' failed
    make: *** [all] Error 2
    error: Error compiling shiboken
 

Ternyata hal ini terjadi karena python yang digunakan di Ubuntu, dikompilasi tanpa opsi --enable-shared, oleh karena itu kita perlu melakukan kompilasi ulang python.

sudo wget http://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
sudo tar -xvvzf Python-2.7.9.tgz
cd Python-2.7.9/
sudo ./configure --enable-shared --prefix=/opt/python   LDFLAGS=-Wl,-rpath=/opt/python/lib
sudo make
sudo make install
sudo update-alternatives --install /usr/bin/python python /opt/python/bin/python 1
sudo update-alternatives --config python

Install pip :

wget -c https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
sudo pip install PySide






Sunday, 14 May 2017

Beautiful Soup

Status : Draft

Referensi


  1. Beautiful Soup, a Python library designed for quick turnaround projects like screen-scraping, https://www.crummy.com/software/BeautifulSoup/