Virtual Environment setup

Virtual environment (venv shortly) is a python mechanism where it is possible to create a space for your project and specific packages required by it.

Cases when Virtual Environment is useful

  • when you want to develop a project which will require specific version of libraries and you don’t want to mess with version which your python is using globally;
  • when you want to test your project with cooperation with different python versions and packages version
    • especially when from different reasons your target environment forces you to use specific python version or packages version
      • for example when you are developing module for legacy system
  • due to cleaning reasons – with venv you can just move whole folder with virtual env to the OS trash space and that’s it – to remove all dependencies you don’t have to manually uninstall each library
  • portability – you can easily

Working model with virtual environment

  1. (only once) installation of virtual environment
  2. activation
  3. usage (calling the code like normal usage)
  4. deactivation

During daily work it is enough to perform steps 2-3-4;

Actions to install virtual environment

  1. create new folder for venv
create new folder for your virtual env
create new folder for your virtual env

2. open command line or powershell (or shell on Linux / macOS) and run following commands:

  • go to folder above your virtual environment

cd <path>

  • establish new virtual environment

python -m venv .\my_venv\

After starting this command you should wait about 10 sec to execute.

When finished content of your folder will look like this:

new virtual environment after creating
new virtual environment after creating

  • perform activation of virtual environment – depending on OS it can be performed in following ways:
    • Linux
      • source my_venv/bin/activate
    • Windows
      • my_venv\Scripts\activate

Since now your command prompt will have prefix with the name of python environment. This will inform you that you are working on virtual environment.

Your command prompt will look like this:

command line (here Powershell) after activation of virtual environment
command line (here Powershell) after activation of virtual environment

3. Now you can start to work on jour project – just create own folder (for example MyNewProject) in the path of your virtual environment – like here:

creating own path inside virtual environment
creating own path inside virtual environment

Inside your project you can develop your application, install web framework use git version control system, etc.

  • You can see list of currently installed packages in your virtual environment over command:

pip list

  • If you want to install new libraries – just run:

pip install <your package name>

! be sure that your virtual environment is active – otherwise libraries will be installed globally

4. After finishing your work with virtual environment – just call following command:


That’s it regarding working with virtual environment. enjoy!

Professional vs amateur software project

programming process
programming process

Most significant differences

Number of team member

Documentation and proper communication is crucial point.

  • Some team members can work remotely or on other part of the world!
    • clarifying even small issues can be a challenge when working hours are different.
  • It is worth in such cases to schedule regular meetings, in order to assure continuously information exchange process
    • Very important is to create a team which puts stress on transparency and sharing which activities are done by each team member.
    • Agile methodologies like SCRUM are supporting such processes very well; Inside SCRUM there are special meetings for it like daily SCRUM, Sprint review, Sprint planning.

Documentation is a key feature

Especially with long lasting project with many team members.

Some employee can be ill/change company/ etc. and this will mean that knowledge collected by them can be suddenly unavailable.

Docs will help to introduce new team members – this will require less time to put him on current track.

Usage of coding standards

Bigger projects with a lot of code (many thousands lines) are easier to read and maintain where the code was written conform with special standard.

Coding standards are expressing the way:

  • variables and functions naming;
  • a way of structuring the code (especially in C or Java);

Examples of such standards: clang-format, MISRA, PEP8 (for Python);

  • It is worth to use automated tools to check instantly the code standard inside IDE – like cppcheck, pc-lint, or pylint, flake8 (both last ones for python);

Usage of code-review processes

Automated checking tools (for coding standards ) are not assuring that the logic of implementation was done in a right way. To assure it there are processes where other team members are reviewing created code. This spreads good practices and knowledge across whole team.

Usage of version control system – for instance Git

Very important is also to create processes of working with such tool, for example “git-flow”. More info you can find here.

Build processes independent from IDE

  • To establish continuous integration processes
  • Allows that team members are using different IDEs
  • Example of such tool is CMake

Testing and debugging methods

Platform dependent parts should be splittet from remaining parts.

  • In such way most of code can run on the PC instead on target HW.
    • In this way it is possible to introduce unit-tests which can run in continuous integration process;

Continuous integration is automated building and testing process executed in a scheduled way. For example every night to obtain instant info about nr of bugs in the code.


As you can see there is a bit of points which are describing professional way of creating code. Of course it is not recommended to preform instant revolution inside your project. It is much better to perform evolution and make step by step improvement to achieve very efficient way of developing your application.

Feel free to share your opinion in the comment section.

Infos collected in this articles are based on my own experience and also on points posted here;

Logic Analyzer – basics, how to use

Table of content:

  1. Introduction and potential use cases for Logic Analyzers;
  2. How to handle logic analyzer
    1. from HW side
    2. from SW side
  3. Usage examples

Introduction and use cases

Logic Analyzer is a tool which is extremely useful (almost necessary) during debugging of digital communication. With this component we are able to decode what happens during message exchanging between two IC’s.

You can imagine that you are implementing inside your project handling of a new protocol to your new chip, but you are observing that your device is not working in a proper way. First what to you will do is starting to analyze what your code is doing. Unfortunately it may be insufficient. Especially in cases that you can’t find any bug in the code.

In such situations the best idea is to connect logic analyzer between your two devices and listen in (overhear) the communication process. This way you can assure that your microcontroller (or any kind other device) is sending proper messages. In similar way you can check that other communication member is responding in a proper way.

Generally logic analyzer is a method to check on HW side that communication works ok.

Disadvantages of Logic Analyzer

  • Logic analyzer is not able to measure analog signals
    • for such purposes you should use oscilloscope;
  • Logic Analyzers are designed to operate with specified maximal frequency
    • if your communication uses higher frequency signals you have to buy another (most expensive also) logic analyzer

Presentation usage of Logic Analyzer

In this article I want to present clone of Salae Logic analyzer.

Logic Analyzer
Logic Analyzer

Key features of presented logic analyzer:

  • price – about 10$
  • number of channels: 8 inputs
  • 24MHz sampling frequency
    • it is possible to reduce sampling frequency (between 25kHz and 24MHz)
  • 2 LEDs (red for power indication, green for connected CH1)
  • max nr of samples 1G
  • possibility to chose method of sampling:
    • rising edge
    • falling edge
    • high level
    • low level
  • powered over USB
  • ability to decode following protocols:
    • UART (RS232)
    • SPI
    • I2C
    • CAN
    • 1Wire
    • Manchester
    • … many more over additional plugins
  • at purchasing you receive USB cable and connecting cables

In case of decoded protocols we are receiving not only the course of the signal, but also data are already translated either to ASCII or HEX form.

Hardware connection

In order to perform measurement we have to connect:

  • GND of the logic analyzer with GND of measured device;
  • Suitable channel to measured line.
    • When we need to measure more signals at the same time we have to also connect other channels.

When multiple channels are measured from different devices then GND have to be common.

Example with schematic will be presented later in this article.

Software usage

In order to be able to see results of a measurement we have to install proper program to handle data acquisition.

Logic analyzer presented here can be operated over to different programs:

  • Salae Software
    • This is official software of company SALAE. In this article I will show you how to use it.
    • Curiosity – SW was developed in Python with GUI Qt framework.
  • Open Source – Sigrok
    • This is free software which is also operable with this logic analyzer. In next article I plan to describe how to work with Sigrok.

Installation process

Here you have link to download Salae software. After installation you can find launcher in specified folder or in windows 10 just type “Logic” to search pan.

Searching of Salae SW on windows machine
Searching of Salae SW

Using the program

After connecting logic analyzer to the PC open “Logic” program. After it you should see following screen:

Salae Logic - after opening
Salae Logic – after opening

In order to present functionalities I will introduce you two logic analysis examples:

  1. UART communication sent from Arduino Leonardo to PC;
  2. Temperature measurement over 1-Wire communication (usage DS18B20 sensor);

1. Analysis of UART communication

To execute this exercise you will need:

  • Arduino Leonardo / Nano
    • or any other microcontroller capable to send UART messages like STM, AVR, PIC, 8051, etc.
  • UART TTL adapter;
  • Logic Analyzer
Exercise 1 - connection schema
Exercise 1 – connection schema
Exercise 1 - connection photo

Exercise 1 – connection photo

Perform following steps:

  1. Connect HW as on above schema and photo;
  2. Open Arduino studio and flash following program
    • hint: to perform this example you can also use Arduino Nano (or any clone of it);
    • copy code and paste to your Arduino IDE;
  3. Open terminal to observe UART communication and assure that everything works fine
    • Assure that settings are properly set (baudrate 9600, 8 data bit, no partity and one stop bit) – see photo below;
 Exercise 1 - Terminal settings
Exercise 1 – Terminal settings

Steps in Salae Software

1.Open Salae Logic;

2. Choose type of protocol (Async Serial for UART)

Exercise 1 -  Choose protocol type
Exercise 1 – Choose protocol type

3. In appeared window choose UART configuration – then click save

Exercise 1 -  Set UART properties
Exercise 1 – Set UART properties

4. Choose sampling rate and how long measurement should take. (click on green arrow next to Start button);

Exercise 1 -  Set sampling-rate and measurement duration
Exercise 1 – Set sampling-rate and measurement duration

in some cases when measured signals are to high frequency Salae Logic will suggest to increase sampling time;

5. at the final stage you can set how big should be presented measured signal (only to analyze comfort)

Set size of signal view
Set size of signal view

Start data acquisition;

  • click big green button Start;
  • you should observe result similar as on below photo:
Exercise 1 -  Measured Signal
Exercise 1 – Measured Signal

In order to zoom-in the view – press ctrl and mouse scroll mouse

Analyze the data

Exercise 1 -  Data Analysis
Exercise 1 – Data Analysis

It is possible also to choose type of decoding (like ASCII or HEX) – as in the picture above.

2. Temperature measurement – sensor DS18B20 over 1Wire

In the second exercise I will show You how to work with analyzing 1Wire communication;

To execute this exercise you will need:

  • Arduino Leonardo / Nano
    • or any other microcontroller capable to send UART messages like STM, AVR, PIC, 8051, etc.
  • DS18B20 temperature sensor;
  • Resistor 4.7kOhm (in case that you are not using any special kit / board with sensor where such resistor is already embedded)
  • Logic Analyzer
Exercise 2 -  connection schema
Exercise 2 – connection schema
Exercise 2 -  connection photo
Exercise 2 – connection photo

Perform following steps:

  1. Connect HW as on above schema and photo;
  2. Open Arduino studio and flash following program
    • hint: to perform this example you can also use Arduino Nano (or any clone of it);
    • copy code and paste to your Arduino IDE;
  3. Open terminal to in Arduino studio – you should receive communication messages like on below photo;
Exercise 2 -  Arduino terminal messages
Exercise 2 – Arduino terminal messages

Steps in Salae Software

1.Open Salae Logic;

If you have other analyzer already configured – click on settings window and click “Remove Analyzer”

Exercise 2 -  remove old analyzer
Exercise 2 – remove old analyzer

2. Choose type of protocol – Check 1Wire

Exercise 2 – choose 1Wire protocol

3. Choose channel 1

Exercise 2 -  choose channel
Exercise 2 – choose channel

4. Analog like in previous exercise:

  • choose sampling rate – 2Ms/s
  • measurement duration – 8s

and then click Start button

5. You should observe measurement like that:

Exercise 2 – results


That all for this presentations of possibilities to use Logic Analyzer.

If you have any question – feel free to share it in comment below.

Python GUI Kivy Tutorial – part 1 – install Kivy library and demo running

Kivy Logo

In order to create python application with user interface it is needed to use right libraries (packages). 

One of them is Kivy. Huge advantage of this package is that it is cross-platform. So programs written with it can be run on different operating systems.

Continue reading “Python GUI Kivy Tutorial – part 1 – install Kivy library and demo running”

Total Commander Tutorial – First steps: Installation, Multiple Rename of Files or Folders, FTP transferring, File Comparing

In this article I would like to present You a Total Commander – very useful tool in daily working. This article is also available in YouTube video here.

Total Commander is a file manager which in compare to common Windows Explorator has got following additional functionalities:
  • Rename multiple files / folders;
  • Transferring files over network with ftp protocol;
  • Comparing of two files in easy way;
Disadvantage of this program is that it runs only on windows machines.


I recommend to download Total Commander from this main site for it.

Total Commander download section

You can click here to download installer which will install automatically suitable version for your windows 64 or 32 bit.
Choose server from which it should be downloaded.

choosing download server

Open downloaded file. You can follow my actions during installation as presented on my YouTube video.

First run

During first run you can see configuration window. At the tab “Display” you can activate option “show hidden files”. It will be helpful if you are working with this kind of files.

activating displaying hidden files

Now you have possibility to choose icon styles in total commander. It is up to you witch version you will choose.

choosing menu icon style

I encourage you to take a look on menu bar in Total Commander. For example here You can activate configuration window:

Activating configuration window in Total Commander.

Following two windows are characteristic for total commander. You can also easy create new tab in each window by pressing ctrl+t. Over ctrl+w you can close the tab. Shortcuts will be presented at the end of article.

Working windows in Total Commander.

By right mouse click on a file or folder you can select it. Selection can be also made by pressing space bar or insert key.
When you hold right mouse click more than 1 second on a file or folder you will see properties menu.

Rename Multiple files / folders

Firstly you can create ‘sandbox’ folder to try these functionalities. Inside create additional folders. Pressing F7 creates new folder.
To rename these folders select all of them by ctrl+a. Renaming tool can be found on a button bar

Renaming tool in Total Commander

Inside this tool you can define pattern according to which all folders will be named. For example [N] means the old name.
I will create new pattern which will consist from counter – which will start from 001. 3 digits should be presented. After it I put underline and than I will put creation date of the folder with underline. In order to set date with such underline you can follow my steps on the video (4:12). Field with pattern can look like here:

Multi Rename tool

When You are ready click start and close the tool. After that changes should be visible.

Transferring Files over FTP

Let’s assume that You have a hosting account where You publish your internet website. In order to send website files like html, it is needed to send them to server over ftp protocol. To establish ftp connection we have to use login and password which you received from hosting company.

In total commander we have to go to menu net and then choose “ftp connect”:

Menu for FTP connectionsWe see a window which asks you to choose which connection settings should be used. Now click on “New connection…”.

Menu with saved ftp connections

In this window you should define here session name, for instance “my_website”. At the field host name you should paste name of the server or name your website. You should also write down your user name.
If You have some problems with connection check this option this can help if connection is blocked by your firewall.
!!! Caution: I don’t recommend you to save password for your website inside Total Commander! Many viruses are able to steal the password from Total Commander and in such way attack your website. It is much better to set FTP connection without password and write it during every ftp connection!

FTP connection settings

When You finish you can click on ok button. New session should be right now established.
When You want to finish – click with right mouse click – Disconnect.

Disconnecting FTP session

Comparing two text files

In order to compare two files we can create inside sandbox folder two example text files. You can do it by pressing shift+F4 key.

By pressing shift+F6 you can change file name into for instance main.c known from C programming language.
Lets create second file with name example.c You can write down two similar text into both files. After that you are ready to compare content of these two files.
Select both files (for example with space-bar). After that click here:

Activating tool compare by content

As you can see Total Commander has shown us the differences in our two files.
In order to be able to see difference between ‘O’ and ‘0’(zero) sign, I recommend to change font into Consolas. This font clearly display the difference between such signs. Here you can change the font:

Changing font in Compare Content tool 

Total Commander Shortcuts

Here under is presented list of Total Commander shortcuts which in my opinion are most used:
  • ctrl + t – create new tab
  • ctrl + w – remove tab
  • ctrl + u – swap windows
  • ctrl + i – switches between windows
  • ctrl + r – refresh window
  • space bar / insert – selecting folder or file
  • F7 – create new folder
  • left mouse click + shift – multiple selection
  • shift + F4 – create new file
  • shift + F6 – change file name
  • alt + shift + enter – presents size of folders in window (for some folders it is need to run total commander as administrator to obtain detail size)

Total Commander YouTube Video

Things You should do in order to destroy Your life!

I would like to start this blog with something about self-development, because due to development of my own personality I’m able to present you some of that what I’m doing and what makes me better every day. Hereunder I summarized in ironic way some life tips which I hope will be never used by you. I wish You a pleasant lecture.

Continue reading “Things You should do in order to destroy Your life!”