python - page 2

  • 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 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 clue. If you you recognize this situation – The following script I wrote allows to overcome this issue and change name of python processes to unique one. read more
    Changing the process name of python script in windows
  • Download Files with fileloader

    The `fileloader` allows to access local files and remote files – files which are accessible thought HTTP and FTP protocols – in uniform way. The files can be cached locally. read more
    Download Files with fileloader
  • Solution to producer and consumer problem in python

    In my last project, I needed 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. read more
    Solution to producer and consumer problem in python
  • Log exception in python

    When exceptions happens, you may find it useful to log the exception and its stack trace for further investigation. In this article, you will learn how to retrieve the current exception and its properties – its type and its stack trace. read more
    Log exception in python
  • Mimic reference parameters in python

    In my recent project, I needed to migrate c# code which uses reference parameters. Unfortunately, python does not support reference parameters - In this article we will see how can we mimic their semantics in python. read more
    Mimic reference parameters in python