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

2012-06-20 Thread Dave Angel
On 06/21/2012 01:05 AM, Yesterday Paid wrote: > from multiprocessing import Pool > from itertools import product > > def sym(lst): > x,y=lst > tmp=x*y > if rec(tmp): > return tmp > else: > return None > > def rec(num): > num=str(num) > if num == "".join(rever

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

Can parellelized program run slower than single process program?

2012-06-20 Thread Yesterday Paid
from multiprocessing import Pool from itertools import product def sym(lst): x,y=lst tmp=x*y if rec(tmp): return tmp else: return None def rec(num): num=str(num) if num == "".join(reversed(num)):return True else:return False if __name__ == "__m

Re: Is python a interpreted or compiled language?

2012-06-20 Thread Stefan Behnel
Dave Angel, 21.06.2012 02:53: > On 06/20/2012 07:30 PM, gmspro wrote: >> Is python a interpreted or compiled language? > > Ian has given you a good answer. But since you mention java, I'd like > to point out a few things that are different between the two > environments. He and I are describing C

Re: Is python a interpreted or compiled language?

2012-06-20 Thread Ian Kelly
On Wed, Jun 20, 2012 at 7:27 PM, Chris Angelico wrote: > Java's bytecode and source code are two distinct languages, both well > documented and separately usable (and with their own distinct > limitations - there are things you can do in Java bytecode that you > cannot do in Java source). I can t

Re: Re: Is python a interpreted or compiled language?

2012-06-20 Thread Evan Driscoll
On 6/20/2012 19:53, Dave Angel wrote: > But since you mention java, I'd like > to point out a few things that are different between the two > environments. He and I are describing CPython; jython and other > implementations don't use .pyc files, and they behave differently. There's one more impo

Re: Is python a interpreted or compiled language?

2012-06-20 Thread Steven D'Aprano
On Wed, 20 Jun 2012 18:27:53 -0600, Ian Kelly wrote: > On Wed, Jun 20, 2012 at 5:30 PM, gmspro wrote: >> >> Hi, >> >> Is python a interpreted or compiled language? > > Like other languages that use a VM bytecode, it's a little bit of both. > The actual Python code is compiled into Python byteco

Re: Is python a interpreted or compiled language?

2012-06-20 Thread Chris Angelico
On Thu, Jun 21, 2012 at 10:53 AM, Dave Angel wrote: > With java, one has to explicitly compile the java code, while with > CPython, the runtime logic compiles imported modules if they're not > already compiled. Putting it another way: Java's bytecode and source code are two distinct languages, b

Re: Tkinter binding question

2012-06-20 Thread rantingrickjohnson
On Wednesday, June 20, 2012 12:07:04 PM UTC-5, Frederic Rentsch wrote: > [...] > Googling I chanced on an excellent introduction "Thinking in > Tkinter" [...] He sets out identifying a common problem with > tutorials: The problem is that the authors of the books want to rush > into telling me abou

Re: Is python a interpreted or compiled language?

2012-06-20 Thread Dave Angel
On 06/20/2012 07:30 PM, gmspro wrote: > Hi, > > Is python a interpreted or compiled language? > What does happen after this command: python f.py > > I knew python makes file.pyc file to store the bytecode. For java , .class > file is the bytecode file, someone can run that file from any machine. S

Jython and PYTHONSTARTUP

2012-06-20 Thread Steven D'Aprano
Does Jython 2.5 honour the PYTHONSTARTUP environment variable? According to my testing, it doesn't. There used to be a page describing the differences between Jython and CPython here: http://www.jython.org/docs/differences.html but it appears to have been eaten by the 404 Monster. -- Steve

Re: Is python a interpreted or compiled language?

2012-06-20 Thread Ian Kelly
On Wed, Jun 20, 2012 at 5:30 PM, gmspro wrote: > > Hi, > > Is python a interpreted or compiled language? Like other languages that use a VM bytecode, it's a little bit of both. The actual Python code is compiled into Python bytecode. The bytecode is interpreted. > What does happen after this c

Is python a interpreted or compiled language?

2012-06-20 Thread gmspro
Hi, Is python a interpreted or compiled language? What does happen after this command: python f.py I knew python makes file.pyc file to store the bytecode. For java , .class file is the bytecode file, someone can run that file from any machine. So is the .pyc file executale like java? Can anyo

xlrd 0.7.9 released!

2012-06-20 Thread Chris Withers
Hi All, I'm pleased to announce the release of xlrd 0.7.9: http://pypi.python.org/pypi/xlrd/0.7.9 This release fixes an annoying merge bug on my part that resulted in a "NameError: global name 'BYTES_X00' is not defined" error where opening certain Excel files. Barring any more brown bag is

Re: Py3.3 unicode literal and input()

2012-06-20 Thread Ian Kelly
On Jun 18, 2012 8:07 AM, "jmfauth" wrote: > A string is a string, a "piece of text", period. > > I do not see why a unicode literal and an (well, I do not > know how the call it) a "normal class " should behave > differently in code source or as an answer to an input(). Strings are a data type th

RE: Custom build of Python

2012-06-20 Thread KACVINSKY Tom
Terry, At this stage, I don't want or need an MSI. I just want something that will bundle the executables/dynamic load libraries + compiled Python files and stick them into a compliant directory structure. Regards, Tom -Original Message- From: python-list-bounces+tky=3ds@python.or

Re: DirectX Screenshot with python possible?

2012-06-20 Thread Terry Reedy
On 6/20/2012 2:24 PM, Sverre wrote: I'm in need for a function that is able to make a screenshot from a directx full screen. PIL is only able to take a snapshot from the desktop, but not from any directx screen. Has someone a tip for an existing module? Perhaps pygame has (or wraps) such a f

Re: Custom build of Python

2012-06-20 Thread Terry Reedy
On 6/20/2012 2:24 PM, KACVINSKY Tom wrote: I had reason to build Python 2.6.8 with Microsoft Visual Studio 2010. I was able to get the pcbuild solution to build, and I have the necessary exes/dlls/pyds in the amd64 build directory. What is not clear to is how to complete the build and make an i

Re: Is that safe to use ramdom.random() for key to encrypt?

2012-06-20 Thread Paul Rudin
elvis-85...@notatla.org.uk writes: > On 2012-06-17, Jon Clements wrote: > >> Whatever you do - *do not* attempt to write your own algorithm. > > very true If everyone took that advice then we'd have a problem -- http://mail.python.org/mailman/listinfo/python-list

execnet-1.1: cross-interpreter distributed execution library

2012-06-20 Thread holger krekel
execnet-1.1 is a backward compatible beta release of the popular (>53000 pypi downloads of 1.0.9) cross-interpreter execution library. If you are in need of connecting Python2 and Python3 and/or want to throw PyPy in your deployment mix, then you might want to join Quora and many others and try o

Re: Py3.3 unicode literal and input()

2012-06-20 Thread Steven D'Aprano
On Wed, 20 Jun 2012 01:12:00 -0700, jmfauth wrote: > Python 3.3.0a4 (v3.3.0a4:7c51388a3aa7+, May 31 2012, 20:15:21) [MSC v. > 1600 > 32 bit (Intel)] on win32 --- > running smidzero.py... > ...smidzero has been executed What is "smidzero.py", and what is it doing? --- > input(':') > :él

Custom build of Python

2012-06-20 Thread KACVINSKY Tom
I had reason to build Python 2.6.8 with Microsoft Visual Studio 2010. I was able to get the pcbuild solution to build, and I have the necessary exes/dlls/pyds in the amd64 build directory. What is not clear to is how to complete the build and make an installation. I could not find any docume

Re: Is that safe to use ramdom.random() for key to encrypt?

2012-06-20 Thread Roy Smith
In article , Chris Angelico wrote: > Well, for communication it's even easier. Pick up an SSL or SSH > library and channel everything through that! +1 on this. Actually, plus a whole bunch more than 1. I worked on a project which had rolled their own communication layer (including encryption).

Re: fastest method

2012-06-20 Thread david.gar...@gmail.com
I see one issue;) # if last doesn't exist or is greater than current This else doesn't catch the last greater than current: This is a little messy. with open(filename) as f: print "Here is filename:%s" %filename f.seek(0, 2) eof = f.tell() print "Here is eof:%s" %eof if la

DirectX Screenshot with python possible?

2012-06-20 Thread Sverre
I'm in need for a function that is able to make a screenshot from a directx full screen. PIL is only able to take a snapshot from the desktop, but not from any directx screen. Has someone a tip for an existing module? -- http://mail.python.org/mailman/listinfo/python-list

fastest method

2012-06-20 Thread david.gar...@gmail.com
I am looking for the fastest way to parse a log file. currently I have this... Can I speed this up any? The script is written to be a generic log file parser so I can't rely on some predictable pattern. def check_data(data,keywords): #get rid of duplicates unique_list = list(set(data))

Re: Tkinter binding question

2012-06-20 Thread Frederic Rentsch
On Tue, 2012-06-19 at 19:19 -0700, rantingrickjohn...@gmail.com wrote: > On Tuesday, June 19, 2012 10:55:48 AM UTC-5, Frederic Rentsch wrote: > > If I copy your event descriptors into my program, the button-release > > callback still fails. It works in your code, not in mine. Here is what > > my co

Re: Is that safe to use ramdom.random() for key to encrypt?

2012-06-20 Thread Christian Heimes
Am 20.06.2012 17:25, schrieb D'Arcy Cain: > As "they" say, random number generation is too important to be left > to chance. :-) Hilarious! You made my day! :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Is that safe to use ramdom.random() for key to encrypt?

2012-06-20 Thread D'Arcy Cain
On 12-06-20 11:18 AM, elvis-85...@notatla.org.uk wrote: On 2012-06-17, Jon Clements wrote: Whatever you do - *do not* attempt to write your own algorithm. very true As "they" say, random number generation is too important to be left to chance. :-) -- D'Arcy J.M. Cain | Democrac

Re: Is that safe to use ramdom.random() for key to encrypt?

2012-06-20 Thread Chris Angelico
On Thu, Jun 21, 2012 at 1:18 AM, wrote: > On 2012-06-17, Jon Clements wrote: >> I generally find a separate partition with an encrypted file-system >> (which is fairly straight forward on *nix systems or I think there's a >> product out there that works with Windows), is a lot easier and puts th

Re: re.finditer with lookahead and lookbehind

2012-06-20 Thread MRAB
On 20/06/2012 14:30, Christian wrote: Hi, i have some trouble to split a pattern like s. Even have this problems with the first and last match. Some greedy problems? Thanks in advance Christian import re s='v1=pattern1&v2=pattern2&v3=pattern3&v4=pattern4&v5=pattern5&x1=patternx' pattern =r'

re.finditer with lookahead and lookbehind

2012-06-20 Thread Christian
Hi, i have some trouble to split a pattern like s. Even have this problems with the first and last match. Some greedy problems? Thanks in advance Christian import re s='v1=pattern1&v2=pattern2&v3=pattern3&v4=pattern4&v5=pattern5&x1=patternx' pattern =r'(?=[a-z0-9]+=)(.*?)(?<=&)' regex = re.co

ANN: Python Meeting Düsseldorf - 17.07.2012

2012-06-20 Thread eGenix Team: M.-A. Lemburg
[This announcement is in German since it targets a local user group meeting in Düsseldorf, Germany] ANKÜNDIGUNG Python Meeting Düsseldorf http://pyddf.de/ Ein Treffen v

Re: Py3.3 unicode literal and input()

2012-06-20 Thread jmfauth
On Jun 20, 11:22 am, Christian Heimes wrote: > Am 18.06.2012 20:45, schrieb Terry Reedy: > > > The simultaneous reintroduction of 'ur', but with a different meaning > > than in 2.7, *was* a problem and it should be removed in the next release. > > FYI:http://hg.python.org/cpython/rev/8e47e9af826e

Re: Py3.3 unicode literal and input()

2012-06-20 Thread Christian Heimes
Am 18.06.2012 20:45, schrieb Terry Reedy: > The simultaneous reintroduction of 'ur', but with a different meaning > than in 2.7, *was* a problem and it should be removed in the next release. FYI: http://hg.python.org/cpython/rev/8e47e9af826e Christian -- http://mail.python.org/mailman/listinfo/

Re: Py3.3 unicode literal and input()

2012-06-20 Thread jmfauth
On Jun 20, 1:21 am, Steven D'Aprano wrote: > On Mon, 18 Jun 2012 07:00:01 -0700, jmfauth wrote: > > On 18 juin, 12:11, Steven D'Aprano > +comp.lang.pyt...@pearwood.info> wrote: > >> On Mon, 18 Jun 2012 02:30:50 -0700, jmfauth wrote: > >> > On 18 juin, 10:28, Benjamin Kaplan wrote: > >> >> The u