Re: is there history command in python?

2012-09-03 Thread Aldrich DeMata
Look at the readline module or use ipython. Aldrich On Mon, Sep 3, 2012 at 9:47 PM, contro opinion wrote: > in bash ,history command can let me know every command which i execute in > history, > is there a same command in python console?if there is no,how can i know > the historical inputs? > it

Re: Can parellelized program run slower than single process program?

2012-06-20 Thread Aldrich DeMata
The multiprocessing module allows the programmer to fully leverage *multiple * processors on a given machine (python docs). This allows the operating system to take advantage of any parallelism inherent in the hardware design. If you are using the module on non-multiprocessor machines, I think you

Re: Python equivalent to the "A" or "a" output conversions in C

2012-06-19 Thread Aldrich DeMata
Use the binascii module: >>> import numpy as np >>> x = np.float32(3.14) >>> x.dtype dtype('float32') >>> binascii.hexlify(x) 'c3f54840' The final result is little endian so it should be read as 0x4048f5c3 instead. You can verify the conversion using the link below: http://gregstoll.dyndns.org/~

Re: problem python

2012-06-06 Thread Aldrich DeMata
Python can't find site.py. It's either missing when you installed python, it was deleted, or it's located in another directory. Run >>> find / -iname 'site.py' , sudo if needed, and add the location of site.py in your python search path. The python online docs has a good documentation on python s