Tutorials about python - page 3

Restrict the creation of objects in python

While c++ and Java has an authorization system for accessing class entities such as methods and member variables, Python does not have one. In this article, we will see how we can create an authorization system to avoid accidents.

Changing the process name of python script in windows

You have created several python scripts and running them simultaneously. You decide you want to kill the first script you run. As always, you open Windows Task Manager but then you see several python.exe processes. Which one is the script you want to kill? You do not have a clue. If you recognize this situation – The following script I wrote allows to overcome this issue and change the name of python processes to a unique one.

Solution to producer and consumer problem in python

In my last project, I needed to synchronize producer and consumers threads. The producer thread was responsible to generate the tasks while the consumer threads were responsible to execute them. This classic producer and consumer problem can be easily solved using the Queue module.