Snippets of the day – Monday, October 14, 2013

Posted on Posted in Snippets

snip2code-scissors-text

Here are some of the most recently published snippets!

Basic code to manage threading in python

This simple example shows how to launch N threads in parallel and handle their execution.

Please note the object Thread, where you can define the method to be executed and parameter to be passed.

The main program will launch threads and wait for all to complete before continuing execution.

Open the snippet

Author:    lbottaro
synchronization thread threading Windows Python x86_64

How to clear a list in python

This code shows how to clear and remove all items in a list.

Note that also any reference to such list will be updated to an empty list.

Open the snippet

Author:    lbottaro
list remove items cleaning Python x86_64

Leave a Reply

Your email address will not be published. Required fields are marked *