Posts for: #Python

Invoking Python scripts from test cases running within a venv

Before the final release, I like to test my Python scripts the way these are supposed to be invoked in actual environment, usually with command line arguments. And this is apart from the unit testing and integration testing that I have for the individual modules. I also use Python venv for development because I don't like to directly install all the required libs in my operating system, thus keeping the system PATH clean from the development libs. Invoking a Python script within the test cases is easy, you just need to use the os.system() function. But running a Python script from os.system() using the 'python script-name.py' syntax invokes the python executable from the OS even if I am running the outer Python test case from withing a venv.

[Read more]

Brushing up Python

I have been brushing up my skills in Python from last week. I am a Java developer by profession and my love for Python came purely from a hobby perspective. But nevertheless, love is love. First time I learnt Python when I was still not that into Java and the Python version was 2.x. But this time, I went with the version 3.x.
I am also learning how to make GUI application with PyGObject since PyGtk is not used in new development anymore. This is some amazing work by the developers that I don't have to work in C++ to make GTK+ applications. My next goal is to make my first application in Python and GTK+, albeit a simple one, which I might publish also.

[Read more]