ANN: pydf 9

2010-04-07 Thread garabik-news-2005-05
pydf displays the amount of used and available space on your filesystems, just like df, but in colours. The output format is completely customizable. Pydf was written and works on Linux, but should work also on other modern UNIX systems (including MacOSX). URL:

[ANN] Greenlet 0.3.1 released

2010-04-07 Thread Kyle Ambroff
Announcing the release of greenlet 0.3.1: http://pypi.python.org/pypi/greenlet/0.3.1 0.3.1 is a bugfix release that fixes a critical reference leak bug. The 0.3 release introduced support for passing keyword arguments to the switch method. There was an edge case where an empty keyword argument

Grease 0.2 Released

2010-04-07 Thread Casey Duncan
Grease is a pluggable and highly extensible 2D game engine and framework for Python. The intent of this project is to provide a fresh approach to Python game development. The component-based architecture allows games to be constructed bit by bit with built-in separation of concerns. The engine

virtualenvwrapper 2.0

2010-04-07 Thread Doug Hellmann
What is virtualenvwrapper = virtualenvwrapper_ is a set of extensions to Ian Bicking's virtualenv_ tool. The extensions include wrappers for creating and deleting virtual environments and otherwise managing your development workflow, making it easier to work on more than

WxPython's Py Suite (PyCrust, etc.) updated with new magic features and new notebook interface shell, PySlices

2010-04-07 Thread David Mashburn
WxPython's Py Suite (PyCrust, etc.) updated with new magic features and new notebook interface shell, PySlices. WxPython has, for a long time, included PyCrust, one of the most popular Python shells. PyCrust has found uses in a number of projects, including Stani's Python Editor and some

ANN: oejskit 0.8.8 JavaScript in-browser testing with py.test plugin and unittest.py glue

2010-04-07 Thread Samuele Pedroni
I'm happy to announce a new release of OE jskit 0.8.8 available on PyPI. Main points of interest: * the code to check for the presence of browsers locally has been improved, browser specifications can now with much more confidence list absent browsers and the respective runs/tests will be

PyCon Australia Call For Proposals

2010-04-07 Thread Richard Jones
Hi everyone, I'm happy to announce that on the 26th and 27th of June we are running PyCon Australia in Sydney! http://pycon-au.org/ We are looking for proposals for Talks on all aspects of Python programming from novice to advanced levels; applications and frameworks, or how you have been

python Barcamp in Cologne - regional unconference

2010-04-07 Thread Reimar Bauer
The german python usergroup pyCologne announces a barcamp at 17.4 in cologne. For further details see http://python-barcamp.de (Sorry, this page is in German only) An unconference is a facilitated, participant-driven conference centered on a theme or purpose (http://en.wikipedia.org/wiki/

Re: Getting Local MAC Address

2010-04-07 Thread Rebelo
Lawrence D'Oliveiro wrote: In message ec6d247c-a6b0-4f33-a36b-1d33eace6...@k19g2000yqn.googlegroups.com, Booter wrote: I am new to python ans was wondering if there was a way to get the mac address from the local NIC? What if you have more than one? you can try with netifaces :

Re: (a==b) ? 'Yes' : 'No'

2010-04-07 Thread Duncan Booth
Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Tue, 06 Apr 2010 16:54:18 +, Duncan Booth wrote: Albert van der Horst alb...@spenarnc.xs4all.nl wrote: Old hands would have ... stamp =( weight=1000 and 120 or weight=500 and 100 or

Re: pass object or use self.object?

2010-04-07 Thread Bruno Desthuilliers
Lie Ryan a écrit : (snip) Since in function in python is a first-class object, you can instead do something like: def process(document): # note: document should encapsulate its own logic document.do_one_thing() Obvious case of encapsulation abuse here. Should a file object

Python and Regular Expressions

2010-04-07 Thread Richard Lamboj
Hello, i want to parse this String: version 3.5.1 { $pid_dir = /opt/samba-3.5.1/var/locks/ $bin_dir = /opt/samba-3.5.1/bin/ service smbd { bin = ${bin_dir}smbd -D pid = ${pid_dir}smbd.pid } service nmbd {

Re: plotting in python 3

2010-04-07 Thread egl...@gmail.com
On Apr 6, 11:52 pm, Rolf Camps rolf_ca...@fsfe.org wrote: Op dinsdag 06-04-2010 om 14:55 uur [tijdzone -0500], schreef Christopher Choi: It was after the homework I asked my question. All plot solutions i found where for python2.x. gnuplot_py states on its homepage you need a 'working copy

Re: Python and Regular Expressions

2010-04-07 Thread Chris Rebert
On Wed, Apr 7, 2010 at 1:37 AM, Richard Lamboj richard.lam...@bilcom.at wrote: i want to parse this String: version 3.5.1 {        $pid_dir = /opt/samba-3.5.1/var/locks/        $bin_dir = /opt/samba-3.5.1/bin/        service smbd {                bin = ${bin_dir}smbd -D                

Re: converting a timezone-less datetime to seconds since the epoch

2010-04-07 Thread Chris Withers
Hi Chris, Chris Rebert wrote: from calendar import timegm def timestamp(dttm): return timegm(dttm.utctimetuple()) #the *utc*timetuple change is just for extra consistency #it shouldn't actually make a difference here And problem solved. As for what the problem was: Paraphrasing the table

Re: Python and Regular Expressions

2010-04-07 Thread Bruno Desthuilliers
Richard Lamboj a écrit : Hello, i want to parse this String: version 3.5.1 { $pid_dir = /opt/samba-3.5.1/var/locks/ $bin_dir = /opt/samba-3.5.1/bin/ service smbd { bin = ${bin_dir}smbd -D pid = ${pid_dir}smbd.pid }

Re: Python and Regular Expressions

2010-04-07 Thread Richard Lamboj
Am Wednesday 07 April 2010 10:52:14 schrieb Chris Rebert: On Wed, Apr 7, 2010 at 1:37 AM, Richard Lamboj richard.lam...@bilcom.at wrote: i want to parse this String: version 3.5.1 {        $pid_dir = /opt/samba-3.5.1/var/locks/        $bin_dir = /opt/samba-3.5.1/bin/        

Re: Q about assignment and references

2010-04-07 Thread jdbosmaus
Thanks to all for the informative answers. You made me realize this is a wxPython issue. I have to say, wxPython seems useful, and I'm glad it is available - but it doesn't have the gentlest of learning curves. -- http://mail.python.org/mailman/listinfo/python-list

PyCon Australia Call For Proposals

2010-04-07 Thread Richard Jones
Hi everyone, I'm happy to announce that on the 26th and 27th of June we are running PyCon Australia in Sydney! http://pycon-au.org/ We are looking for proposals for Talks on all aspects of Python programming from novice to advanced levels; applications and frameworks, or how you have been

Re: staticmethod and namespaces

2010-04-07 Thread Дамјан Георгиевски
Having an odd problem that I solved, but wondering if its the best solution (seems like a bit of a hack). First off, I'm using an external DLL that requires static callbacks, but because of this, I'm losing instance info. It could be import related? It will make more sense after I diagram

Re: converting a timezone-less datetime to seconds since the epoch

2010-04-07 Thread Floris Bruynooghe
On Apr 7, 9:57 am, Chris Withers ch...@simplistix.co.uk wrote: Chris Rebert wrote: To convert from struct_time in ***UTC*** to seconds since the epoch use calendar.timegm() ...and really, wtf is timegm doing in calendar rather than in time? ;-) You're not alone in finding this strange:

jobs in california jobs in california los angeles jobs in california for uk residents jobs in california san diego jobs in california orange county jobs in california for british http

2010-04-07 Thread Naeem
jobs in california jobs in california los angeles jobs in california for uk residents jobs in california san diego jobs in california orange county jobs in california for british http://jobsincalifornia-usa.blogspot.com/ jobs in california jobs in california los angeles jobs in

Re: Impersonating a Different Logon

2010-04-07 Thread Kevin Holleran
On Tue, Apr 6, 2010 at 4:11 PM, Tim Golden m...@timgolden.me.uk wrote: On 06/04/2010 20:26, Kevin Holleran wrote: Hello, I am sweeping some of our networks to find devices.  When I find a device I try to connect to the registry using _winreg and then query a specific key that I am

Striving for PEP-8 compliance

2010-04-07 Thread Tom Evans
[ Please keep me cc'ed, I'm not subscribed ] Hi all I've written a bunch of internal libraries for my company, and they all use two space indents, and I'd like to be more consistent and conform to PEP-8 as much as I can. My problem is I would like to be certain that any changes do not alter the

Re: Striving for PEP-8 compliance

2010-04-07 Thread geremy condra
On Wed, Apr 7, 2010 at 10:53 AM, Tom Evans tevans...@googlemail.com wrote: [ Please keep me cc'ed, I'm not subscribed ] Hi all I've written a bunch of internal libraries for my company, and they all use two space indents, and I'd like to be more consistent and conform to PEP-8 as much as I

Re: imports again

2010-04-07 Thread Gabriel Genellina
En Tue, 06 Apr 2010 14:25:38 -0300, Alex Hall mehg...@gmail.com escribió: Sorry this is a forward (long story involving a braille notetaker's bad copy/paste and GMail's annoying mobile site). Basically, I am getting errors when I run the project at http://www.gateway2somewhere.com/sw.zip

Re: Impersonating a Different Logon

2010-04-07 Thread Tim Golden
On 07/04/2010 14:57, Kevin Holleran wrote: Thanks, I was able to connect to the remote machine. However, how do I query for a very specific key value? I have to scan hundreds of machines and need want to reduce what I am querying. I would like to be able to scan a very specific key and report

Re: Striving for PEP-8 compliance

2010-04-07 Thread Grant Edwards
On 2010-04-07, Tom Evans tevans...@googlemail.com wrote: [ Please keep me cc'ed, I'm not subscribed ] Sorry. I post via gmane.org, so cc'ing you would require some extra work, and I'm too lazy. I've written a bunch of internal libraries for my company, and they all use two space indents, and

Re: Simplify Python

2010-04-07 Thread AlienBaby
On 6 Apr, 20:04, ja1lbr3ak superheroco...@gmail.com wrote: I'm trying to teach myself Python, and so have been simplifying a calculator program that I wrote. The original was 77 lines for the same functionality. Problem is, I've hit a wall. Can anyone help? loop = input(Enter 1 for the

Re: Striving for PEP-8 compliance

2010-04-07 Thread Gabriel Genellina
En Wed, 07 Apr 2010 11:53:58 -0300, Tom Evans tevans...@googlemail.com escribió: [ Please keep me cc'ed, I'm not subscribed ] Sorry; you may read this at http://groups.google.com/group/comp.lang.python/ I've written a bunch of internal libraries for my company, and they all use two

Re: Striving for PEP-8 compliance

2010-04-07 Thread Gabriel Genellina
En Wed, 07 Apr 2010 11:53:58 -0300, Tom Evans tevans...@googlemail.com escribió: [ Please keep me cc'ed, I'm not subscribed ] Sorry; you may read this at http://groups.google.com/group/comp.lang.python/ I've written a bunch of internal libraries for my company, and they all use two

Re: Striving for PEP-8 compliance

2010-04-07 Thread Tom Evans
On Wed, Apr 7, 2010 at 4:10 PM, geremy condra debat...@gmail.com wrote: On Wed, Apr 7, 2010 at 10:53 AM, Tom Evans tevans...@googlemail.com wrote: [ Please keep me cc'ed, I'm not subscribed ] Hi all I've written a bunch of internal libraries for my company, and they all use two space

Re: Striving for PEP-8 compliance

2010-04-07 Thread Robert Kern
On 2010-04-07 11:06 AM, Tom Evans wrote: On Wed, Apr 7, 2010 at 4:10 PM, geremy condradebat...@gmail.com wrote: On Wed, Apr 7, 2010 at 10:53 AM, Tom Evanstevans...@googlemail.com wrote: [ Please keep me cc'ed, I'm not subscribed ] Hi all I've written a bunch of internal libraries for my

jobs in newyork hotel jobs in newyork city jobs in newyork newyork jobs in newyork usa newyork jobs newyork jobbank newyork job exchange http://jobsinnewyork-usa.blogspot.com/

2010-04-07 Thread saima81
jobs in newyork hotel jobs in newyork city jobs in newyork newyork jobs in newyork usa newyork jobs newyork jobbank newyork job exchange http://jobsinnewyork-usa.blogspot.com/ jobs in newyork hotel jobs in newyork city jobs in newyork newyork jobs in newyork usa newyork jobs newyork jobbank

Re: (a==b) ? 'Yes' : 'No'

2010-04-07 Thread Emile van Sebille
On 4/6/2010 9:20 PM Steven D'Aprano said... On Tue, 06 Apr 2010 16:54:18 +, Duncan Booth wrote: Most old hands would (IMHO) write the if statements out in full, though some might remember that Python comes 'batteries included': from bisect import bisect WEIGHTS = [100, 250, 500, 1000]

Re: pass object or use self.object?

2010-04-07 Thread Tim Arnold
On Apr 6, 11:19 am, Jean-Michel Pichavant jeanmic...@sequans.com wrote: Tim Arnold wrote: Hi, I have a few classes that manipulate documents. One is really a process that I use a class for just to bundle a bunch of functions together (and to keep my call signatures the same for each of my

[2.5.1/cookielib] How to display specific cookie?

2010-04-07 Thread Gilles Ganault
Hello I'm using ActivePython 2.5.1 and the cookielib package to retrieve web pages. I'd like to display a given cookie from the cookiejar instead of the whole thing: #OK for index, cookie in enumerate(cj): print index, ' : ', cookie #How to display just

Re: lambda with floats

2010-04-07 Thread Peter Pearson
On Tue, 06 Apr 2010 23:16:18 -0400, monkeys paw mon...@joemoney.net wrote: I have the following acre meter which works for integers, how do i convert this to float? I tried return float ((208.0 * 208.0) * n) def s(n): ... return lambda x: (208 * 208) * n ... f = s(1) f(1) 43264

Re: python as pen and paper substitute

2010-04-07 Thread Manuel Graune
Hello Johan, thanks to you (and everyone else who answered) for your effort. Johan Grönqvist johan.gronqv...@gmail.com writes: Manuel Graune skrev: Manuel Graune manuel.gra...@koeln.de writes: Just as an additional example, let's assume I'd want to add the area of to circles. [...] which

Re: Performance of list vs. set equality operations

2010-04-07 Thread Raymond Hettinger
[Gustavo Nare] In other words: The more different elements two collections have, the faster it is to compare them as sets. And as a consequence, the more equivalent elements two collections have, the faster it is to compare them as lists. Is this correct? If two collections are equal, then

Re: python as pen and paper substitute

2010-04-07 Thread Manuel Graune
Hello Johan, thanks to you (and everyone else who answered) for your effort. Johan Grönqvist johan.gronqv...@gmail.com writes: Manuel Graune skrev: Manuel Graune manuel.gra...@koeln.de writes: Just as an additional example, let's assume I'd want to add the area of to circles. [...] which

+Hi+

2010-04-07 Thread Matt Burson
http://sites.google.com/site/fgu45ythjg/rfea8i -- Matt -- http://mail.python.org/mailman/listinfo/python-list

[Q] raise exception with fake filename and linenumber

2010-04-07 Thread kwatch
Hi all, Is it possible to raise exception with custom traceback to specify file and line? Situation = I'm creating a certain parser. I want to report syntax error with the same format as other exception. Example === parser.py: - 1: def parse(filename): 2:

fcntl, serial ports and serial signals on RS232.

2010-04-07 Thread Max Kotasek
Hello to all out there, I'm trying to figure out how to parse the responses from fcntl.ioctl() calls that modify the serial lines in a way that asserts that the line is now changed. For example I may want to drop RTS explicitly, and assert that the line has been dropped before returning. Here

Re: Recommend Commercial graphing library

2010-04-07 Thread David Bolen
AlienBaby matt.j.war...@gmail.com writes: I'd be grateful for any suggestions / pointers to something useful, Ignoring the commercial vs. open source discussion, although it was a few years ago, I found Chart Director (http://www.advsofteng.com/) to work very well, with plenty of platform and

Re: Impersonating a Different Logon

2010-04-07 Thread David Bolen
Kevin Holleran kdaw...@gmail.com writes: Thanks, I was able to connect to the remote machine. However, how do I query for a very specific key value? I have to scan hundreds of machines and need want to reduce what I am querying. I would like to be able to scan a very specific key and

remote multiprocessing, shared object

2010-04-07 Thread Norm Matloff
Should be a simple question, but I can't seem to make it work from my understanding of the docs. I want to use the multiprocessing module with remote clients, accessing shared lists. I gather one is supposed to use register(), but I don't see exactly how. I'd like to have the clients read and

Regex driving me crazy...

2010-04-07 Thread J
Can someone make me un-crazy? I have a bit of code that right now, looks like this: status = getoutput('smartctl -l selftest /dev/sda').splitlines()[6] status = re.sub(' (?= )(?=([^]*[^]*)*[^]*$)', :,status) print status Basically, it pulls the first actual line of data from the

Re: Regex driving me crazy...

2010-04-07 Thread Grant Edwards
On 2010-04-07, J dreadpiratej...@gmail.com wrote: Can someone make me un-crazy? Definitely. Regex is driving you crazy, so don't use a regex. inputString = # 1 Short offline Completed without error 00% 679 - print ' '.join(inputString.split()[4:-3]) So any

Re: python as pen and paper substitute

2010-04-07 Thread Michael Torrie
On 04/06/2010 12:40 PM, Manuel Graune wrote: Hello everyone, I am looking for ways to use a python file as a substitute for simple pen and paper calculations. At the moment I mainly use a combination of triple-quoted strings, exec and print (Yes, I know it's not exactly elegant). This

order that destructors get called?

2010-04-07 Thread Brendan Miller
I'm used to C++ where destrcutors get called in reverse order of construction like this: { Foo foo; Bar bar; // calls Bar::~Bar() // calls Foo::~Foo() } I'm writing a ctypes wrapper for some native code, and I need to manage some memory. I'm wrapping the memory in a python class

Re: order that destructors get called?

2010-04-07 Thread Stephen Hansen
On 2010-04-07 15:08:14 -0700, Brendan Miller said: When doing this, I noticed some odd behaviour. I had code like this: def delete_my_resource(res): # deletes res class MyClass(object): def __del__(self): delete_my_resource(self.res) o = MyClass() What happens is that as the

Profiling: Interpreting tottime

2010-04-07 Thread Nikolaus Rath
Hello, Consider the following function: def check_s3_refcounts(): Check s3 object reference counts global found_errors log.info('Checking S3 object reference counts...') for (key, refcount) in conn.query(SELECT id, refcount FROM s3_objects): refcount2 =

Re: pass object or use self.object?

2010-04-07 Thread Lie Ryan
On 04/07/10 18:34, Bruno Desthuilliers wrote: Lie Ryan a écrit : (snip) Since in function in python is a first-class object, you can instead do something like: def process(document): # note: document should encapsulate its own logic document.do_one_thing() Obvious case of

help req: installing debugging symbols

2010-04-07 Thread sanam singh
Hi,I am using ununtu 9.10. I want to install a version of Python that was compiled with debug symbols.But if I delete python from ubuntu it would definitely stop working . And python comes preintalled in ubuntu without debugging symbols.How can i install python with debugging symbols

ftp and python

2010-04-07 Thread Matjaz Pfefferer
Hi, I'm Py newbie and I have some beginners problems with ftp handling. What would be the easiest way to copy files from one ftp folder to another without downloading them to local system? Are there any snippets for this task (I couldnt find example like this) Thx

Re: Striving for PEP-8 compliance

2010-04-07 Thread Lawrence D'Oliveiro
In message mailman.1599.1270652040.23598.python-l...@python.org, Tom Evans wrote: I've written a bunch of internal libraries for my company, and they all use two space indents, and I'd like to be more consistent and conform to PEP-8 as much as I can. “A foolish consistency is the hobgoblin

Re: Striving for PEP-8 compliance

2010-04-07 Thread Lawrence D'Oliveiro
In message mailman.1610.1270655932.23598.python-l...@python.org, Gabriel Genellina wrote: If you only reindent the code (without adding/removing lines) then you can compare the compiled .pyc files (excluding the first 8 bytes that contain a magic number and the source file timestamp).

Re: Regex driving me crazy...

2010-04-07 Thread Patrick Maupin
On Apr 7, 4:40 pm, J dreadpiratej...@gmail.com wrote: Can someone make me un-crazy? I have a bit of code that right now, looks like this: status = getoutput('smartctl -l selftest /dev/sda').splitlines()[6]         status = re.sub(' (?= )(?=([^]*[^]*)*[^]*$)', :,status)         print status

Re: Regex driving me crazy...

2010-04-07 Thread Patrick Maupin
On Apr 7, 4:47 pm, Grant Edwards inva...@invalid.invalid wrote: On 2010-04-07, J dreadpiratej...@gmail.com wrote: Can someone make me un-crazy? Definitely.  Regex is driving you crazy, so don't use a regex.   inputString = # 1  Short offline       Completed without error     00%      

Re: help req: installing debugging symbols

2010-04-07 Thread Shashwat Anand
Install python in a different directory, use $prefix for that. Change PATH value accordingly 2010/4/5 sanam singh sanamsi...@hotmail.com Hi, I am using ununtu 9.10. I want to install a version of Python that was compiled with debug symbols. But if I delete python from ubuntu it would

Re: Regex driving me crazy...

2010-04-07 Thread Patrick Maupin
On Apr 7, 7:49 pm, Patrick Maupin pmau...@gmail.com wrote: On Apr 7, 4:40 pm, J dreadpiratej...@gmail.com wrote: Can someone make me un-crazy? I have a bit of code that right now, looks like this: status = getoutput('smartctl -l selftest /dev/sda').splitlines()[6]         status =

Re: Striving for PEP-8 compliance

2010-04-07 Thread Chris Rebert
On Wed, Apr 7, 2010 at 5:35 PM, Lawrence D'Oliveiro @ wrote: In message mailman.1610.1270655932.23598.python-l...@python.org, Gabriel Genellina wrote: If you only reindent the code (without adding/removing lines) then you can compare the compiled .pyc files (excluding the first 8 bytes that

Re: ftp and python

2010-04-07 Thread Tim Chase
Matjaz Pfefferer wrote: What would be the easiest way to copy files from one ftp folder to another without downloading them to local system? As best I can tell, this isn't well-supported by FTP[1] which doesn't seem to have a native copy this file from server-location to server-location

Re: Python and Regular Expressions

2010-04-07 Thread Patrick Maupin
On Apr 7, 3:52 am, Chris Rebert c...@rebertia.com wrote: Regular expressions != Parsers True, but lots of parsers *use* regular expressions in their tokenizers. In fact, if you have a pure Python parser, you can often get huge performance gains by rearranging your code slightly so that you can

Re: Performance of list vs. set equality operations

2010-04-07 Thread Steven D'Aprano
On Wed, 07 Apr 2010 10:55:10 -0700, Raymond Hettinger wrote: [Gustavo Nare] In other words: The more different elements two collections have, the faster it is to compare them as sets. And as a consequence, the more equivalent elements two collections have, the faster it is to compare them as

Re: Performance of list vs. set equality operations

2010-04-07 Thread Patrick Maupin
On Apr 7, 8:41 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Wed, 07 Apr 2010 10:55:10 -0700, Raymond Hettinger wrote: [Gustavo Nare] In other words: The more different elements two collections have, the faster it is to compare them as sets. And as a consequence, the

Re: Regex driving me crazy...

2010-04-07 Thread James Stroud
Patrick Maupin wrote: BTW, although I find it annoying when people say don't do that when that is a perfectly good thing to do, and although I also find it annoying when people tell you what not to do without telling you what *to* do, and although I find the regex solution to this problem to be

Re: Regex driving me crazy...

2010-04-07 Thread Patrick Maupin
On Apr 7, 9:02 pm, James Stroud nospamjstroudmap...@mbi.ucla.edu wrote: Patrick Maupin wrote: BTW, although I find it annoying when people say don't do that when that is a perfectly good thing to do, and although I also find it annoying when people tell you what not to do without telling

Re: Regex driving me crazy...

2010-04-07 Thread Grant Edwards
On 2010-04-08, Patrick Maupin pmau...@gmail.com wrote: On Apr 7, 4:47?pm, Grant Edwards inva...@invalid.invalid wrote: On 2010-04-07, J dreadpiratej...@gmail.com wrote: Can someone make me un-crazy? Definitely. ?Regex is driving you crazy, so don't use a regex. ? inputString = # 1 ?Short

Re: Regex driving me crazy...

2010-04-07 Thread Grant Edwards
On 2010-04-08, James Stroud nospamjstroudmap...@mbi.ucla.edu wrote: Patrick Maupin wrote: BTW, although I find it annoying when people say don't do that when that is a perfectly good thing to do, and although I also find it annoying when people tell you what not to do without telling you what

Re: Regex driving me crazy...

2010-04-07 Thread Patrick Maupin
On Apr 7, 9:36 pm, Grant Edwards inva...@invalid.invalid wrote: On 2010-04-08, Patrick Maupin pmau...@gmail.com wrote: On Apr 7, 4:47?pm, Grant Edwards inva...@invalid.invalid wrote: On 2010-04-07, J dreadpiratej...@gmail.com wrote: Can someone make me un-crazy? Definitely. ?Regex is

Re: Regex driving me crazy...

2010-04-07 Thread Steven D'Aprano
On Wed, 07 Apr 2010 18:03:47 -0700, Patrick Maupin wrote: BTW, although I find it annoying when people say don't do that when that is a perfectly good thing to do, and although I also find it annoying when people tell you what not to do without telling you what *to* do, Grant did give a

Re: Regex driving me crazy...

2010-04-07 Thread J
On Wed, Apr 7, 2010 at 22:45, Patrick Maupin pmau...@gmail.com wrote: When I saw And I am interested in the string that appears in the third column, which changes as the test runs and then completes I assumed that, not only could that string change, but so could the one before it. I guess

Re: Regex driving me crazy...

2010-04-07 Thread Patrick Maupin
On Apr 7, 9:51 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Wed, 07 Apr 2010 18:03:47 -0700, Patrick Maupin wrote: BTW, although I find it annoying when people say don't do that when that is a perfectly good thing to do, and although I also find it annoying when

Re: Tkinter inheritance mess?

2010-04-07 Thread ejetzer
On 5 avr, 22:32, Lie Ryan lie.1...@gmail.com wrote: On 04/06/10 02:38, ejetzer wrote: On 5 avr, 12:36, ejetzer ejet...@gmail.com wrote: For a school project, I'm trying to make a minimalist web browser, and I chose to use Tk as the rendering toolkit. I made my parser classes into

Re: Regex driving me crazy...

2010-04-07 Thread Grant Edwards
On 2010-04-08, Patrick Maupin pmau...@gmail.com wrote: Sorry, my eyes completely missed your one-liner, so my criticism about not posting a solution was unwarranted. I don't think you and I read the problem the same way (which is probably why I didn't notice your solution -- because it

Re: Performance of list vs. set equality operations

2010-04-07 Thread Raymond Hettinger
[Raymond Hettinger] If the two collections have unequal sizes, then both ways immediately return unequal. [Steven D'Aprano] Perhaps I'm misinterpreting what you are saying, but I can't confirm that behaviour, at least not for subclasses of list: For doubters, see list_richcompare() in

Re: Regex driving me crazy...

2010-04-07 Thread Patrick Maupin
On Apr 7, 9:51 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: This is one of the reasons we're so often suspicious of re solutions: s = '# 1  Short offline       Completed without error       00%' tre = Timer(re.split(' {2,}', s), ... import re; from __main__ import s)

Re: [Q] raise exception with fake filename and linenumber

2010-04-07 Thread Gabriel Genellina
En Wed, 07 Apr 2010 17:23:22 -0300, kwatch kwa...@gmail.com escribió: Is it possible to raise exception with custom traceback to specify file and line? I'm creating a certain parser. I want to report syntax error with the same format as other exception. - 1: def

Re: Profiling: Interpreting tottime

2010-04-07 Thread Gabriel Genellina
En Wed, 07 Apr 2010 18:44:39 -0300, Nikolaus Rath nikol...@rath.org escribió: def check_s3_refcounts(): Check s3 object reference counts global found_errors log.info('Checking S3 object reference counts...') for (key, refcount) in conn.query(SELECT id, refcount FROM

Re: Profiling: Interpreting tottime

2010-04-07 Thread Gabriel Genellina
En Wed, 07 Apr 2010 18:44:39 -0300, Nikolaus Rath nikol...@rath.org escribió: def check_s3_refcounts(): Check s3 object reference counts global found_errors log.info('Checking S3 object reference counts...') for (key, refcount) in conn.query(SELECT id, refcount FROM

The Regex Story

2010-04-07 Thread Lie Ryan
On 04/08/10 12:45, Patrick Maupin wrote: (And I got testy because of seeing other IMO unwarranted denigration of re on the list lately.) Why am I seeing a lot of this pattern lately: OP: Got problem with string +- A: Suggested a regex-based solution +- B: Quoted Some people ...

Re: Regex driving me crazy...

2010-04-07 Thread Patrick Maupin
On Apr 7, 9:51 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: BTW, I don't know how you got 'True' here. re.split(' {2,}', s) == [x for x in s.split('  ') if x.strip()] True You must not have s set up to be the string given by the OP. I just realized there was an error in

Re: order that destructors get called?

2010-04-07 Thread Gabriel Genellina
En Wed, 07 Apr 2010 19:08:14 -0300, Brendan Miller catph...@catphive.net escribió: I'm used to C++ where destrcutors get called in reverse order of construction like this: { Foo foo; Bar bar; // calls Bar::~Bar() // calls Foo::~Foo() } That behavior is explicitly

Simple Cookie Script: Not recognising Cookie

2010-04-07 Thread Jimbo
Hi I have a simple Python program that assigns a cookie to a web user when they open the script the 1st time(in an internet browser). If they open the script a second time the script should display the line You have been here 2 times. , if they open the script agai it should show on the webpage

Re: ftp and python

2010-04-07 Thread John Nagle
Tim Chase wrote: Matjaz Pfefferer wrote: What would be the easiest way to copy files from one ftp folder to another without downloading them to local system? As best I can tell, this isn't well-supported by FTP[1] which doesn't seem to have a native copy this file from server-location to

Re: remote multiprocessing, shared object

2010-04-07 Thread Kushal Kumaran
On Thu, Apr 8, 2010 at 3:04 AM, Norm Matloff matl...@doe.com wrote: Should be a simple question, but I can't seem to make it work from my understanding of the docs. I want to use the multiprocessing module with remote clients, accessing shared lists.  I gather one is supposed to use

Re: Regex driving me crazy...

2010-04-07 Thread Kushal Kumaran
On Thu, Apr 8, 2010 at 3:10 AM, J dreadpiratej...@gmail.com wrote: Can someone make me un-crazy? I have a bit of code that right now, looks like this: status = getoutput('smartctl -l selftest /dev/sda').splitlines()[6]        status = re.sub(' (?= )(?=([^]*[^]*)*[^]*$)', :,status)        

[issue4570] Bad example in set tutorial

2010-04-07 Thread Kelda
Changes by Kelda kel...@gmail.com: Removed file: http://bugs.python.org/file16790/datastructures.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4570 ___

[issue7559] TestLoader.loadTestsFromName swallows import errors

2010-04-07 Thread Chris Jerdonek
Chris Jerdonek chris.jerdo...@gmail.com added the comment: Rietveld link: http://codereview.appspot.com/810044/show This patch changes unittest.TestLoader.loadTestsFromName() so that ImportErrors will bubble up when importing from a module with a bad import statement. Before the method

[issue7301] Add environment variable $PYTHONWARNINGS

2010-04-07 Thread Philip Jenvey
Philip Jenvey pjen...@underboss.org added the comment: I committed a somewhat different version of this patch to py3k to handle the warn options now calling for wchars, but this needs more work. Some of the buildbots are unhappy Seems like the py3k version either needs to fully decode the env

[issue8327] unintuitive behaviour of logging message propagation

2010-04-07 Thread Pascal Chambon
Pascal Chambon chambon.pas...@gmail.com added the comment: Thanks for the doc patch, if you don't mind I'd just add the paragraph below too, to clarify the fact that logger levels are only entry points levels, ignored he rest of the time. There might be slight redundancies with the rest of

[issue8271] str.decode('utf8', 'replace') -- conformance with Unicode 5.2.0

2010-04-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: STINNER Victor wrote: STINNER Victor victor.stin...@haypocalc.com added the comment: I also found out that, according to RFC 3629, surrogates are considered invalid and they can't be encoded/decoded, but the UTF-8 codec actually

[issue8271] str.decode('utf8', 'replace') -- conformance with Unicode 5.2.0

2010-04-07 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: I also found out that, according to RFC 3629, surrogates are considered invalid and they can't be encoded/decoded, but the UTF-8 codec actually does it. Python2 does, but Python3 raises an error. (...) I wonder how

[issue8332] regrtest single TestClass/test_method

2010-04-07 Thread anatoly techtonik
New submission from anatoly techtonik techto...@gmail.com: It would be convenient for debug to execute single test_method or TestClass. Running all tests in file can take a long time. -- components: Tests messages: 102524 nosy: techtonik severity: normal status: open title: regrtest

[issue8332] regrtest single TestClass/test_method

2010-04-07 Thread anatoly techtonik
anatoly techtonik techto...@gmail.com added the comment: regrtest [options] test_file.TestClass regrtest [options] test_file.test_method -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8332

[issue4026] fcntl extension fails to build on AIX 6.1

2010-04-07 Thread Michael Haubenwallner
Michael Haubenwallner michael.haubenwall...@salomon.at added the comment: This very same problem happens (with Python-2.6.2) on AIX5.3 now too, after upgrading to: $ oslevel -s 5300-08-09-1013 Unlike before (comparing with old build logs), this AIX5.3 now provides flock() in sys/file.h and

[issue8331] a documentation grammar fix in logging module

2010-04-07 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: Fix checked into trunk (r79888). -- resolution: accepted - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8331

[issue8314] test_ctypes fails in test_ulonglong on sparc buildbots

2010-04-07 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: It's surprising that test_ulonglong fails, while test_longlong passes: can the Linux Sparc ABI really be treating these two types differently? Maybe more information could be gained by supplying a more interesting test value than 42---some

  1   2   >