Re: Pipe in the "return" statement

2011-07-27 Thread Thomas 'PointedEars' Lahn
Ethan Furman wrote: > Billy Mays wrote: >> On 07/25/2011 10:16 AM, Archard Lias wrote: >>> On Jul 25, 2:03 pm, Ian Collins wrote: On 07/26/11 12:00 AM, Archard Lias wrote: > Still I dont get how I am supposed to understand the pipe and its > task/ idea/influece on control flow, of: >

Re: PEP 8 and extraneous whitespace

2011-07-27 Thread OKB (not okblacke)
Thomas 'PointedEars' Lahn wrote: > Automatic word-wrap, where available, really is not a solution; it > is a bad workaround to a problem caused by the original author of > the source code that can be easily avoided by them taking more care > while coding. I think exactly the opposite. T

Re: Programming Python for Absolute Beginners

2011-07-27 Thread harrismh777
Billy Mays wrote: No one cares and don't spam the list. ... ouch, now I feel really bad... has someone not had their coffee this morning? kind regards, -- m harris FSF ...free as in freedom/ http://webpages.charter.net/harrismh777/gnulinux/gnulinux.htm -- http://mail.python.org/ma

Seeking an example on using Queue to update variable while threading

2011-07-27 Thread Danny Wong (dannwong)
Hi Python experts, I'm trying to use a dict structure to store and update information from X number of threads. How do I share this dict structure between threads? I heard of using a queue, but I'm not familiar with how it works. Does anyone have an example of using a queue to store vari

Re: Programming Python for Absolute Beginners

2011-07-27 Thread Billy Mays
On 7/27/2011 11:50 PM, harrismh777 wrote: No one cares and don't spam the list. -- http://mail.python.org/mailman/listinfo/python-list

Programming Python for Absolute Beginners

2011-07-27 Thread harrismh777
Greetings folks, Well, we're back from a 3985 mile road trip around the Southeastern U.S. ending back in Minnesota--- dragging a trailer--- spent somewhere close to a month visiting battle fields honoring the CSA dead from that little skirmish between the states 1861-1865... found my great

Re: PyWart: PEP8: A cauldron of inconsistencies.

2011-07-27 Thread harrismh777
Steven D'Aprano wrote: On Thu, 28 Jul 2011 08:34 am rantingrick wrote: > WRONG! When in doubt be consistent! There should be one AND ONLY ONE > obvious way to do it! When we have multiple ways of doing the same > thing we induce an overhead into our work flows. Instead we need to > follow t

Re: PyWart: PEP8: A cauldron of inconsistencies.

2011-07-27 Thread Steven D'Aprano
On Thu, 28 Jul 2011 08:34 am rantingrick wrote: > WRONG! When in doubt be consistent! There should be one AND ONLY ONE > obvious way to do it! When we have multiple ways of doing the same > thing we induce an overhead into our work flows. Instead we need to > follow the zen; in other words, BE CON

PyImport_ImportModule bug in ver 3.1.2?

2011-07-27 Thread 健安 王
Hi: My Python version is 3.1.2. I am programming embedding c with python in windows. When I imported urllib.request in my test py file, PyImport_ImportModule always return NULL. But I imported re or cmd ,they work fine. I found urllib is folder, and request

Re: How should I document exceptions thrown by a method?

2011-07-27 Thread Chris Torek
>Arcadio writes: >> I have a Settings class that is used to hold application settings. A >> Settings object initializes itself from a ConfigParser that gets >> passed in as an argument to the constructor. In article <87oc0fpg9o@benfinney.id.au> Ben Finney wrote: >So the caller is aware of,

Re: PyWart: PEP8: A cauldron of inconsistencies.

2011-07-27 Thread Andrew Berg
On 2011.07.27 08:34 PM, Cameron Simpson wrote: > I think when he releases Python4000 we'll all fall behind. That is, if he ever does release RickPy4000. ;) -- CPython 3.2.1 | Windows NT 6.1.7601.17592 | Thunderbird 5.0 PGP/GPG Public Key ID: 0xF88E034060A78FCB -- http://mail.python.org/mailman/l

Re: PyWart: PEP8: A cauldron of inconsistencies.

2011-07-27 Thread Cameron Simpson
On 28Jul2011 02:06, Thomas Jollans wrote: | On 28/07/11 00:34, rantingrick wrote: | > [ snip rant ] | | To be clear, the code is more what you'd call "guidelines" than actual | rules. Welcome aboard the Black Pearl, Mister Ranting! I think when he releases Python4000 we'll all fall behind. -- C

PyCon Australia 2011: Registration Back Online

2011-07-27 Thread Ryan Kelly
Hi Everyone, After a brief hiatus, registrations for PyCon Australia 2011 are back online! We have extended some registration deadlines to compensate for the outage. PyCon Australia is Australia's only conference dedicated exclusively to the Python programming language, and will be held at th

pysvn merge

2011-07-27 Thread mud
I have started using your pysvn module and find it very useful. I trying to doing a pysvn.Client.merge which is working well, but I am would like to cater for conflicts. I would like to by default accept “theirs-full” version, but I can’t figure out how to do it. Svn command line merge has a opti

Re: How do I access IDLE in Win7

2011-07-27 Thread W. eWatson
In the mean time, I punted and re-installed. It's still not quite right. I uninstalled it. I was asked during install if I wanted to remove c:\Python25. It was still there and had several folders (Lib, Scripts) and files (fishe.py, RemovePIL.exe, junk.py). I said yes. It installed 2.5.2. Edit

Re: PyWart: PEP8: A cauldron of inconsistencies.

2011-07-27 Thread Thomas Jollans
On 28/07/11 00:34, rantingrick wrote: > I believe the current Python style guide is inconsistent. The author > again allowed hie emotion to get in the way of logic. If you think that logic can be the foundation of a style [guide], then you have a very curious idea of what "logic" means. > [ snip

Re: [Tutor] Fall in love with bpython

2011-07-27 Thread Karim
On 07/28/2011 01:32 AM, Walter Prins wrote: Hi Karim On 28 July 2011 00:04, Karim > wrote: On 07/27/2011 12:34 AM, Alan Gauld wrote: Karim wrote: I use bpython interpreter. This is a very good interactive CLI. I had

Re: How do I access IDLE in Win7

2011-07-27 Thread Thomas Jollans
On 27/07/11 23:26, W. eWatson wrote: > I cannot copy from the cmd window. It ends with [errorno 13] Permission > denied to c:||Users\\Wayne\\idlerc\\recent-files.lst' > Yes you can. Right-click to bring up a menu with a "select" or "copy" option (IIRC) As for the error, see if there is file /use

Re: PyWart: PEP8: A cauldron of inconsistencies.

2011-07-27 Thread Andrew Berg
On 2011.07.27 05:34 PM, rantingrick wrote: >> -- >> Use 4 spaces per indentation level. >> -- > > This should be the only acceptable indention level allowed by the > interpreter. All oth

Re: Strings show as brackets with a 'u'.

2011-07-27 Thread goldtech
> Rick gave you some good advice, perhaps worth re-reading. What you need > are investigative skills, and not just bits of data. Totally agree. beginning to see what's going on. I'm not specifically accessing the list element with n (vs. n[0]). Printing n uses repr which gives the unicode "tag".

Re: [Tutor] Fall in love with bpython

2011-07-27 Thread Walter Prins
Hi Karim On 28 July 2011 00:04, Karim wrote: > On 07/27/2011 12:34 AM, Alan Gauld wrote: > >> Karim wrote: >> >> I use bpython interpreter. This is a very good interactive CLI. >>> >> >> I had never heard of it and had to google for it. >> It appears to be a curses based CLI for *nix and MacOS

Re: PEP 8 and extraneous whitespace

2011-07-27 Thread Thomas 'PointedEars' Lahn
Chris Rebert wrote: > John Gordon wrote: >> Neil Cerutti writes: >>> You can fit much more code per unit of horizontal space with a >>> proportionally spaced font. As a result, that issue, while valid, >>> is significantly reduced. >> >> Is it? I assume one major reason for the 80-character limit

Re: Fall in love with bpython

2011-07-27 Thread Karim
On 07/28/2011 12:31 AM, Michael Poeltl wrote: hi, have you heard abut ipython? maybe that's helpful for you? http://ipython.scipy.org/moin/python Hello Michael, Yes I saw some article where Ipython and Bpython CLI integrations was made in Django. Thanks for the link I will evaluate it as w

Re: can I use element tree for handling special characters in xml text?

2011-07-27 Thread Thomas 'PointedEars' Lahn
hackingKK wrote: > I have been waiting a lot to ask this question and I did ask some days > back but probably could not put it the proper way. You still can't. But to spare everyone yet another try: > I want to know how I can safely include

Re: Fall in love with bpython

2011-07-27 Thread Karim
On 07/27/2011 12:34 AM, Alan Gauld wrote: Karim wrote: I use bpython interpreter. This is a very good interactive CLI. I had never heard of it and had to google for it. It appears to be a curses based CLI for *nix and MacOS Ah Windows user. I want to create a CLI with the same features

PyWart: PEP8: A cauldron of inconsistencies.

2011-07-27 Thread rantingrick
I believe the current Python style guide is inconsistent. The author again allowed hie emotion to get in the way of logic. I will be posting blocks of text from the PEP8 and commenting below them. > -- > One of Guido's key insights is that c

Re: Fall in love with bpython

2011-07-27 Thread Alan Gauld
Karim wrote: I use bpython interpreter. This is a very good interactive CLI. I had never heard of it and had to google for it. It appears to be a curses based CLI for *nix and MacOS I want to create a CLI with the same features than bpython. But the cmd std module seems no to be used in thi

Re: shlex parsing

2011-07-27 Thread Karim
On 07/28/2011 12:11 AM, Dan Stromberg wrote: You could probably use a recursive descent parser with the standard library. But if your management is OK with pyparsing, that might be easier, and a bit more clear as well. Yes, I thought to use str method partition in a recursive way but using

Re: shlex parsing

2011-07-27 Thread Dan Stromberg
You could probably use a recursive descent parser with the standard library. But if your management is OK with pyparsing, that might be easier, and a bit more clear as well. On Wed, Jul 27, 2011 at 2:08 PM, Karim wrote: > ** > > Thank you Dan for answering. > > I ended with this and gave up wit

Fall in love with bpython

2011-07-27 Thread Karim
Hello, I use bpython interpreter. This is a very good interactive CLI. I want to create a CLI with the same features than bpython. But the cmd std module seems no to be used in this project... Is there a tool where I can plug all my grammary commands line a sort of generic box with completion,

Re: How do I access IDLE in Win7

2011-07-27 Thread W. eWatson
On 7/27/2011 12:53 PM, Jerry Hill wrote: On Wed, Jul 27, 2011 at 3:34 PM, W. eWatson wrote: On 7/27/2011 9:48 AM, Jerry Hill wrote: So, you don't have an idle.py or idle.pyw in C:\Python26\Lib\idlelib\ (or where ever you installed python)? If not, it sounds to me like your python installation

Re: How should I document exceptions thrown by a method?

2011-07-27 Thread Ben Finney
Arcadio writes: > I have a Settings class that is used to hold application settings. A > Settings object initializes itself from a ConfigParser that gets > passed in as an argument to the constructor. So the caller is aware of, and takes responsibility for, the ConfigParser instance. > If a set

Re: shlex parsing

2011-07-27 Thread Karim
Thank you Dan for answering. I ended with this and gave up with shlex: split = ['-option1', '[get_rule', 'A1', 'B2]', '-option2', '$VAR', '-option3', 'TAG'] procedure_found = False result = [] for token in split: if not token.startswith('[') and not token.endswith(']') and not

TestFixtures 1.11.0 Released!

2011-07-27 Thread Chris Withers
Hi All, I'm happy to announce a new release of TestFixtures with the following changes: - testfixtures' compare function now does rich comparison of dicts and their subclasses, showing which keys matches, were missing or differed between the two objects being compared. - A decorator of Sho

Re: shlex parsing

2011-07-27 Thread Dan Stromberg
I've not used the shlex module, but this feels more like an issue to address with a parser than for a lexical analyzer - or perhaps even both, since you're splitting on whitespace sometimes, and matching square brackets sometimes. I've used pyparsing for stuff a bit similar to this. Or here's a l

Suggestions on writing a sh <--> python Howto/Tutorial

2011-07-27 Thread Robert Laing
I've been tinkering around learning traditional Unix shell programming and python at the same time. I set myself the following exercise which I found quite educational. I first wrote a shell CGI script to read the man pages on my web hosting service's computer via a browser like so: http:///rtfm.

Re: How do I access IDLE in Win7

2011-07-27 Thread Jerry Hill
On Wed, Jul 27, 2011 at 3:34 PM, W. eWatson wrote: > On 7/27/2011 9:48 AM, Jerry Hill wrote: >> So, you don't have an idle.py or idle.pyw in C:\Python26\Lib\idlelib\ >> (or where ever you installed python)?  If not, it sounds to me like >> your python installation is screwed up.  I would re-instal

How should I document exceptions thrown by a method?

2011-07-27 Thread Arcadio
I use Doxygen to document my source code, and I'm wondering how exceptions thrown by a method of a class should be documented in the following example. I have a Settings class that is used to hold application settings. A Settings object initializes itself from a ConfigParser that gets passed in a

Re: How do I access IDLE in Win7

2011-07-27 Thread W. eWatson
On 7/27/2011 9:48 AM, Jerry Hill wrote: On Wed, Jul 27, 2011 at 12:28 PM, W. eWatson wrote: If I run cmd.exe and work my way down to .../idlelib, I find nothing but idle.bat. strange. Hidden? I can get into line mode by using python.exe. That is, I can type in print "abc", and get a result.

shlex parsing

2011-07-27 Thread Karim
Hello All, I would like to parse this TCL command line with shlex: '-option1 [get_rule A1 B2] -option2 $VAR -option3 TAG' And I want to get the splitted list: ['-option1', '[get_rule A1 B2]', '-option2', '$VAR', '-option3', 'TAG'] Then I will gather in tuple 2 by 2 the arguments. I tried

Re: Only Bytecode, No .py Files

2011-07-27 Thread harrismh777
Christian Heimes wrote: Now the test.py has the same mtime as test.pyc and Python won't recompile the .pyc file from the .py file as long as the magic header (168686339) is correct. ~very cool. -- http://mail.python.org/mailman/listinfo/python-list

Re: Maximize already running tkinter program on invocation

2011-07-27 Thread Francesco Bochicchio
On 27 Lug, 10:18, Steven Kauffmann wrote: > Hi all, > > I have written a small GUI application in python 3.x using the tkinter > module. Program is running fine, but multiple instances of the program > can now be created. I would like to reduce the number of instances of > the program to only 1 in

Re: How do I access IDLE in Win7

2011-07-27 Thread Jerry Hill
On Wed, Jul 27, 2011 at 12:28 PM, W. eWatson wrote: > If I run cmd.exe and work my way down to  .../idlelib, I find nothing but > idle.bat. strange. Hidden?  I can get into line mode by using python.exe. > That is, I can type in print "abc", and get a result. So, you don't have an idle.py or idle

Re: How do I access IDLE in Win7

2011-07-27 Thread W. eWatson
On 7/27/2011 8:38 AM, rantingrick wrote: On Jul 27, 10:06 am, "W. eWatson" wrote: It's been many months since I played with Python, and have forgotten how to bring up IDLE. If I simply click on a py file, I see what may be a dos window appear and quickly disappear. "Double-clicking" a [py|pyw

Re: How can I make a program automatically run once per day?

2011-07-27 Thread John Salerno
On Jul 27, 7:58 am, Billy Mays <81282ed9a88799d21e77957df2d84bd6514d9...@myhashismyemail.com> wrote: > On 07/27/2011 08:35 AM, Chris Angelico wrote: > > > > > > > > > > > On Wed, Jul 27, 2011 at 10:27 PM, Dave Angel  wrote: > >> As Chris pointed out, you probably aren't getting the script's directo

Re: How do I access IDLE in Win7

2011-07-27 Thread rantingrick
On Jul 27, 10:06 am, "W. eWatson" wrote: > It's been many months since I played with Python, and have forgotten how > to bring up IDLE. If I simply click on a py file, I see what may be a > dos window appear and quickly disappear. "Double-clicking" a [py|pyw] file in windows will auto run the fil

How do I access IDLE in Win7

2011-07-27 Thread W. eWatson
It's been many months since I played with Python, and have forgotten how to bring up IDLE. If I simply click on a py file, I see what may be a dos window appear and quickly disappear. If I right-click on the file, and select IDLE, the same thing happens. If I go directly to All Programs, the sa

Re: Only Bytecode, No .py Files

2011-07-27 Thread Thomas Rachel
Am 27.07.2011 14:18 schrieb John Roth: Two comments. First, your trace isn't showing attempts to open .py files, it's showing attempts to open the Curses library in the bash directory. Of course. My goal was to show that the OP's "problem" is not a python one, but occurs all over several prog

Re: How can I make a program automatically run once per day?

2011-07-27 Thread Billy Mays
On 07/27/2011 08:35 AM, Chris Angelico wrote: On Wed, Jul 27, 2011 at 10:27 PM, Dave Angel wrote: As Chris pointed out, you probably aren't getting the script's directory right. After all, how can the scheduler guess where you put it? The obvious answer is to use a full path for the script's

Re: How can I make a program automatically run once per day?

2011-07-27 Thread Chris Angelico
On Wed, Jul 27, 2011 at 10:27 PM, Dave Angel wrote: > As Chris pointed out, you probably aren't getting the script's directory > right.  After all, how can the scheduler guess where you put it?  The > obvious answer is to use a full path for the script's filename.  Another > alternative is to fill

Re: How can I make a program automatically run once per day?

2011-07-27 Thread Dave Angel
On 01/-10/-28163 02:59 PM, John Salerno wrote: On Jul 26, 9:22 pm, Andrew Berg wrote: On 2011.07.26 08:05 PM,JohnSalernowrote:> Hmm, okay I'm finally trying Task Scheduler, but how do I set it to run a Python script? It seems to not work, I suppose because it's running the script but doesn't

Re: Only Bytecode, No .py Files

2011-07-27 Thread John Roth
On Jul 27, 1:10 am, Thomas Rachel wrote: > Am 26.07.2011 17:19 schrieb Eldon Ziegler: > > > Is there a way to have the Python processor look only for bytecode > > files, not .py files? We are seeing huge numbers of Linux audit messages > > on production system on which only bytecode files are stor

Re: Maximize already running tkinter program on invocation

2011-07-27 Thread Peter Otten
Steven Kauffmann wrote: > I have written a small GUI application in python 3.x using the tkinter > module. Program is running fine, but multiple instances of the program > can now be created. I would like to reduce the number of instances of > the program to only 1 instance. I know that this is po

Re: can I use element tree for handling special characters in xml text?

2011-07-27 Thread Stefan Behnel
hackingKK, 27.07.2011 13:16: I have been waiting a lot to ask this question and I did ask some days back but probably could not put it the proper way. I assume you missed the answer you got? I want to know how I can safely include special characters like & or > in xml text? For example I sto

can I use element tree for handling special characters in xml text?

2011-07-27 Thread hackingKK
Hello all. I have been waiting a lot to ask this question and I did ask some days back but probably could not put it the proper way. I want to know how I can safely include special characters like & or > in xml text? For example I store a small xml file containing list of organisations. Many

PyImport_ImportModule bug in 3.1.2

2011-07-27 Thread bob . wang
Hi: My Python version is 3.1.2. I am programming embedding c with python in windows. When I imported urllib.request in my test py file, PyImport_ImportModule always return NULL. But I imported re or cmd ,they work fine. I found urllib is folder, and request

Re: Only Bytecode, No .py Files

2011-07-27 Thread Christian Heimes
Am 27.07.2011 03:32, schrieb harrismh777: > Christian Heimes wrote: >> The first four bytes of a pyc file contain the magic header. It must >> match the magic of the current Python version. The next four bytes >> contain the pyc_mtime. It must match the mtime of the corresponding .py >> files as re

Re: Validating Entry in tkinter

2011-07-27 Thread Giacomo Boffi
Saul Spatz writes: > In tcl/tk an Entry widget can be set to validate its contents with > the validate option. [...] Can one do something like this in > tkinter? i read the thread and nobody mentioned the python mega widget (Pmw) toolkit, from whose docs i quote the following Pmw.EntryField()

Re: How can I make a program automatically run once per day?

2011-07-27 Thread baloan
On Jul 14, 7:00 pm, monkeys paw wrote: > On 7/9/2011 10:01 PM, John Salerno wrote: > > > Thanks everyone! I probably should have said something like "Python, > > if possible and efficient, otherwise any other method" ! :) > > > I'll look into the Task Scheduler. Thanks again! > > You could use the

Maximize already running tkinter program on invocation

2011-07-27 Thread Steven Kauffmann
Hi all, I have written a small GUI application in python 3.x using the tkinter module. Program is running fine, but multiple instances of the program can now be created. I would like to reduce the number of instances of the program to only 1 instance. I know that this is possible by using a single

Re: Only Bytecode, No .py Files

2011-07-27 Thread Thomas Rachel
Am 26.07.2011 17:19 schrieb Eldon Ziegler: Is there a way to have the Python processor look only for bytecode files, not .py files? We are seeing huge numbers of Linux audit messages on production system on which only bytecode files are stored. The audit subsystem is recording each open failure.

Re: seeking an example on C extension works in python 3.1.x or above

2011-07-27 Thread Stefan Behnel
Terry Reedy, 27.07.2011 04:58: On 7/26/2011 8:06 PM, llwaeva...@gmail.com wrote: I have been searching the example on C extension that works in python 3.1.x All the stdlib modules written in C. These are extension modules that come with Python. There are perhaps a hundred more on PyPI. Or hu