I am using matplotlib to produce a plot which I then save to a PNG file using matplotlib.pyplot.savefig. It all works fine, but the filesize is quite large (about 120Kb). I can use ImageMagik ...

I am using matplotlib to produce a plot which I then save to a PNG file using matplotlib.pyplot.savefig. It all works fine, but the filesize is quite large (about 120Kb). I can use ImageMagik ...

Look at the following: /home/kinka/workspace/py/tutorial/tutorial/pipelines.py:33: Warning: Incorrect string value: '\xF0\x9F\x91\x8A\xF0\x9F...' for column 't_content' at row 1 n = self.cursor....

Look at the following: /home/kinka/workspace/py/tutorial/tutorial/pipelines.py:33: Warning: Incorrect string value: '\xF0\x9F\x91\x8A\xF0\x9F...' for column 't_content' at row 1 n = self.cursor....

I'm using python to manage some simulations. I build the parameters and run the program using: pipe = open('/dev/null', 'w') pid = subprocess.Popen(shlex.split(command), stdout=pipe, stderr=pipe) My ...

I'm using python to manage some simulations. I build the parameters and run the program using: pipe = open('/dev/null', 'w') pid = subprocess.Popen(shlex.split(command), stdout=pipe, stderr=pipe) My ...

I'm using rdpcap function of Scapy to read a PCAP file. I also use the module described in a link to HTTP support in Scapy which is needed in my case, as I have to retrieve all the HTTP requests and ...

I'm using rdpcap function of Scapy to read a PCAP file. I also use the module described in a link to HTTP support in Scapy which is needed in my case, as I have to retrieve all the HTTP requests and ...

First, I couldn't find an answer to this in PEP 8. That doesn't mean it isn't in there. Feel free to point me at it. Which style do you prefer? The first one: if spam: # Do stuff. return ...

First, I couldn't find an answer to this in PEP 8. That doesn't mean it isn't in there. Feel free to point me at it. Which style do you prefer? The first one: if spam: # Do stuff. return ...

In general we could have matrices of arbitrary sizes. For my application it is necessary to have square matrix. Also the dummy entries should have a specified value. I am wondering if there is ...

In general we could have matrices of arbitrary sizes. For my application it is necessary to have square matrix. Also the dummy entries should have a specified value. I am wondering if there is ...

One of the reasons I love Python is the expressive power / reduced programming effort provided by tuples, lists, sets and dictionaries. Once you understand list comprehensions and a few of the basic ...

One of the reasons I love Python is the expressive power / reduced programming effort provided by tuples, lists, sets and dictionaries. Once you understand list comprehensions and a few of the basic ...

I would like to have a more colorful Python prompt in the terminal, just for readability. I currently have: sys.ps1 = '\033[96m>>> \033[0m' sys.ps2 = '\033[96m... \033[0m' in my ...

I would like to have a more colorful Python prompt in the terminal, just for readability. I currently have: sys.ps1 = '\033[96m>>> \033[0m' sys.ps2 = '\033[96m... \033[0m' in my ...

Lets say I have a python model fibo.py defined as below: #Fibonacci numbers module print "This is a statement" def fib(n): a,b = 0,1 while b < n: print b a, b = b, a+b def ...

Lets say I have a python model fibo.py defined as below: #Fibonacci numbers module print "This is a statement" def fib(n): a,b = 0,1 while b < n: print b a, b = b, a+b def ...