Announce: Linux Desktop Testing Project (LDTP) 1.5.1 released

2009-03-12 Thread Nagappan A
Greetings all, We are proud to announce the release of LDTP 1.5.1. This release features number of important breakthroughs in LDTP as well as in the field of Test Automation. This release note covers a brief introduction on LDTP followed by the list of new features and major bug fixes which

Python-URL! - weekly Python news and links (Mar 11)

2009-03-12 Thread Gabriel Genellina
QOTW: [Perhaps] it sounds [as though] I'm saying that most prospective users of OSS [open-source software] can't even manage to download it. Let me be clear: that is exactly what I am saying. - Patrick McKenzie

Python training for cheminformatics, Leipzig, 27-29 April

2009-03-12 Thread Andrew Dalke
My next training course on Python for cheminformatics will be in Leipzig, Germany on 27-29 April. For full details see http://dalkescientific.com/training/ The schedule for the three day course is Day 1: overview of Python and OEChem, Day 2: plotting with matplotlib, communicating with

[ANN] Pyjamas 0.5 Web Widget Set and python-to-javascript Compiler released

2009-03-12 Thread Luke Kenneth Casson Leighton
This is the release of Pyjamas 0.5, a python-to-javascript compiler with an AJAX Web Widget set, for creating python desktop-like applications that run in all major web browsers. http://pyjs.org Pyjamas is NOT another AJAX framework where the widgets are predefined, fixed and inflexible. Thanks

Regular Toronto Python User's Group on Tuesday the 17th

2009-03-12 Thread Mike C. Fletcher
Topic: OpenGL 3.1: A whole new OpenGL (Mike Fletcher) Further: A preview of the PyCon 2009 presentation on OpenGL 3.1: A whole new OpenGL. We'll be looking at what the legacy-free OpenGL programming model looks like, and how you access it via PyOpenGL. The upcoming OpenGL 3.1

Re: Why is lambda allowed as a key in a dict?

2009-03-12 Thread Lie Ryan
Terry Reedy wrote: r wrote: On Mar 11, 3:40 pm, Craig Allen callen...@gmail.com wrote: On Mar 10, 1:39 pm, Paul Rubin http://phr...@nospam.invalid wrote: Identical strings don't necessarily have the same id: A more verbose way to put this is Requesting a string with a value that is the

NameError: name 'execfile' is not defined

2009-03-12 Thread Henrik Bechmann
Newbie issue: I downloaded http://www.python.org/download/releases/3.0.1/ (windows insaller), opened the interpreter, wrote a print Hello World program in helloworld.py, and in the interpreter typed execfile(helloworld.py) Got back NameError: name 'execfile' is not defined (following tutorial

Invalid syntax with print Hello World

2009-03-12 Thread Henrik Bechmann
obviously total mewbiew: My first program in Python Windows print Hello World I select Run/Run Module and get an error: Syntax error, with the closing quote highlighted. Tried with single quotes as well. Same problem. Can someone explain my mistake? Thanks, - Henrik --

Re: NameError: name 'execfile' is not defined

2009-03-12 Thread Gary Herron
Henrik Bechmann wrote: Newbie issue: I downloaded http://www.python.org/download/releases/3.0.1/ (windows insaller), opened the interpreter, wrote a print Hello World program in helloworld.py, and in the interpreter typed execfile(helloworld.py) Got back NameError: name 'execfile' is not

Re: Invalid syntax with print Hello World

2009-03-12 Thread Gary Herron
Henrik Bechmann wrote: obviously total mewbiew: My first program in Python Windows print Hello World I select Run/Run Module and get an error: Syntax error, with the closing quote highlighted. Tried with single quotes as well. Same problem. Can someone explain my mistake? You are

Re: Invalid syntax with print Hello World

2009-03-12 Thread Daniel Fetchinson
obviously total mewbiew: My first program in Python Windows print Hello World I select Run/Run Module and get an error: Syntax error, with the closing quote highlighted. Tried with single quotes as well. Same problem. Can someone explain my mistake? Are you using python 3.0? In this

Re: Invalid syntax with print Hello World

2009-03-12 Thread John Machin
On Mar 12, 5:57 pm, Henrik Bechmann hbechm...@gmail.com wrote: obviously total mewbiew: My first program in Python Windows What is that you are callind Python Windows? What version of Python are you running? 2.X: print Hello World should work. 3.X: print is now a function, print(Hello World)

Rough draft: Proposed format specifier for a thousands separator

2009-03-12 Thread Raymond Hettinger
If anyone here is interested, here is a proposal I posted on the python-ideas list. The idea is to make numbering formatting a little easier with the new format() builtin in Py2.6 and Py3.0: http://docs.python.org/library/string.html#formatspec

Re: Question on periods in strings

2009-03-12 Thread Gabriel Genellina
En Wed, 11 Mar 2009 23:42:45 -0200, Philip Bloom pbl...@crystald.com escribió: Thanks for the welcome :) You're right. Here's with the missed line (I was cutting out commented parts). Hopefully these are all cut/paste-able. #test A #runs in 5.8 seconds. from datetime import datetime

Re: wxPython fast and slow

2009-03-12 Thread David Bolen
iu2 isra...@elbit.co.il writes: A question about CallAfter: As I understand, this function is intended to be used from within threads, where it queues the operation to be performed in the GUI queue. I agree with the second half of the sentence but not the first. CallAfter is intended to queue

Re: Stopping SocketServer on Python 2.5

2009-03-12 Thread Mark Tolonen
Falcolas garri...@gmail.com wrote in message news:1b6a95a4-5680-442e-8ad0-47aa9ea08...@w1g2000prk.googlegroups.com... On Mar 11, 1:11 pm, David George d...@eatmyhat.co.uk wrote: Again, problem here is the issue of being unable to kill the server while it's waiting on a request. In theory, i

Re: Question on periods in strings

2009-03-12 Thread John Machin
On Mar 12, 12:42 pm, Philip Bloom pbl...@crystald.com wrote: The range is not actually a meaningful adjustment as the time results are identical switching out xrange (as I believe they should be since in 2.6 range maps to xrange for the most part according to some of the docs).   Please do

Re: Read a content file from a P7M

2009-03-12 Thread Luca
On Wed, Mar 11, 2009 at 5:05 PM, Luca luca...@gmail.com wrote: There is standard or sugested way in python to read the content of a P7M file? I don't need no feature like verify sign, or sign using a certificate. I only need to extract the content file of the p7m (a doc, a pdf, ...) I'm there

Re: A Dangling Tk Entry

2009-03-12 Thread r
On Mar 11, 1:09 am, Marc 'BlackJack' Rintsch bj_...@gmx.net wrote: Then he did it consequently wrong.  `frame_delay` is always `None` here so the ``return`` is useless. You asked what this code means and now you don't like the answer that it's somewhat useless code!? Ciao,         Marc

Re: What happened to NASA at Python? :(

2009-03-12 Thread Michele Simionato
On Mar 12, 4:26 am, r rt8...@gmail.com wrote: On Mar 11, 10:09 pm, s...@pobox.com wrote: In fact, graphics were added for several organizations.  I believe they will be chosen randomly.  NASA is still there. --http://mail.python.org/mailman/listinfo/python-list Whew! Thats good news, i

Re: What happened to NASA at Python? :(

2009-03-12 Thread Mikael Olofsson
s...@pobox.com wrote: In fact, graphics were added for several organizations. I believe they will be chosen randomly. NASA is still there. In that case, they must be using the random number generator from Dilbert. You know, the one that said 9, 9, 9, 9,... I, at least, get the same

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-12 Thread Raymond Hettinger
If anyone here is interested, here is a proposal I posted on the python-ideas list. The idea is to make numbering formatting a little easier with the new format() builtin: http://docs.python.org/library/string.html#formatspec Here's a re-post (hopefully without the line wrapping problems in

PythonWin, python thread and PostQuitMessage?

2009-03-12 Thread arnaud
Hi All, I'm not so much involved in any Windows programming however I needed to write a client for the Windows platform. I have this very simple question which I've been unable to answer. I'm listening for keyboard strokes using the pyhook library. I'm doing this in a dedicated thread. The gui

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-12 Thread Ulrich Eckhardt
Raymond Hettinger wrote: The idea is to make numbering formatting a little easier with the new format() builtin: http://docs.python.org/library/string.html#formatspec [...] Scanning the web, I've found that thousands separators are usually one of COMMA, PERIOD, SPACE, or UNDERSCORE. The

__import__ with dict values

2009-03-12 Thread alex goretoy
How would I import with __import__ from dict values? I want sys.path value inside d['syspath'], below code doesn't work for me d={} d['sys']='sys' d['path']='path' d['syspath']=__import__(d['sys'],fromlist=[d['path']]) and how come does above line doesn't give me diff value than below line?

Re: What happened to NASA at Python? :(

2009-03-12 Thread James Matthews
From what I see most startups are jumping to Python to rapidly setup their prototypes. On Thu, Mar 12, 2009 at 10:38 AM, Mikael Olofsson mik...@isy.liu.se wrote: s...@pobox.com wrote: In fact, graphics were added for several organizations. I believe they will be chosen randomly. NASA is

Re: What happened to NASA at Python? :(

2009-03-12 Thread Dotan Cohen
I, at least, get the same parking lot graphics every time I reload the page. If you click and more link, you will come to a page of success stories, one of which is this: http://python.org/about/success/usa/ It is not as prominent as the earlier Nasa logo, though. -- Dotan Cohen

Re: c.Win32_OperatingSystem question.

2009-03-12 Thread bryan rasmussen
Hi, well coming back to the project and looking over it I realized I had somehow messed up the names for some Win32 Operating System properties - for example ComputerOrganization instead of Organization. Not sure where I got the values from cause I've just be copying the properties I want from

Re: Question on periods in strings

2009-03-12 Thread Bruno Desthuilliers
Philip Bloom a écrit : (snip) from datetime import datetime startTime = datetime.now() (snip) print (datetime.now() - startTime) A bit OT, but you may want to use timeit.Timer for this kind of microbenchmarks. (snip) -- http://mail.python.org/mailman/listinfo/python-list

Re: __import__ with dict values

2009-03-12 Thread alex goretoy
I have resolved this problem in my code. It has something to do with your current working directory when you append cwd/jars to sys.path and try to import from interactive console -Alex Goretoy http://www.goretoy.com On Thu, Mar 12, 2009 at 4:58 AM, alex goretoy

Re: __import__ with dict values

2009-03-12 Thread alex goretoy
yay, no more exec (import + sys) in my code -Alex Goretoy http://www.goretoy.com On Thu, Mar 12, 2009 at 5:42 AM, alex goretoy aleksandr.gore...@gmail.comwrote: I have resolved this problem in my code. It has something to do with your current working directory when you append cwd/jars to

Re: __import__ with dict values

2009-03-12 Thread alex goretoy
or eval for that matter -Alex Goretoy http://www.goretoy.com On Thu, Mar 12, 2009 at 5:43 AM, alex goretoy aleksandr.gore...@gmail.comwrote: yay, no more exec (import + sys) in my code -Alex Goretoy http://www.goretoy.com On Thu, Mar 12, 2009 at 5:42 AM, alex goretoy

Re: __import__ with dict values

2009-03-12 Thread alex goretoy
note i would still like to be able to do __import__(sys).path maybe if __import__ had __str__ defined, How is my thinking on this? and how would I achieve something like this? -Alex Goretoy http://www.goretoy.com On Thu, Mar 12, 2009 at 5:44 AM, alex goretoy aleksandr.gore...@gmail.comwrote:

Re: Invalid syntax with print Hello World

2009-03-12 Thread steven.oldner
On Mar 12, 2:25 am, John Machin sjmac...@lexicon.net wrote: On Mar 12, 5:57 pm, Henrik Bechmann hbechm...@gmail.com wrote: obviously total mewbiew: My first program in Python Windows What is that you are callind Python Windows? What version of Python are you running? 2.X: print Hello

Re: __import__ with dict values

2009-03-12 Thread alex goretoy
__import__(opt['imp_mod']).options eval(opt['imp_mod']+.+opt['imp_opt']) how to make top work like bottom? -Alex Goretoy http://www.goretoy.com On Thu, Mar 12, 2009 at 5:56 AM, alex goretoy aleksandr.gore...@gmail.comwrote: note i would still like to be able to do __import__(sys).path

Re: Invalid syntax with print Hello World

2009-03-12 Thread Dotan Cohen
Welcome to the list.  As a newbie myself, I ran into the Python3 vrs 2.6 issue.  May I suggest starting with 2.6?  There is many more books and internet stuff you can learn with in 2.6 - and the examples will work. As Garry wrote, once you understand 2.6, 3.0 will not be a challenge. I do

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-12 Thread Raymond Hettinger
[Ulrich Eckhardt] IOW, why not explicitly say what you want using keyword arguments with defaults instead of inventing an IMHO cryptic, read-only mini-language? That makes sense to me but I don't think that's the way the format() builtin was implemented (see PEP 3101 which was implemented Py2.6

Input data from .txt file and object array problem

2009-03-12 Thread SamuelXiao
I want to input data by using pickle First of all, I have a database.txt The content is like: AAA,aaalink BBB,bbblink CCC,ccclink ...,... AAA,BBB,CCC is Language name, and aaalink,bbblink,ccclink is their respective link. I want to store data by using pickle. Meanwhile , I got a problem. #I

Re: What happened to NASA at Python? :(

2009-03-12 Thread skip
If they were so keen on new graphics, why did 2.6 revert to the same icons that 2.4 used? (At least they did on my machine. After installing 2.6, I no longer had the new 2.5 icons but had reverted to the earlier ones.) Can you be more specific? Is this a Windows thing? Did

cross platform accessing paths (windows, linux ...)

2009-03-12 Thread Vlastimil Brom
Hi all, I'd like to ask for some advice on how to acomplish file access in a cross platform way. My application is a kind of viewer of text and corresponding image files (stored in separate subdirectories) and I'm going to deploy it as binaries for windows and source files (again in separate

Re: Building python 64-bit on OS 10.5?

2009-03-12 Thread Dan Yamins
Dear all: I've two questions: 1) I've been trying to building python as a 64-bit version on OS 10.5. I'm not too familiar with building python from scratch, and a number of basic attempts made from piecing together things I've seen on the web have failed. (For instance, ./configure

multiprocessing + atexit

2009-03-12 Thread Neal Becker
I have some code that uses atexit (remove old log files). Before converting to use multiprocessing, it worked. Since converting, it seems to not be running the atexit code (old log files are not removed). Any known issues with multiprocessing + atexit? --

Re: Question on periods in strings

2009-03-12 Thread skip
Gabriel I could not reproduce this. Nor can I. I didn't see the original post. What were the hardware parameters and Python version? -- Skip Montanaro - s...@pobox.com - http://www.smontanaro.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: What happened to NASA at Python? :(

2009-03-12 Thread skip
In fact, graphics were added for several organizations. I believe they will be chosen randomly. NASA is still there. MiO In that case, they must be using the random number generator from MiO Dilbert. You know, the one that said 9, 9, 9, 9,... Sorry, randomly chosen whenever

Re: cross platform accessing paths (windows, linux ...)

2009-03-12 Thread Mike Mazurek
You might want to look at the path module: http://pypi.python.org/pypi/path.py/2.2 It will probably make your code more readable. On Thu, Mar 12, 2009 at 8:10 AM, Vlastimil Brom vlastimil.b...@gmail.comwrote: Hi all, I'd like to ask for some advice on how to acomplish file access in a cross

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-12 Thread MRAB
Raymond Hettinger wrote: [snip] Proposal I (from Nick Coghlan): --- A comma will be added to the format() specifier mini-language: [[fill]align][sign][#][0][minimumwidth][,][.precision][type] The ',' option indicates that commas should be included in the output as

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-12 Thread Hendrik van Rooyen
Ulrich Eckhardt eck...aser.com wrote: IOW, why not explicitly say what you want using keyword arguments with defaults instead of inventing an IMHO cryptic, read-only mini-language? Seriously, the problem I see with this proposal is that its aim to be as short as possible actually makes the

loop performance in global namespace (python-2.6.1)

2009-03-12 Thread Poor Yorick
In the following snippet, the loop in the global namespace takes twice as long as the loop in the function namespace. Why? limit = 5000 def f1(): counter = 0 while counter limit: counter += 1 time1 = time.time() f1() print(time.time() -

Re: [Tutor] loop performance in global namespace (python-2.6.1)

2009-03-12 Thread spir
Le Thu, 12 Mar 2009 11:13:33 -0400, Kent Johnson ken...@tds.net s'exprima ainsi: Because local name lookup is faster than global name lookup. Local variables are stored in an array in the stack frame and accessed by index. Global names are stored in a dict and accessed with dict access

Re: Input data from .txt file and object array problem

2009-03-12 Thread odeits
On Mar 12, 5:03 am, SamuelXiao foolsmart2...@gmail.com wrote: I want to input data by using pickle First of all, I have a database.txt The content is like: AAA,aaalink BBB,bbblink CCC,ccclink ...,... AAA,BBB,CCC is Language name, and aaalink,bbblink,ccclink is their respective link. I

Re: can python import class or module directly from a zip package

2009-03-12 Thread Coonay
On Mar 11, 9:47 pm, Lorenzo lolue...@gmail.com wrote: On Mar 10, 2:13 pm, Flank fla...@gmail.com wrote: can python import class or  module directly from  a zip package ,just like jave does from jar package without extracting the class file into directory so far as i know ,python module

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-12 Thread John Machin
On Mar 12, 9:56 pm, Raymond Hettinger pyt...@rcn.com wrote: [Ulrich Eckhardt] IOW, why not explicitly say what you want using keyword arguments with defaults instead of inventing an IMHO cryptic, read-only mini-language? That makes sense to me but I don't think that's the way the format()

Re: Invalid syntax with print Hello World

2009-03-12 Thread Paul Boddie
On 12 Mar, 12:45, Dotan Cohen dotanco...@gmail.com wrote: [starting with 2.6] I do not think that is the best way to go about learning Python. Why learn an arguably depreciating version when the new version is available. I agree that there are not many tutorial written for Python 3 however

Re: Invalid syntax with print Hello World

2009-03-12 Thread Henrik Bechmann
On Mar 12, 7:45 am, Dotan Cohen dotanco...@gmail.com wrote: Welcome to the list.  As a newbie myself, I ran into the Python3 vrs 2.6 issue.  May I suggest starting with 2.6?  There is many more books and internet stuff you can learn with in 2.6 - and the examples will work. As Garry wrote,

Re: NameError: name 'execfile' is not defined

2009-03-12 Thread Henrik Bechmann
On Mar 12, 3:15 am, Gary Herron gher...@islandtraining.com wrote: Henrik Bechmann wrote: Newbie issue: I downloadedhttp://www.python.org/download/releases/3.0.1/(windows insaller), opened the interpreter, wrote a print Hello World program in helloworld.py, and in the interpreter typed

Re: Stopping SocketServer on Python 2.5

2009-03-12 Thread David George
On 2009-03-12 08:03:06 +, Mark Tolonen metolone+gm...@gmail.com said: Falcolas garri...@gmail.com wrote in message news:1b6a95a4-5680-442e-8ad0-47aa9ea08...@w1g2000prk.googlegroups.com... On Mar 11, 1:11 pm, David George d...@eatmyhat.co.uk wrote: Again, problem here is the issue of

How to send an email with GMail in Python from Windows

2009-03-12 Thread ∂ √ ¡ ŋ ∂ ♪ ђ
Hi Can somebody help me with sending an email using Python from GMail Here's what I tried but it fails always. import smtplib import base64 smtpserver = 'smtp.gmail.com' AUTHREQUIRED = 0 # if you need to use SMTP AUTH set to 1

Re: How to send an email with GMail in Python from Windows

2009-03-12 Thread dorzey
You might want to try - http://libgmail.sourceforge.net/. This is a Python binding for GMail; I've used it a little and it did the job for me. Dorzey -- http://mail.python.org/mailman/listinfo/python-list

Re: How to send an email with GMail in Python from Windows

2009-03-12 Thread gordyt
Howdy Avinash, Here is a simple example for you. from smtplib import SMTP HOST = smtp.gmail.com PORT = 587 ACCOUNT = # put your gmail email account here PASSWORD =# put your gmail email password here def send_email(to_addrs, subject, msg): server = SMTP(HOST,PORT)

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-12 Thread pruebauno
On Mar 12, 3:30 am, Raymond Hettinger pyt...@rcn.com wrote: If anyone here is interested, here is a proposal I posted on the python-ideas list. The idea is to make numbering formatting a little easier with the new format() builtin in Py2.6 and Py3.0:  

default shelve on linux corrupts, does different DB system help?

2009-03-12 Thread Paul Sijben
I have the problem that my shelve(s) sometimes corrupt (looks like it has after python has run out of threads). I am using the default shelve so on linux I get the dbhash version. Is there a different DB type I can choose that is known to be more resilient? And if so, what is the elegant way of

Re: Input data from .txt file and object array problem

2009-03-12 Thread Piet van Oostrum
SamuelXiao foolsmart2...@gmail.com (S) wrote: S I want to input data by using pickle S First of all, I have a database.txt S The content is like: S AAA,aaalink S BBB,bbblink S CCC,ccclink S ...,... S AAA,BBB,CCC is Language name, and aaalink,bbblink,ccclink is their S respective link. S I want

Re: Killing subservient threads

2009-03-12 Thread Aahz
In article mailman.372.1235151060.11746.python-l...@python.org, Christian Heimes li...@cheimes.de wrote: Gabriel Genellina wrote: 1) make the child window set a flag in the thread (let's say, t.terminate = True). And make the polling thread check the flag periodically (you possibly already

question on msvcrt.dll versioning

2009-03-12 Thread rogerdpack
It appears from sites like http://www.develer.com/oss/GccWinBinaries at the bottom that at least this developer made an effort to link against the same version of msvcrt.dll that the python exe was compiled with [ex: vc2008 - msvcr90.dll]. Is this pain necessary? Are there known drawbacks to not

Re: pymssql text type

2009-03-12 Thread Aahz
[posted and e-mailed, please reply to group] In article 851ed9db-2561-48ad-b54c-95f96a7fa...@q9g2000yqc.googlegroups.com, marc wyburn marc.wyb...@googlemail.com wrote: Hi, I'm trying to pass a text blob to MS SQL Express 2008 but get the follwoing error. (class 'pymssql.OperationalError',

Re: import not working?

2009-03-12 Thread Aahz
In article mailman.605.1235434737.11746.python-l...@python.org, Rhodri James rho...@wildebst.demon.co.uk wrote: Just so that we're clear, this is a *really* *bad* habit to get into. Not appending to sys.path, though that isn't often a good idea, but failing to escape your backslashes. This works

Re: how to assert that method accepts specific types

2009-03-12 Thread Aahz
In article 3f26a2f1-94cf-4083-9bda-7076959ad...@k19g2000yqg.googlegroups.com, Darren Dale dsdal...@gmail.com wrote: class Test(object): @accepts(int) def check(self, obj): print obj t = Test() t.check(1) but now I want Test.check to accept an instance of Test as well. Does

Re: Input data from .txt file and object array problem

2009-03-12 Thread SamuelXiao
On Mar 12, 11:17 pm, Piet van Oostrum p...@cs.uu.nl wrote: SamuelXiao foolsmart2...@gmail.com (S) wrote: S I want to input data by using pickle S First of all, I have a database.txt S The content is like: S AAA,aaalink S BBB,bbblink S CCC,ccclink S ...,... S AAA,BBB,CCC is Language name,

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-12 Thread Raymond Hettinger
On Mar 12, 7:51 am, prueba...@latinmail.com wrote: On Mar 12, 3:30 am, Raymond Hettinger pyt...@rcn.com wrote: If anyone here is interested, here is a proposal I posted on the python-ideas list. The idea is to make numbering formatting a little easier with the new format() builtin

Python/Django forum-building software Snap/SCT, any reviews?

2009-03-12 Thread John Crawford
I'm looking for good open-source software for forums. There is a *lot* out there, for instance Lussumo's Vanilla gets good reviews, but most are PHP-based, and I would obviously prefer to use Python, with or without Django. Two packages that are Django-based that I have found, are Snap and

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-12 Thread Paul Rubin
Raymond Hettinger pyt...@rcn.com writes: FWIW, posted a cleaned-up version of the proposal at http://www.python.org/dev/peps/pep-0378/ It would be nice if the PEP included a comparison between the proposed scheme and how it is done in other programs and languages. For example, I think Common

Re: python contextmanagers and ruby blocks

2009-03-12 Thread Aahz
In article c6b9e335-a04d-44cb-b18e-18a52eef1...@k19g2000yqg.googlegroups.com, Alia K alia_kho...@yahoo.com wrote: Aahz wrote: Longer answer: the way in Python to achieve the full power of Ruby blocks is to write a function. You are most likely right... there is probably no need to introduce

PyCon Update

2009-03-12 Thread Raymond Hettinger
As of today, we still have rooms at the Hyatt. If you haven't registered yet and want to attend, it is not sold out. http://us.pycon.org/2009/ Raymond -- http://mail.python.org/mailman/listinfo/python-list

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-12 Thread Raymond Hettinger
[Paul Rubin] It would be nice if the PEP included a comparison between the proposed scheme and how it is done in other programs and languages. Good idea. I'm hoping that people will post those here. In my quick research, it looks like many languages offer nothing more than the usual C style %

Re: Invalid syntax with print Hello World

2009-03-12 Thread Luis Zarrabeitia
On Thursday 12 March 2009 07:45:55 am Dotan Cohen wrote: I do not think that is the best way to go about learning Python. Why learn an arguably depreciating version when the new version is available. Because it is not only the language that matters, you also need the libraries to accomplish

Re: ipython / vs \ in readline on MS Windows (and ipython help grepper)

2009-03-12 Thread Jason Scheirer
On Mar 10, 3:34 pm, bdb112 boyd.blackw...@gmail.com wrote: Q1/ I run a standard python ditribution with ipython and readline under cygwin.  The tab filename completion works fine in the OS (bash shell) as expected, and tab filename completion at the ipython command line works, but with MS

Re: Candidate for a new itertool

2009-03-12 Thread pruebauno
On Mar 7, 8:47 pm, Raymond Hettinger pyt...@rcn.com wrote: The existing groupby() itertool works great when every element in a group has the same key, but it is not so handy when groups are determined by boundary conditions. For edge-triggered events, we need to convert a boundary-event

Re: PythonWin, python thread and PostQuitMessage?

2009-03-12 Thread Gabriel Genellina
En Thu, 12 Mar 2009 07:21:35 -0200, arn...@sphaero.org escribió: I'm not so much involved in any Windows programming however I needed to write a client for the Windows platform. I have this very simple question which I've been unable to answer. I'm listening for keyboard strokes using the

Re: Byte type?

2009-03-12 Thread Scott David Daniels
John Nagle wrote: Martin v. Löwis wrote: Please don't call something dumb that you don't fully understand ...- do you have to convert twice? Depends on how you write your code. If you use the bytearray type (which John didn't, despite his apparent believe that he did), then no conversion

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-12 Thread Raymond Hettinger
[Paul Rubin] I think Common Lisp has a feature for formatting thousands. I found the Common Lisp spec for this and added it to the PEP. Raymond -- http://mail.python.org/mailman/listinfo/python-list

Re: import not working?

2009-03-12 Thread Scott David Daniels
Aahz wrote: In article mailman.605.1235434737.11746.python-l...@python.org, Rhodri James rho...@wildebst.demon.co.uk wrote: ... sys.path.append(C:\\DataFileTypes) My preference: sys.path.append(rC:\DataFileTypes) This doesn't work if you need to add a trailing backslash, though. Also my

Re: Python 2.7 MSI / pywin32 snapshots [was: Windows install to custom location ...]

2009-03-12 Thread Scott David Daniels
Tim Golden wrote: Scott David Daniels wrote: Tim Golden wrote: ... Anyhow, at the end I have a working Python 2.7a0 running under Windows. Do you mean 3.1a0? As far as I know, 2.7a0 requires the use of the time machine, as it is expected to be 3 months out. If you do get an installer

Raw String Question

2009-03-12 Thread Jim Garrison
I'm an experienced Perl developer learning Python, but I seem to be missing something about raw strings. Here's a transcript of a Python shell session: Python 3.0 (r30:67507, Dec 3 2008, 20:14:27) [MSC v.1500 32 bit (Intel)] on win32 Type copyright, credits or license() for more

Re: __import__ with dict values

2009-03-12 Thread Gabriel Genellina
En Thu, 12 Mar 2009 09:27:35 -0200, alex goretoy aleksandr.gore...@gmail.com escribió: note i would still like to be able to do __import__(sys).path p = __import__(sys).path That's a convoluted way of doing: import sys p = sys.path (except that the latter one inserts sys in the current

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-12 Thread Paul Rubin
Raymond Hettinger pyt...@rcn.com writes: In my quick research, it looks like many languages offer nothing more than the usual C style % formatting and defer the rest for a local aware module. Hendrik van Rooyen's mention of Cobol's picture (aka PIC) specifications might be added to the list.

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-12 Thread Paul Rubin
Raymond Hettinger pyt...@rcn.com writes: I found the Common Lisp spec for this and added it to the PEP. Ah, cool, I simultaneously looked for it and posted about it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Raw String Question

2009-03-12 Thread Tim Chase
ra\ SyntaxError: EOL while scanning string literal (pyshell#45, line 1) It seems the parser is interpreting the backslash as an escape character in a raw string if the backslash is the last character. Is this expected? Yep...as documented[1], even a raw string cannot end in an odd number

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-12 Thread Scott David Daniels
Raymond Hettinger wrote: ... a generally interesting PEP... Missing from this PEP: output below the decimal point. show results for something like: format(12345.54321, 15,.5f) -- ' 12,345.543,21' Explain the interaction on sizes and lengths (which numbers are digits, which are length [I

Re: Building python 64-bit on OS 10.5?

2009-03-12 Thread Ned Deily
In article 15e4667e0903121005v74d8e971ve57add393cf90...@mail.gmail.com, I've two questions: 1) I've been trying to building python as a 64-bit version on OS 10.5. I'm not too familiar with building python from scratch, and a number of basic attempts made from piecing together things I've

Re: Minimilistic Python on Linux?

2009-03-12 Thread Royce Wilson
Thanks, much better. What exactly do I lose when I launch python without site.py? On Wed, Mar 11, 2009 at 10:27 PM, Gabriel Genellina gagsl-...@yahoo.com.arwrote: En Thu, 12 Mar 2009 00:41:18 -0200, Royce Wilson rww...@gmail.com escribió: On Wed, Mar 11, 2009 at 9:33 PM, Royce Wilson

Re: loop performance in global namespace (python-2.6.1)

2009-03-12 Thread Duncan Booth
Poor Yorick org.python.pythonl...@pooryorick.com wrote: In the following snippet, the loop in the global namespace takes twice as long as the loop in the function namespace. Why? Accessing global variables is generally slower than accessing local variables. Locals are effectively stored in

Re: loop performance in global namespace (python-2.6.1)

2009-03-12 Thread Scott David Daniels
Poor Yorick wrote: In the following snippet, the loop in the global namespace takes twice as long as the loop in the function namespace. Why? Locals are known to have no outside interaction, and so are not looked up by name. your code could have a thread that did, global counter

Re: What happened to NASA at Python? :(

2009-03-12 Thread r
On Mar 12, 3:31 am, Michele Simionato michele.simion...@gmail.com wrote: That's pretty much impossible. I am sure NASA uses all programming languages in existence, plus probably many internal ones we never heard of. True but... all([NASA.does_endorse(lang) for lang in NASA['languages']])

Re: Raw String Question

2009-03-12 Thread Jim Garrison
Tim Chase wrote: ra\ SyntaxError: EOL while scanning string literal (pyshell#45, line 1) It seems the parser is interpreting the backslash as an escape character in a raw string if the backslash is the last character. Is this expected? Yep...as documented[1], even a raw string cannot end

Re: Raw String Question

2009-03-12 Thread Nick Craig-Wood
Jim Garrison jgarri...@troux.com wrote: ra\b 'a\\b' ra\ SyntaxError: EOL while scanning string literal (pyshell#45, line 1) ra\ 'a\\ ' ra\ 'a\\' It seems the parser is interpreting the backslash as an escape character in a raw string if the backslash is the

RE: Question on periods in strings

2009-03-12 Thread Philip Bloom
Thanks. I now know the cause of this, the suggestion to fling it in a few languages made it obvious. All of them were sharing the issue. Specifically that Trend MicroOffice Scan was the stalling factor, which was significantly boosting write times and if the write had any periods it would

Re: cross platform accessing paths (windows, linux ...)

2009-03-12 Thread Vlastimil Brom
On Thu, Mar 12, 2009 at 8:10 AM, Vlastimil Brom vlastimil.b...@gmail.com wrote: Hi all, I'd like to ask for some advice on how to acomplish file access in a cross platform way. ... Any hints or comments are much appreciated; thanks in advance! regards,   Vlasta 2009/3/12 Mike Mazurek

Re: Raw String Question

2009-03-12 Thread Duncan Booth
Jim Garrison jgarri...@troux.com wrote: OK, I'm curious as to the reasoning behind saying that When an 'r' or 'R' prefix is present, a character following a backslash is included in the string without change, and all backslashes are left in the string. which sounds

Re: Raw String Question

2009-03-12 Thread Jim Garrison
Tim Chase wrote: ra\ SyntaxError: EOL while scanning string literal (pyshell#45, line 1) It seems the parser is interpreting the backslash as an escape character in a raw string if the backslash is the last character. Is this expected? Yep...as documented[1], even a raw string cannot end

Getting final url when original url redirects

2009-03-12 Thread IanR
I'm processing RSS content from a # of given sources. Most of the time the url given by the RSS feed redirects to the real URL (I'm guessing they do this for tracking purposes) For example. This is a url that I get from and RSS feed,

  1   2   >