Category: Coding
Info Percodingan
Menggunakan Modul Threading di Python
Threading adalah salah satu cara bagaimana kita dapat melakukan konkurensi dalam mengeksekusi sebuah operasi. Tidak seperti kode tanpa threading yang harus menunggu proses eksekusi kode sebelumnya beres, threading memisahkan sebagian kode dan mengeksekusinya di proses yang dia ciptakan sendiri. Namun dalam penggunaan threading harus diperhatikan jumlah resource yang menjadi pembatasnya. Jangan sampai proses yang berat, dieksekusi dengan menggunakan thread yang terlalu banyak sehingga menghabiskan ruang CPU … Continue reading Menggunakan Modul Threading di Python
PyQt5 Tutorial – Python GUI Programming Examples
How to Install Python 3.6.1 in Ubuntu 16.04 LTS
This quick tutorial is going to show you how to install the latest Python 3.6.1 in Ubuntu 16.04 LTS via PPA. Ubuntu 16.04 comes with both Python 2.7 and Python 3.5 by default. You can install Python 3.6 along with them via a third-party PPA by doing following steps: 1. Open terminal via Ctrl+Alt+T or searching for “Terminal” … Continue reading How to Install Python 3.6.1 in Ubuntu 16.04 LTS
Install Ruby
[Odoo 10] Technical Documentation
Mengenal List dan Berbagai Operasinya di Python
List adalah salah satu tipe data built-in Python, yang dapat digunakan kapan saja tanpa harus meng-import modul terlebih dahulu. List sebenarnya bukan arraymelainkan sebuah collection yang dapat menampung berbagai objek dengan tipe data. Biasanya array berisi nilai yang hanya satu tipe data saja. Beberapa operasi dan method yang dapat digunakan untuk memanipulasi python antara lain: akses elemen dengan indeksmengiterasi isi listmenghitung panjang list dengan len()menghitung kemunculan nilai tertentu dengan count()menambah nilai baru dengan append()mencari posisi suatu … Continue reading Mengenal List dan Berbagai Operasinya di Python
Designing a RESTful API with Python and Flask
In recent years REST (REpresentational State Transfer) has emerged as the standard architectural design for web services and web APIs. In this article I'm going to show you how easy it is to create a RESTful web service using Pythonand the Flask microframework. What is REST? The characteristics of a REST system are defined by six design rules: Client-Server: There … Continue reading Designing a RESTful API with Python and Flask
Testing Flask Applications¶
The origin of this quote is unknown and while it is not entirely correct, it is also not far from the truth. Untested applications make it hard to improve existing code and developers of untested applications tend to become pretty paranoid. If an application has automated tests, you can safely make changes and instantly know … Continue reading Testing Flask Applications¶
Sql query in Odoo model
@api.multi def get_all_so(self, name=None): sql = "select * from sale_order where name like '%s%' order by name desc;" % name self.env.cr.execute(sql) res_all = self.env.cr.fetchall() #fetchall() will return an array of dictionaries return res_all @api.multi def get_so(self, name=None): sql = "select * from sale_order where name like '%s' order by name desc;" % name self.env.cr.execute(sql) #fetchone() … Continue reading Sql query in Odoo model
