Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Where Have You Installed Your Python Packages?

PrefaceI am writing this article because I recently noticed in the Python community that there are several frequently asked questions:Why does running the command after installing pip result in a "executable not found" error?Why does importing a module result in a "ModuleNotFound" error?Why can I run my code in PyCharm, but it doesn't work in the command prompt?Rather than just providing solutions, it is better to teach people how to fish. To address these types of issues, you need to understand how Python locates packages. I hope that after reading this article, you will find it helpful.How P...

9,232 0       PYTHON PATH PATH_PREFIX PACKAGE LOCATION


  Problem and Solution for Installing wxPython on Ubuntu 20.04

When we try to install wxPython lib on Ubuntu system to do software GUI development,most of time we may meet some installation and lib dependency problems. For the latest Ubuntu version, the problems still happen. Below are some common problems which happened frequently and their solution:---------------------------------------------------------------------------------------------------------------Problem [1]: Install wxPython on Ubuntu 20.04 fail because of dependency package Gtk is not installed.Error Message:No package 'gtk+-3.0' found Package gthread-2.0 was not found in the pkg-config sea...

22,847 7       UBUNTU 20.04 WXPYTHON PYTHON


  Mutli-inheritance bug between python 2.7 and 3.7

When we have run a py3.7 code under py2.x or a py2.x code under 3.x ,if a class do mutli-inheritance from 2 parent and the 2 parents also got inheritance from same parent, the different way to handle inheritance chain between python 2 and 3 will cause some running time bug:Assume we got this sample program inheritTest.py :# Purpose: Test mutli-inheritance different between python2 and 3# Author: Yuancheng Liu# Created: 2019/05/16class A: def getVal(self): print("call A's getVal()") def setVal(self): print("call A's setVal()")class B(A): def getVal(self): ...

2,589 1       PYTHON PYTHON 3 INHERITANCE


  Processing Unicode Data in Python - A Primer to Understand Non-English Data Processing

Introduction:Currently we live in a world where people of diverse cultures/backgrounds use electronic devices to express their ideas, do their daily work that earns them their daily bread, and entertain themselves using content that is created using their own language and so on. Naturally, in order to make all these things happen, any computational instrument, be it a laptop or a desktop computer, or a smartphone, or something else, should be capable enough to serve all of these things in a manner that is transparent to the end user. Normally, we create programs that are capable of handling na...

3,525 0       PYTHON UNICODE ASCII CODE NON-ENGLISH DATA UTF-8


  Bug caused by using changeable value as the default in "python method overload"​

In python we can set the passed in parameter's default value to make the function has the same running feature as the method overload in Java.Define a function like this:def testFunction(self, param1, param2=None, param3=None):Normally we use "None" as the parameter's default value. We can also use str/bool as the default value, but is it OK we use empty list [] as its default value?This is our test program:""" A test program using empty list as the passed-in parameter's default value."""class TestFunc(object): def __init__(self, id, parm = []): self.ObjId = id self.parm = ...

2,791 0       PYTHON


  Is Python all set to triumph over Java?

Python is one of the top programming languages of the present time. A variety of companies with different backgrounds and offerings have embraced the capabilities of Python to make wonderful tech products. As, Java is also known to be one of the most recognized languages, therefore, there is a constant battle that takes place between the two languages. Python wants to dethrone Java as the number one, whenever it is and vice versa. It is like the tussle between Android and iOS which is never ending. Both of the languages were introduced to the world in the 90’s.Shortly after the emergence...

1,735 0       DEVELOPMENT JAVA PYTHON DJANGO


  Python Disrupts the Programming Language World- Gets Hot and Popular

Python is one of the fastest growing languages currently. It is undeniable that more and more programmers use Python and deploy it to the best of their use. Everyone, from the freelancer and startups to giant corporations and even governments, is using Python. Let us have a look at the reasons that make it so popular. Training:According to research, 8 out of 10 tech schools in the US teach Python over JAVA. Even the three major MOOC platforms, edX, Coursera, and Udacity have a similar approach and have introductory programmes before anything else and promote it on a massive level. &n...

9,282 1       DEVELOPMENT PYTHON TEAM


  Format JSON data on Ubuntu

JSON now becomes a very popular data format because of its simplicity and light-weight. Nowadays many RESTful APIs will offer a choice of exchanging JSON data between the server and client. Sometimes the data may not be formatted and it cannot be easily read by human beings. It's frequently desired that the unformatted JSON data should be formatted before read.Today we will show a few ways to format JSON data on Ubuntu. Assume we have a json file test.json with below content.{ "title": "Test", "description": "Sample description" }The normal cat command will output below content.postman@postman...

27,584 1       UBUNTU LINUX RUBY PYTHON NODEJS PERL JSON JQ YAJL