Re: Python preprosessor

2009-06-08 Thread Gabriel Genellina
En Sun, 07 Jun 2009 13:31:07 -0300, Tuomas Vesterinen escribió: I am developing a Python application as a Python2.x and Python3.0 version. A common code base would make the work easier. So I thought to try a preprosessor. GNU cpp handles this kind of code correct: #ifdef python2 print u

Fwd: Extract value and average

2009-06-08 Thread Francesco Pietra
Sorry, I missed the last part of the message This makes a more generic parser (comment/uncomment the corresponding "# 1" or "# 2" code based on whether a new block is found by a first line containing "NSTEP" or a last line containing "EWALD"). This > yields a dictionary for each item in the input

python version in snow leopard?

2009-06-08 Thread Alia Khouri
Does anyone know what version of python will appear in snow leopard which is apparently being released in September? -- http://mail.python.org/mailman/listinfo/python-list

Re: multi-core software

2009-06-08 Thread Piet van Oostrum
> Seamus MacRae (SM) wrote: >SM> Piet van Oostrum wrote: >>> By the way, there is a series of articles about concurrency on ACM Queue >>> which may be interesting for those participating in or just following >>> this discussion: >>> >>> http://queue.acm.org/listing.cfm?item_topic=Concurrency

multi-thread python interpreaters and c++ program

2009-06-08 Thread myopc
hi, all I am ruuning a c++ program (boost python) , which create many python interpreaters and each run a python script with use multi-thread (threading). when the c++ main program exit, I want to shut down python interpreaters, but it crashed. I have googled a lot but cant get any clue. here

Re: preferring [] or () in list of error codes?

2009-06-08 Thread Emile van Sebille
On 6/8/2009 8:43 PM Ben Finney said... Steven D'Aprano writes: In addition, using a tuple or a list in this context: if e.message.code in (25401,25402,25408): is so idiomatic, that using a set in it's place would be distracting. I think a list in that context is fine, and that's the id

Re: preferring [] or () in list of error codes?

2009-06-08 Thread Ben Finney
Steven D'Aprano writes: > In addition, using a tuple or a list in this context: > > if e.message.code in (25401,25402,25408): > > is so idiomatic, that using a set in it's place would be distracting. I think a list in that context is fine, and that's the idiom I see far more often than a t

Re: MD5 hash of object

2009-06-08 Thread Jeff McNeil
On Jun 8, 3:47 pm, Chris Rebert wrote: > On Mon, Jun 8, 2009 at 11:43 AM, lczancanella wrote: > > Hi, > > > in hashlib the hash methods have as parameters just string, i want to > > know how can i digest an object to get a md5 hash of them. > > Hashes are only defined to operate on bytestrings. Si

Re: preferring [] or () in list of error codes?

2009-06-08 Thread Steven D'Aprano
On Tue, 09 Jun 2009 11:02:54 +1000, Ben Finney wrote: > Carl Banks writes: > >> If you want to go strictly by the book, I would say he ought to be >> using a set since his collection of numbers has no meaningful order nor >> does it make sense to list any item twice. > > Yes, a set would be bes

Re: preferring [] or () in list of error codes?

2009-06-08 Thread Chris Rebert
On Mon, Jun 8, 2009 at 6:57 PM, samwyse wrote: > On Jun 8, 7:37 pm, Carl Banks wrote: >> On Jun 8, 4:43 pm, Ben Finney wrote: >> > m...@pixar.com writes: >> > > Is there any reason to prefer one or the other of these statements? >> >> > >         if e.message.code in [25401,25402,25408]: >> > >  

Re: preferring [] or () in list of error codes?

2009-06-08 Thread Charles Yeomans
On Jun 8, 2009, at 9:28 PM, Carl Banks wrote: On Jun 8, 6:02 pm, Ben Finney wrote: Carl Banks writes: If you want to go strictly by the book, I would say he ought to be using a set since his collection of numbers has no meaningful order nor does it make sense to list any item twice. Yes,

Re: Unbound Method Error

2009-06-08 Thread Chris Rebert
On Mon, Jun 8, 2009 at 7:23 PM, lczancanella wrote: > Hi, i am brand new in Python, so sorry if this question is too basic, > but i have tried a lot and dont have success... I have the following > code... > > class Funcoes: >    def CifradorDeCesar(mensagem, chave, funcao): >        mensagem_encrip

Unbound Method Error

2009-06-08 Thread lczancanella
Hi, i am brand new in Python, so sorry if this question is too basic, but i have tried a lot and dont have success... I have the following code... class Funcoes: def CifradorDeCesar(mensagem, chave, funcao): mensagem_encriptada='' if funcao == 1: for byte in mensage

Re: spammers on pypi

2009-06-08 Thread skip
Robert> I don't think a SpamBayes approach will work for this particular Robert> guy. It's not like completely fake metadata was uploaded with Robert> links to spam sites. There actually is Python code for some of Robert> them. Maybe even some that is marginally useful. But only

Re: Pyrex and refcounts (Re: unladen swallow: python and llvm)

2009-06-08 Thread bearophileHUGS
Greg: >Can you elaborate on those problems?< I can't, I am sorry, I don't remember the details anymore. Feel free to ignore what I have written about Pyrex, lot of people appreciate it, so it must be good enough, even if I was not smart/ expert enough to use it well. I have even failed in using i

Re: preferring [] or () in list of error codes?

2009-06-08 Thread samwyse
On Jun 8, 7:37 pm, Carl Banks wrote: > On Jun 8, 4:43 pm, Ben Finney wrote: > > m...@pixar.com writes: > > > Is there any reason to prefer one or the other of these statements? > > > >         if e.message.code in [25401,25402,25408]: > > >         if e.message.code in (25401,25402,25408): > > If

Re: multi-core software

2009-06-08 Thread rossberg
On Jun 8, 6:28 am, "Ken T." wrote: > > > Let's not forget Elite for the 6502 exploiting predictable performance > > in order to switch graphics modes partway down the vsync! > > That actually didn't require predictable timing.  You could tell the > video chip to send you an interrupt when it got t

Re: preferring [] or () in list of error codes?

2009-06-08 Thread Carl Banks
On Jun 8, 6:02 pm, Ben Finney wrote: > Carl Banks writes: > > If you want to go strictly by the book, I would say he ought to be > > using a set since his collection of numbers has no meaningful order > > nor does it make sense to list any item twice. > > Yes, a set would be best for this specifi

Any idea of stopping the execution of PyRun_File()

2009-06-08 Thread BigHand
Hi,All I have an embedded python application. which is a MFC app with Python interpreter embedded. In the App, I have a separate thread to execute a Python script (using the PyRun_File), but if the user want to stop the executing script, how should I do? A possible way is terminate the thr

Re: unladen swallow: python and llvm

2009-06-08 Thread Neal Becker
bearophileh...@lycos.com wrote: > s...@pobox.com: >> Why not just write extension modules in C then? > > In the past I have used some C for that purpose, but have you tried > the D language (used from Python with Pyd)? It's way better, > especially if you for example use libs similar to itertools

Re: preferring [] or () in list of error codes?

2009-06-08 Thread Ben Finney
Carl Banks writes: > If you want to go strictly by the book, I would say he ought to be > using a set since his collection of numbers has no meaningful order > nor does it make sense to list any item twice. Yes, a set would be best for this specific situation. > I don't think it's very importan

Re: networking simulator on python

2009-06-08 Thread Paul McGuire
On Jun 8, 7:18 pm, Ala wrote: > Hello everyone. > > I plan on starting to write a network simulator on python for testing a > modified version of TCP. > > I am wondering if a python network simulator exists? Also, if anyone > tried using simpy for doing a simulation. > > Thank you There was an ar

Pyrex and refcounts (Re: unladen swallow: python and llvm)

2009-06-08 Thread greg
bearophileh...@lycos.com wrote: I have tried to create a certain data structure with a recent version of Pyrex on Windows, and I have wasted lot of time looking for missing reference count updates that didn't happen, or memory that didn't get freed. Can you elaborate on those problems? The onl

Re: preferring [] or () in list of error codes?

2009-06-08 Thread Carl Banks
On Jun 8, 4:43 pm, Ben Finney wrote: > m...@pixar.com writes: > > Is there any reason to prefer one or the other of these statements? > > >         if e.message.code in [25401,25402,25408]: > >         if e.message.code in (25401,25402,25408): > > > I'm currently using [], but only coz I think it'

networking simulator on python

2009-06-08 Thread Ala
Hello everyone. I plan on starting to write a network simulator on python for testing a modified version of TCP. I am wondering if a python network simulator exists? Also, if anyone tried using simpy for doing a simulation. Thank you -- http://mail.python.org/mailman/listinfo/python-list

Network Simulator

2009-06-08 Thread Ala
Hello everyone. I plan on starting to write a network simulator on python for testing a modified version of TCP. I am wondering if a python network simulator exists? Also, if anyone tried using simpy for doing a simulation. Thank you -- http://mail.python.org/mailman/listinfo/python-list

Re: can it be shorter?

2009-06-08 Thread Steven D'Aprano
On Mon, 08 Jun 2009 12:57:58 -0700, Aaron Brady wrote: > Why won't Python permit: > > url.endswith( '/' ) or url.append( '/' ) > > ? Because: (1) Strings are immutable, so that won't work. (2) Even if it did, you're programming by side-effect, which is bad style often leading to bugs, and

Re: preferring [] or () in list of error codes?

2009-06-08 Thread Ben Finney
m...@pixar.com writes: > Is there any reason to prefer one or the other of these statements? > > if e.message.code in [25401,25402,25408]: > if e.message.code in (25401,25402,25408): > > I'm currently using [], but only coz I think it's prettier > than (). Use a list when the se

Re: preferring [] or () in list of error codes?

2009-06-08 Thread John Machin
pixar.com> writes: > > Is there any reason to prefer one or the other of these statements? > > if e.message.code in [25401,25402,25408]: > if e.message.code in (25401,25402,25408): > >From the viewpoint of relative execution speed, in the above case if it matters at all it ma

Re: preferring [] or () in list of error codes?

2009-06-08 Thread Scott David Daniels
m...@pixar.com wrote: Is there any reason to prefer one or the other of these statements? if e.message.code in [25401,25402,25408]: if e.message.code in (25401,25402,25408): I'm currently using [], but only coz I think it's prettier than (). context: these are database errors and

Re: preferring [] or () in list of error codes?

2009-06-08 Thread Stephen Hansen
On Mon, Jun 8, 2009 at 2:36 PM, wrote: > Is there any reason to prefer one or the other of these statements? > >if e.message.code in [25401,25402,25408]: >if e.message.code in (25401,25402,25408): > > I'm currently using [], but only coz I think it's prettier > than (). I like t

preferring [] or () in list of error codes?

2009-06-08 Thread mh
Is there any reason to prefer one or the other of these statements? if e.message.code in [25401,25402,25408]: if e.message.code in (25401,25402,25408): I'm currently using [], but only coz I think it's prettier than (). context: these are database errors and e is database excepti

Re: pythoncom and writing file "summary" info on Windows

2009-06-08 Thread Tim Golden
mattleftb...@gmail.com wrote: Hello, I was trying to put together a script that would write things like the Author and Title metadata fields of a file under Windows. I got the win32 extensions installed and found a few things that look like they should work, though I'm not getting the result I w

Re: Get the class name

2009-06-08 Thread Jeff McNeil
On Jun 8, 11:33 am, Gary Herron wrote: > Kless wrote: > > Is there any way of to get the class name to avoid to have that write > > it? > > > --- > > class Foo: > >    super(Foo, self) > > --- > > > * Using Py 2.6.2 > > The question does not make sense: >     "to have WHAT

Re: can it be shorter?

2009-06-08 Thread Aaron Brady
On Jun 8, 9:50 am, Jean-Michel Pichavant wrote: > Aaron Brady wrote: > > Shorter is always better. > > > url+= { '/': '' }.get( url[ -1 ], '/' ) > > Why bother with spaces or 3 letter-wide token, check this  :o) : > x+={'/':''}.get(x[-1],'/') > > Apart from joking, the following proposed solution

Re: is there python image lib that does imagemagick?

2009-06-08 Thread Michel Claveau - MVP
Hi! On Windows, you can drive (manage?) ImageMagick from Python, via COM. See: http://www.imagemagick.org/script/api.php#com+ @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrapping LabVIEW and DAQmx Libraries for Python

2009-06-08 Thread Stef Mientki
hi Ketteth, I was waiting for someone, making these available. The hardware modules of NI are very good, and they have a huge range of DAQ cards, even relative cheap ones. We use USB 6009 and 9162 container a lot ( now in Delphi, because the lack of Python drivers :-( I took a biref look at y

Re: MD5 hash of object

2009-06-08 Thread Chris Rebert
On Mon, Jun 8, 2009 at 11:43 AM, lczancanella wrote: > Hi, > > in hashlib the hash methods have as parameters just string, i want to > know how can i digest an object to get a md5 hash of them. Hashes are only defined to operate on bytestrings. Since Python is a high-level language and doesn't per

Re: spammers on pypi

2009-06-08 Thread Robert Kern
On 2009-06-08 14:32, Jesse Noller wrote: On Mon, Jun 8, 2009 at 3:14 PM, Robert Kern wrote: On 2009-06-08 07:44, Skip Montanaro wrote: On Jun 5, 1:39 pm, joepwrote: Is there a way to ban spammers from pypi? Can you provide some examples? It's possible that we can apply SpamBayes to PyPI

Re: Am I doing this the python way? (list of lists + file io)

2009-06-08 Thread bearophileHUGS
R. David Murray: > Given your description, I don't see any reason to prefer any alternate > data structure.  1000 small CSV files should fit in a modern computer's > memory with no problem...and if it does become an issue, worry about it > then. The OP can also try the "diff" command that can be f

Re: spammers on pypi

2009-06-08 Thread Jesse Noller
On Mon, Jun 8, 2009 at 3:14 PM, Robert Kern wrote: > On 2009-06-08 07:44, Skip Montanaro wrote: >> >> On Jun 5, 1:39 pm, joep  wrote: >>> >>> Is there a way to ban spammers from pypi? >> >> Can you provide some examples?  It's possible that we can apply >> SpamBayes >> to PyPI submissions in much t

Re: unladen swallow: python and llvm

2009-06-08 Thread bearophileHUGS
s...@pobox.com: > Why not just write extension modules in C then? In the past I have used some C for that purpose, but have you tried the D language (used from Python with Pyd)? It's way better, especially if you for example use libs similar to itertools functions, etc :-) Bye, bearophile -- htt

Re: Is it possible to disable readline in the interactive interpreter?

2009-06-08 Thread Thomas Heller
Paul Moore schrieb: > I run Python on Windows. I have the (pure Python) pyreadline package > installed for (occasional) use by IPython. However, when I use the > normal Python interactive prompt, the mere fact that the readline > module exists means that it gets used. > > Is there a way of disabli

Re: spammers on pypi

2009-06-08 Thread Robert Kern
On 2009-06-08 07:44, Skip Montanaro wrote: On Jun 5, 1:39 pm, joep wrote: Is there a way to ban spammers from pypi? Can you provide some examples? It's possible that we can apply SpamBayes to PyPI submissions in much the same way that we apply it in other non- mail areas. I suspect he migh

Re: Is it possible to disable readline in the interactive interpreter?

2009-06-08 Thread Paul Moore
On Jun 8, 7:31 pm, Tim Golden wrote: > Paul Moore wrote: > > I run Python on Windows. I have the (pure Python) pyreadline package > > installed for (occasional) use by IPython. However, when I use the > > normal Python interactive prompt, the mere fact that the readline > > module exists means tha

Re: error: an integer is required

2009-06-08 Thread Terry Reedy
madigre...@yahoo.gr wrote: I execute my code in linux environment. My code is: from os import * def insert_text_file(self, strng): t=open("elements_file.txt", "a") t.write(strng) t.close() I'm getting this error: : an integer is required Where is the mistake? Help me, please!!

MD5 hash of object

2009-06-08 Thread lczancanella
Hi, in hashlib the hash methods have as parameters just string, i want to know how can i digest an object to get a md5 hash of them. Thankz Luiz -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to disable readline in the interactive interpreter?

2009-06-08 Thread Tim Golden
Paul Moore wrote: I run Python on Windows. I have the (pure Python) pyreadline package installed for (occasional) use by IPython. However, when I use the normal Python interactive prompt, the mere fact that the readline module exists means that it gets used. I used to get round this by installi

Re: error: an integer is required

2009-06-08 Thread MRAB
madigre...@yahoo.gr wrote: I execute my code in linux environment. My code is: from os import * def insert_text_file(self, strng): t=open("elements_file.txt", "a") t.write(strng) t.close() I'm getting this error: : an integer is required Where is the mistake? Help me, please!!

Is it possible to disable readline in the interactive interpreter?

2009-06-08 Thread Paul Moore
I run Python on Windows. I have the (pure Python) pyreadline package installed for (occasional) use by IPython. However, when I use the normal Python interactive prompt, the mere fact that the readline module exists means that it gets used. Is there a way of disabling this? (Preferably by default,

Re: Extract value and average

2009-06-08 Thread Tim Chase
Tim Chase wrote: I would like to extract values corresponding to variable DIHED (here 4660.1650) and getting also the mean value from all DIHED. To just pull the DIHED values, you can use this: import re find_dihed_re = re.compile(r'\bDIHED\s*=\s*([.-e\d]+)', re.I) total = count = 0

error: an integer is required

2009-06-08 Thread madigreece
I execute my code in linux environment. My code is: from os import * def insert_text_file(self, strng): t=open("elements_file.txt", "a") t.write(strng) t.close() I'm getting this error: : an integer is required Where is the mistake? Help me, please!! -- http://mail.python.org/m

Re: multi-core software

2009-06-08 Thread Seamus MacRae
Piet van Oostrum wrote: By the way, there is a series of articles about concurrency on ACM Queue which may be interesting for those participating in or just following this discussion: http://queue.acm.org/listing.cfm?item_topic=Concurrency&qc_type=theme_list&filter=Concurrency&page_title=Concurr

Am I doing this the python way? (list of lists + file io)

2009-06-08 Thread R. David Murray
Horace Blegg wrote: > So, Example: I'll read in a CSV file (just one, for now.) and store it into > a list. Sometime later, I'll get another CSV file, almost identical/related > to the first. However, a few values might have changed, and there might be a > few new lines (entries) or maybe a few le

Re: problems while using pexpect: pexcept.TIMEOUT always

2009-06-08 Thread Senthil Kumaran
On Jun 8, 10:19 pm, "R. David Murray" wrote: > I would suggest using the 'setlog' method of child to get > more debugging information from pexpect.  I've found that the > best way to diagnose the source of a timeout. > setlog method seems to be deprecated and 'not allowed' too as the help says. B

Re: pylint naming conventions?

2009-06-08 Thread R. David Murray
Esmail wrote: > Ben Finney wrote: > > My understanding of Esmail's original message was that, like many of us > > on first running ‘pylint’ against an existing code base, the output is > > astonishingly verbose and tedious to read. By the above I presume he's > > being a good forum member and tryi

Re: Extract value and average

2009-06-08 Thread Scott David Daniels
Steven D'Aprano wrote: ... Assuming no DIHED value will ever be split over two lines: data = open(filename) values = [] for line in data: if line and line.strip(): # ignore blanks words = line.strip().split() words = line.split() # does the same as above try:

problems while using pexpect: pexcept.TIMEOUT always

2009-06-08 Thread R. David Murray
Phoe6 wrote: > I have been trying to use pexpect and I am failing with > pexpect.TIMEOUT for all my attempts. In order to troubleshoot, I > decided to go with simplest possible one. > [...] > > Can someone help me what I am doing wrong here? > Why is not working for such a simple thing as ssh to

Re: Extract value and average

2009-06-08 Thread Rhodri James
On Mon, 08 Jun 2009 17:29:12 +0100, Steven D'Aprano wrote: On Mon, 08 Jun 2009 18:13:50 +0200, Francesco Pietra wrote: I come 'naked', which is unusual and unfair. ??? Yeah, I had to go and scrub my brain out :-) Assuming no DIHED value will ever be split over two lines: data = open

Re: Odd closure issue for generators

2009-06-08 Thread David Stanek
On Thu, Jun 4, 2009 at 7:42 PM, Scott David Daniels wrote: > Brian Quinlan wrote: >> >> This is from Python built from the py3k branch: >>  >>> c = (lambda : i for i in range(11, 16)) >>  >>> for q in c: >> ...     print(q()) >> ... >> 11 >> 12 >> 13 >> 14 >> 15 >>  >>> # This is expected >>  >>> c

Re: Extract value and average

2009-06-08 Thread MRAB
Steven D'Aprano wrote: On Mon, 08 Jun 2009 18:13:50 +0200, Francesco Pietra wrote: I come 'naked', which is unusual and unfair. ??? However, I find it difficult to give a correct start. The files consist, among other things, of a huge number of blocks of the type NSTEP = 1000 TIME(

Re: Extract value and average

2009-06-08 Thread Tim Chase
I would like to extract values corresponding to variable DIHED (here 4660.1650) and getting also the mean value from all DIHED. To just pull the DIHED values, you can use this: import re find_dihed_re = re.compile(r'\bDIHED\s*=\s*([.-e\d]+)', re.I) total = count = 0 for line in file('fi

Re: Extract value and average

2009-06-08 Thread Steven D'Aprano
On Mon, 08 Jun 2009 18:13:50 +0200, Francesco Pietra wrote: > I come 'naked', which is unusual and unfair. ??? > However, I find it > difficult to give a correct start. The files consist, among other > things, of a huge number of blocks of the type > > > NSTEP = 1000 TIME(PS) = 152.

Re: Extract value and average

2009-06-08 Thread MRAB
Francesco Pietra wrote: I come 'naked', which is unusual and unfair. However, I find it difficult to give a correct start. The files consist, among other things, of a huge number of blocks of the type NSTEP = 1000 TIME(PS) = 152.000 TEMP(K) = 298.54 PRESS =89.4 Etot = -1

Re: pyc-files contains absolute paths, is this a bug ?

2009-06-08 Thread Diez B. Roggisch
Stef Mientki wrote: > hello, > > AFAIK I read that pyc files can be transferred to other systems. > I finally got a windows executable working through py2exe, > but still have some troubles, moving the directory around. > > I use Python 2.5.2. > I use py2exe to make a distro > I can unpack the d

Extract value and average

2009-06-08 Thread Francesco Pietra
I come 'naked', which is unusual and unfair. However, I find it difficult to give a correct start. The files consist, among other things, of a huge number of blocks of the type NSTEP = 1000 TIME(PS) = 152.000 TEMP(K) = 298.54 PRESS =89.4 Etot = -134965.2123 EKtot =

problems while using pexpect: pexcept.TIMEOUT always

2009-06-08 Thread Phoe6
I have been trying to use pexpect and I am failing with pexpect.TIMEOUT for all my attempts. In order to troubleshoot, I decided to go with simplest possible one. Here is my ssh to localhost: [21:29:14 senthil]$ssh localhost -l senthil sent...@localhost's password: sent...@ubuntu:~$ And here is

Re: can it be shorter?

2009-06-08 Thread MRAB
Jean-Michel Pichavant wrote: Aaron Brady wrote: Shorter is always better. url+= { '/': '' }.get( url[ -1 ], '/' ) Why bother with spaces or 3 letter-wide token, check this :o) : x+={'/':''}.get(x[-1],'/') Even shorter: x+='/'*(x[-1]!='/') Apart from joking, the following proposed soluti

Re: Get the class name

2009-06-08 Thread Gary Herron
Kless wrote: Is there any way of to get the class name to avoid to have that write it? --- class Foo: super(Foo, self) --- * Using Py 2.6.2 The question does not make sense: "to have WHAT write WHAT", and the code is wrong: the call to super fails But even

Re: PIL Python Imaging Library

2009-06-08 Thread Tim Harig
On 2009-06-08, Xah Lee wrote: > is there a python image library that does pretty much what imagemagick > does? http://www.pythonware.com/products/pil/ -- http://mail.python.org/mailman/listinfo/python-list

Re: is there python image lib that does imagemagick?

2009-06-08 Thread Steven D'Aprano
On Mon, 08 Jun 2009 08:13:37 -0700, Xah Lee wrote: > is there a python image library that does pretty much what imagemagick > does? Python Imaging Library (PIL). http://pypi.python.org/pypi/PIL/1.1.6 -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: GD Library

2009-06-08 Thread Tim Harig
On 2009-06-08, Xah Lee wrote: > is there a python image library that does pretty much what imagemagick > does? GD library has a Python binding: http://www.libgd.org/Main_Page -- http://mail.python.org/mailman/listinfo/python-list

Re: The pysync library - Looking for the code, but all download links are broken

2009-06-08 Thread jpersson
Thanks for the help. I will let the community know as soon as I have salvaged a working copy. Cheers //Jan Persson On 7 Juni, 23:06, Søren - Peng - Pedersen wrote: > I think what you are looking for can be found at: > > http://www.google.com/codesearch/p?hl=en#RncWxgazS6A/pysync-2.24/test.

is there python image lib that does imagemagick?

2009-06-08 Thread Xah Lee
is there a python image library that does pretty much what imagemagick does? all i need is for converting png/jpg, and scaling images. No need other fancy things imagemagick does. i know there's a python wrapper for imagemagick, but i need independent ones that doesn't require shell calls. Basica

Re: can it be shorter?

2009-06-08 Thread Jean-Michel Pichavant
Aaron Brady wrote: Shorter is always better. url+= { '/': '' }.get( url[ -1 ], '/' ) Why bother with spaces or 3 letter-wide token, check this :o) : x+={'/':''}.get(x[-1],'/') Apart from joking, the following proposed solution is by **far** the one I prefer if not url.endswith('/'):

Career Track: Computer Programmer

2009-06-08 Thread youssef_edward3...@yahoo.com
Roles and Responsibilities : The primary role of a Computer Programmer is to write programs according to the instructions determined primarily by computer software engineers and systems analysts. In a nutshell, Computer Programmers are the ones that take the completed designs and convert them into

10 Easy Steps to Speed Up Your Computer - Without Upgrading

2009-06-08 Thread youssef_edward3...@yahoo.com
It seems that the longer you own your computer, the slower it gets! A lot of people will keep their computer until it gets so slow that they feel they need a newer, faster model. Some feel like the reason it is getting slower is because it is getting older, when that is just not the case. Your comp

Re: multi-core software

2009-06-08 Thread Paul Wallich
rossb...@mpi-sws.org wrote: On Jun 8, 6:28 am, "Ken T." wrote: Let's not forget Elite for the 6502 exploiting predictable performance in order to switch graphics modes partway down the vsync! That actually didn't require predictable timing. You could tell the video chip to send you an interru

Re: unladen swallow: python and llvm

2009-06-08 Thread Paul Boddie
On 8 Jun, 12:13, bearophileh...@lycos.com wrote: > > The C code produced by ShedSkin is a bit hairy but it's 50 times more > readable than the C jungle produced by Pyrex, where I have lost lot of > time looking for the missing reference counts, etc. The C++ code produced by Shed Skin can actually

Re: interval arithmetic libraries

2009-06-08 Thread pruebauno
On Jun 6, 8:15 am, srepmub wrote: > Hi all, > > I'm looking for libraries that allow one to calculate with sets of > (date) intervals. So for example, I'd like to be able to calculate the > overlap between two sets of intervals, the union etc. Preferrably, > this works with datetime objects, is wr

Re: unladen swallow: python and llvm

2009-06-08 Thread skip
bearophile> I'm sure lot of people like Cython, but I prefer a more bearophile> transparent language, that doesn't hide me how it works bearophile> inside. Why not just write extension modules in C then? -- Skip Montanaro - s...@pobox.com - http://www.smontanaro.net/ America's v

Wrapping LabVIEW and DAQmx Libraries for Python

2009-06-08 Thread xkenneth
All, I've started wrapping the DAQmx and other LabVIEW libraries for python using ctypes. I really like doing some things in python and other in LabVIEW, so I'd like to have the same functionality available for both. I've hosted the tiniest bit of code (mostly just proof of concept) on github

Re: spammers on pypi

2009-06-08 Thread Skip Montanaro
On Jun 5, 1:39 pm, joep wrote: > Is there a way to ban spammers from pypi? Can you provide some examples? It's possible that we can apply SpamBayes to PyPI submissions in much the same way that we apply it in other non- mail areas. Thx, Skip Montanaro -- http://mail.python.org/mailman/listinf

Re: can it be shorter?

2009-06-08 Thread Roland Mueller
2009/6/8 Aaron Brady > On Jun 7, 6:13 pm, Paul Rubin wrote: > > Aaron Brady writes: > > > url+= { '/': '' }.get( url[ -1 ], '/' ) > > > > > Shorter is always better. > > > > url = url.rstrip('/') + '/' > > I was joking. Sheesh. > -- > http://mail.python.org/mailma

Re: Python preprosessor

2009-06-08 Thread Tuomas Vesterinen
Roger Binns wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tuomas Vesterinen wrote: I am intensively using 2to3.py. So I have 2 codebase: one in py2 and the other in py3. The expectation would be that you only maintain the py2 code and automatically generate the py3 code on demand using

Re: Python preprosessor

2009-06-08 Thread Tuomas Vesterinen
R. David Murray wrote: Tuomas Vesterinen wrote: I am developing a Python application as a Python2.x and Python3.0 version. A common code base would make the work easier. So I thought to try a preprosessor. GNU cpp handles this kind of code correct: #ifdef python2 print u'foo', u'bar' #endif

Re: 403 error for python webpage

2009-06-08 Thread Roland Mueller
2009/6/7 Daniel > I created a page with a ".py" extension but the browser does not like > it. > Here is what I did: I edited httpd.conf file and added the line: > AddHandler cgi-script .cgi .py > Then I stopped and restarted apache. Next I created a hello world file > as on this page: > http://de

Re: urllib2.URLError: error using twill with python

2009-06-08 Thread Steven D'Aprano
On Mon, 08 Jun 2009 12:14:18 +0100, Mark Devine wrote: > Hi > I wonder if someone could point me in the right direction. I used the > following code to access gmail but I got a > urllib2.URLError: > error when I ran it. I have included the Traceback > > import twill, string, os > b=twil

Re: pylint naming conventions?

2009-06-08 Thread Esmail
Ben Finney wrote: My understanding of Esmail's original message was that, like many of us on first running ‘pylint’ against an existing code base, the output is astonishingly verbose and tedious to read. By the above I presume he's being a good forum member and trying to find a minimal example

Re: pylint naming conventions?

2009-06-08 Thread Esmail
Hi David, David Stanek wrote: It is my understanding that it does check for PEP8 names. Even if it doesn't it is really easy to change. If you run 'pylint --generate-rcfile' (i think) it will output the configuration that it is using. You can then save this off and customize it. Thanks, I'll

urllib2.URLError: error using twill with python

2009-06-08 Thread Mark Devine
Hi I wonder if someone could point me in the right direction. I used the following code to access gmail but I got a urllib2.URLError: error when I ran it. I have included the Traceback import twill, string, os b=twill.commands.get_browser() b.set_agent_string("Mozilla/5.0 (Windows; U; Wi

Re: can it be shorter?

2009-06-08 Thread Aaron Brady
On Jun 7, 6:13 pm, Paul Rubin wrote: > Aaron Brady writes: > > url+= { '/': '' }.get( url[ -1 ], '/' ) > > > Shorter is always better. > > url = url.rstrip('/') + '/' I was joking. Sheesh. -- http://mail.python.org/mailman/listinfo/python-list

Re: unladen swallow: python and llvm

2009-06-08 Thread bearophileHUGS
Kay Schluehr: >Don't understand your Cython compliant. The only tricky part of Cython is the >doublethink regarding Python types and C types. I attempted once to write a >ShedSkin like code transformer from Python to Cython based on type recordings >but never found the time for this because I h

Re: Making the case for repeat

2009-06-08 Thread jkn
> Possibly a *factoring*, without the "re-", just like Raymond said. > > Also, keep in mind that when creating a new API, you have no existing API > to re-factor. Exactly. I think this has come up before, but I can't remember the answers; any suggestions for pointer to examples of very well-desi

Re: Making the case for repeat

2009-06-08 Thread Steven D'Aprano
On Mon, 08 Jun 2009 18:30:37 +1000, Ben Finney wrote: > Steven D'Aprano writes: > >> On Sun, 07 Jun 2009 16:46:23 -0700, Raymond Hettinger wrote: >> >> > We factor code to eliminate redundancy, but that is not always a good >> > idea with an API. The goal for code factoring is to minimize >> >

Re: Making the case for repeat

2009-06-08 Thread jkn
On Jun 8, 9:30 am, Ben Finney wrote: [...] > > As originally defined by Martin Fowler, re-factoring always means the > external behaviour is unchanged http://refactoring.com/>. > > So, there's no such thing as a re-factoring that changes the API. > Anything that changes an external attribute of t

Re: multi-core software

2009-06-08 Thread Piet van Oostrum
By the way, there is a series of articles about concurrency on ACM Queue which may be interesting for those participating in or just following this discussion: http://queue.acm.org/listing.cfm?item_topic=Concurrency&qc_type=theme_list&filter=Concurrency&page_title=Concurrency Here is one introduc

Re: Making the case for repeat

2009-06-08 Thread Ben Finney
Steven D'Aprano writes: > On Sun, 07 Jun 2009 16:46:23 -0700, Raymond Hettinger wrote: > > > We factor code to eliminate redundancy, but that is not always a > > good idea with an API. The goal for code factoring is to minimize > > redundancy. The goal for API design is having simple parts that

Re: Making the case for repeat

2009-06-08 Thread Steven D'Aprano
On Sun, 07 Jun 2009 16:46:23 -0700, Raymond Hettinger wrote: > We factor code > to eliminate redundancy, but that is not always a good idea with an API. > The goal for code factoring is to minimize redundancy. The goal for API > design is having simple parts that are easily learned and can be rea

Re: how to transfer my utf8 code saved in a file to gbk code

2009-06-08 Thread higer
Thank you Mark, that works. Firstly using 'string-escape' to decode the content is the key point,so I can get the Chinese characters now. Regards, -higer -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >