Re: a little parsing challenge ☺

2011-07-19 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: with open(os.path.join(dirpath, name), 'r') as f: SHOULD be with open(os.path.join(dirpath, name), 'rb') as f: (as in the original), else the some code units might not be read properly. -- PointedEars Bitte keine Kopien per E-Mail. /

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-19 Thread Thomas 'PointedEars' Lahn
Steven D'Aprano wrote: Nulpum wrote: I want to make sure that folder exists. '2011-07-03' is really exists. but 'os.path.isdir' say false Does anyone know why? Yes. print logs/2011-07-03 logs/2011-07-03 print logs\2011-07-03 logs�1-07-03 Don't use backslashes as path

Re: Partial Function Application -- Advantages over normal function?

2011-07-19 Thread Thomas Jollans
On 19/07/11 00:33, Thomas 'PointedEars' Lahn wrote: Thomas 'PointedEars' Lahn wrote: Dave Angel wrote: On 01/-10/-28163 02:59 PM, Terry Reedy wrote: def makeadder(y) def _add(x): return x+y add2 = makeadder(2) A couple of typos in that code: def makeaddr(y): def _add(x):

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-19 Thread Thomas Jollans
On 19/07/11 06:42, Steven D'Aprano wrote: Nulpum wrote: I want to make sure that folder exists. '2011-07-03' is really exists. but 'os.path.isdir' say false Does anyone know why? Yes. print logs/2011-07-03 logs/2011-07-03 print logs\2011-07-03 logs�1-07-03 Don't use backslashes

Re: list(), tuple() should not place at Built-in functions in documentation

2011-07-19 Thread Raymond Hettinger
On Jul 14, 6:21 pm, Inside fancheyuj...@gmail.com wrote: As telling in the subject,because list and tuple aren't functions,they are types.Is that right? list() and tuple() are in the right place in the documentation because they would be harder to find if listed elsewhere. Tools like str(),

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-19 Thread Nulpum
On Jul 19, 1:42 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: Nulpum wrote: I want to make sure that folder exists. '2011-07-03' is really exists. but 'os.path.isdir' say false Does anyone know why? Yes. print logs/2011-07-03 logs/2011-07-03 print

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-19 Thread Steven D'Aprano
Thomas Jollans wrote: On 19/07/11 06:42, Steven D'Aprano wrote: (1) Escape every backslash with an extra backslash: print logs\\2011-07-03 logs\2011-07-03 There is a more elegant solution: use raw strings: r'c:\foo\bar' Well, perhaps, but not all paths can be written as a raw string:

Re: Partial Function Application -- Advantages over normal function?

2011-07-19 Thread Kurian Thayil
On Tue, Jul 19, 2011 at 11:52 AM, Thomas Jollans t...@jollybox.de wrote: On 19/07/11 00:33, Thomas 'PointedEars' Lahn wrote: Thomas 'PointedEars' Lahn wrote: Dave Angel wrote: On 01/-10/-28163 02:59 PM, Terry Reedy wrote: def makeadder(y) def _add(x): return x+y add2 =

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-19 Thread Changjun
On 7월19일, 오후3시15분, Thomas 'PointedEars' Lahn pointede...@web.de wrote: Steven D'Aprano wrote: Nulpum wrote: I want to make sure that folder exists. '2011-07-03' is really exists. but 'os.path.isdir' say false Does anyone know why? Yes. print logs/2011-07-03 logs/2011-07-03

TestFixtures 1.10.0 Released!

2011-07-19 Thread Chris Withers
Hi All, I'm happy to announce a new release of TestFixtures with the following changes: - Removed the dependency on zope.dottedname. - Implement the ability to mock out dict and list items using testfixtures.Replacer and testfixtures.replace. - Implement the ability to remove attributes

TAMIL ACTRESS HOT PHOTOS VIDEOS

2011-07-19 Thread SAHITHI
FOR GOOD JOBS SITES TO YOU http://goodjobssites.blogspot.com/ FOR HOT PHOTOVIDEOS KATRINA KAIF RARE PHOTOS http://southactresstou.blogspot.com/2011/07/katrina-kaif-wallpapers.html

Re: a little parsing challenge ☺

2011-07-19 Thread Xah Lee
On Jul 18, 7:07 pm, Billy Mays no...@nohow.com wrote: On 7/18/2011 7:56 PM, Steven D'Aprano wrote: Billy Mays wrote: On 07/17/2011 03:47 AM, Xah Lee wrote: 2011-07-16 I gave it a shot.  It doesn't do any of the Unicode delims, because let's face it, Unicode is for goobers.

Re: TestFixtures 1.10.0 Released!

2011-07-19 Thread Chris Withers
Hmm, might have been helpful to include docs for these new bits: On 19/07/2011 09:36, Chris Withers wrote: - Implement the ability to mock out dict and list items using testfixtures.Replacer and testfixtures.replace. - Implement the ability to remove attributes and dict items using

Re: find max and min values from a column of a csv file

2011-07-19 Thread prakash jp
Thanks for the suggestions. Felt the thread could be of help on consolidating the solution. *Max Value from a csv column:* import numpy data1 = numpy.genfromtxt(data.csv,dtype='float',delimiter = ',',skiprows=1, skip_header=0, skip_footer=0, usecols=11,usemask=True)

How to iterate through two dicts efficiently

2011-07-19 Thread J
Hello, I am looking to improve the performance of the following piece of Python code:- for cc in StatusContainer: for srv in StatusContainer[cc]: for id in StatusContainer[cc][srv]['RECV']: if id in StageContainer['13']:

The following modules appear to be missing - py2exe

2011-07-19 Thread Peter Irbizon
Hello, please I have problem with The following modules appear to be missing message during compiling my app exe file with py2exe. What should I do with this? Many thanks in advance. The following modules appear to be missing ['Carbon', 'Carbon.Files', '_scproxy', 'fixedpoint', 'gdk', 'mx',

The following modules appear to be missing - py2exe

2011-07-19 Thread miamia
Hello, please I have problem with The following modules appear to be missing message during compiling my app exe file with py2exe. What should I do with this? Many thanks in advance. The following modules appear to be missing ['Carbon', 'Carbon.Files', '_scproxy', 'fixedpoint', 'gdk', 'mx',

Re: Re: Partial Function Application -- Advantages over normal function?

2011-07-19 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Thomas 'PointedEars' Lahn wrote: Dave Angel wrote: On 01/-10/-28163 02:59 PM, Terry Reedy wrote: def makeadder(y) def _add(x): return x+y add2 = makeadder(2) A couple of typos in that code: def makeaddr(y): def _add(x): return x+y return _add I

Stopwatch - pause counter

2011-07-19 Thread Morten Klim
Hello everyone! I've started developing a little application for one of my friends, which he will use at work to measure his hours working + the time he has breaks. I wanna do this in python cause, I just started with this language and wanna get more fimiliar with it. Sometimes though, it's a bit

Re: How to iterate through two dicts efficiently

2011-07-19 Thread Peter Otten
J wrote: I am looking to improve the performance of the following piece of Python code:- for cc in StatusContainer: for srv in StatusContainer[cc]: for id in StatusContainer[cc][srv]['RECV']: if id in StageContainer['13']:

Re: The following modules appear to be missing - py2exe

2011-07-19 Thread Noon Silk
On Tue, Jul 19, 2011 at 7:47 PM, Peter Irbizon peterirbi...@gmail.com wrote: Hello, please I have problem with The following modules appear to be missing message during compiling my app exe file with py2exe. What should I do with this? Many thanks in advance. The following modules appear to

Re: How to iterate through two dicts efficiently

2011-07-19 Thread Tim Chase
On 07/19/2011 04:36 AM, J wrote: Someone in a different forum suggested that I use 'binary search' to iterate through the dictionaries I'm not sure what they were smoking...a binary search is useful for finding a thing in a sorted list. It looks like your data is not sorted (strike #1) and

Re: How to iterate through two dicts efficiently

2011-07-19 Thread Dave Angel
On 01/-10/-28163 02:59 PM, J wrote: Hello, I am looking to improve the performance of the following piece of Python code:- for cc in StatusContainer: for srv in StatusContainer[cc]: for id in StatusContainer[cc][srv]['RECV']: if id in

Re: The following modules appear to be missing - py2exe

2011-07-19 Thread miamia
On Jul 19, 1:13 pm, Noon Silk noonsli...@gmail.com wrote: On Tue, Jul 19, 2011 at 7:47 PM, Peter Irbizon peterirbi...@gmail.com wrote: Hello, please I have problem with The following modules appear to be missing message during compiling my app exe file with py2exe. What should I do with

Return and set

2011-07-19 Thread Billy Mays
I have a method getToken() which checks to see if a value is set, and if so, return it. However, it doesn't feel pythonic to me: def getToken(self): if self.tok: t = self.tok self.tok = None return t # ... Is there a way to trim the 'if' block to reset

(Maybe off topic) Can someone explain what a finite state machine is?

2011-07-19 Thread Matty Sarro
Hey everyone. I am currently reading through an RFC, and it mentions that a client and server half of a transaction are embodied by finite state machines. I am reading through the wikipedia article for finite state machines, and sadly it's going a bit above my head. I don't really have a

Re: Return and set

2011-07-19 Thread Paul Woolcock
I don't know if this is better (or more pythonic), but it works for me on python 2.7. class MyKlass(object): ... def __init__(self, tok): ... self.tok = tok ... def gettoken(self): ... t, self.tok = self.tok or None, None ... return t On Tue, Jul 19, 2011 at 9:23

Re: (Maybe off topic) Can someone explain what a finite state machine is?

2011-07-19 Thread Chris Angelico
On Tue, Jul 19, 2011 at 11:32 PM, Matty Sarro msa...@gmail.com wrote: Hey everyone. I am currently reading through an RFC, and it mentions that a client and server half of a transaction are embodied by finite state machines. I am reading through the wikipedia article for finite state machines,

Re: Return and set

2011-07-19 Thread Ben Finney
Billy Mays 81282ed9a88799d21e77957df2d84bd6514d9...@myhashismyemail.com writes: I have a method getToken() which checks to see if a value is set, and if so, return it. However, it doesn't feel pythonic to me: Clearly that's because the function name is not Pythonic :-) I'll assume the name is

Re: Return and set

2011-07-19 Thread Billy Mays
On 07/19/2011 09:43 AM, Ben Finney wrote: Billy Mays 81282ed9a88799d21e77957df2d84bd6514d9...@myhashismyemail.com writes: I have a method getToken() which checks to see if a value is set, and if so, return it. However, it doesn't feel pythonic to me: Clearly that's because the function name

Re: Recommendations for household finance scripting?

2011-07-19 Thread TheSaint
markolopa wrote: I would like to find a good system to keep track of my household finance. Do Python programmers have suggestions on that? Do you use Python to help on this task? libreOffice doesn't do it? -- http://mail.python.org/mailman/listinfo/python-list

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-19 Thread Ethan Furman
Steven D'Aprano wrote: Thomas Jollans wrote: The correct solution in many cases is to not assume any particular path separator at all, and use os.path.join when dealing with paths. This will work even on systems that do not accept forward slashes as path separators. (does Python still support

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-19 Thread Grant Edwards
On 2011-07-19, Nulpum changjun@gmail.com wrote: I want to make sure that folder exists. '2011-07-03' is really exists. but 'os.path.isdir' say false Does anyone know why? os.path.isdir(C:\Users\??\Desktop\logs) True os.path.isdir(C:\Users\??\Desktop\logs\2011-07-03) False

Re: How to iterate through two dicts efficiently

2011-07-19 Thread J
Hi guys, Thank you for your suggestions. I have managed to get my whole script to execute in under 10 seconds by changing the 'for loop' I posted above to the following:- for opco in Cn: for service in Cn[opco]: ack = set(Cn[opco][service]['RECV']) set(Pr['13'])

Re: (Maybe off topic) Can someone explain what a finite state machine is?

2011-07-19 Thread Abhijeet Mahagaonkar
You might wanna have a look at theory of computation. http://www.youtube.com/user/Coderisland#g/c/601FC994BDD963E4 in this lecture series you will have an explanation for FSM from the ground up -AB On Tue, Jul 19, 2011 at 7:02 PM, Matty Sarro msa...@gmail.com wrote: Hey everyone. I am

Re: list(), tuple() should not place at Built-in functions in documentation

2011-07-19 Thread Terry Reedy
On 7/19/2011 2:52 AM, Raymond Hettinger wrote: On Jul 14, 6:21 pm, Insidefancheyuj...@gmail.com wrote: As telling in the subject,because list and tuple aren't functions,they are types.Is that right? They are not instances of a class whose definition name includes the word 'Function'. They

Re: The following modules appear to be missing - py2exe

2011-07-19 Thread Terry Reedy
On 7/19/2011 5:47 AM, Peter Irbizon wrote: Hello, please I have problem with The following modules appear to be missing message during compiling my app exe file with py2exe. What should I do with this? Many thanks in advance. From the stuff below, you appear to be compiling for Windows. The

Re: Partial Function Application -- Advantages over normal function?

2011-07-19 Thread Ian Kelly
On Tue, Jul 19, 2011 at 12:22 AM, Thomas Jollans t...@jollybox.de wrote: Supplemental: The above can be simplified to def makeadder(y): return lambda x: x + y In turn: makeadder = lambda y: lambda x: x + y That's not an improvement. lambda is for making anonymous functions. If you're

Re: Partial Function Application -- Advantages over normal function?

2011-07-19 Thread Terry Reedy
On 7/19/2011 6:07 AM, Dave Angel wrote: On 01/-10/-28163 02:59 PM, Thomas 'PointedEars' Lahn wrote: Dave Angel wrote: On 01/-10/-28163 02:59 PM, Terry Reedy wrote: def makeadder(y) def _add(x): return x+y add2 = makeadder(2) A couple of typos in that code: def makeaddr(y): def _add(x):

Re: Partial Function Application -- Advantages over normal function?

2011-07-19 Thread Thomas Jollans
On 19/07/11 18:49, Ian Kelly wrote: On Tue, Jul 19, 2011 at 12:22 AM, Thomas Jollans t...@jollybox.de wrote: Supplemental: The above can be simplified to def makeadder(y): return lambda x: x + y In turn: makeadder = lambda y: lambda x: x + y That's not an improvement. lambda is for

Re: Return and set

2011-07-19 Thread Terry Reedy
On 7/19/2011 9:52 AM, Billy Mays wrote: On 07/19/2011 09:43 AM, Ben Finney wrote: Billy Mays 81282ed9a88799d21e77957df2d84bd6514d9...@myhashismyemail.com writes: I have a method getToken() which checks to see if a value is set, and if so, return it. However, it doesn't feel pythonic to me:

Re: Return and set

2011-07-19 Thread Micah
That sounds artificially backwards; why not let getToken() reuse peekToken()? def peek(self): if self.tok is None: try: self.tok = self.gen.next() except StopIteration: self.tok = NULL return self.tok def pop(self): token = self.peek()

Re: a little parsing challenge ☺

2011-07-19 Thread Xah Lee
On Sunday, July 17, 2011 2:48:42 AM UTC-7, Raymond Hettinger wrote: On Jul 17, 12:47 am, Xah Lee xah...@gmail.com wrote: i hope you'll participate. Just post solution here. Thanks. http://pastebin.com/7hU20NNL just installed py3. there seems to be a bug. in this file

Re: Return and set

2011-07-19 Thread Billy Mays
On 07/19/2011 01:00 PM, Micah wrote: That sounds artificially backwards; why not let getToken() reuse peekToken()? def peek(self): if self.tok is None: try: self.tok = self.gen.next() except StopIteration: self.tok = NULL return self.tok

Re: a little parsing challenge ☺

2011-07-19 Thread Xah Lee
On Jul 18, 10:12 am, Billy Mays 81282ed9a88799d21e77957df2d84bd6514d9...@myhashismyemail.com wrote: On 07/17/2011 03:47 AM,XahLee wrote: 2011-07-16 I gave it a shot.  It doesn't do any of the Unicode delims, because let's face it, Unicode is for goobers. import sys, os pairs =

Re: Partial Function Application -- Advantages over normal function?

2011-07-19 Thread Ian Kelly
On Tue, Jul 19, 2011 at 10:58 AM, Thomas Jollans t...@jollybox.de wrote: No, it's not an improvement. It's an illustration. I get that. The difference I pointed out between your simplification and the other Thomas's is the reason why yours would be unpythonic whilst his is fine. --

Re: Return and set

2011-07-19 Thread Billy Mays
On 07/19/2011 01:02 PM, Terry Reedy wrote: You did not answer Ben's question about the allowed values of self.tok and whether you really want to clobber all 'false' values. The proper code depends on that answer. NULL is an enumerated value I have defined above. The idea is for peekToken to

Re: How to iterate through two dicts efficiently

2011-07-19 Thread Chris Rebert
On Tue, Jul 19, 2011 at 7:20 AM, J jnr.gonza...@googlemail.com wrote: Hi guys, Thank you for your suggestions.  I have managed to get my whole script to execute in under 10 seconds by changing the 'for loop' I posted above to the following:- for opco in Cn:        for service in

Re: a little parsing challenge ☺

2011-07-19 Thread Xah Lee
On Jul 18, 2:59 pm, Thomas 'PointedEars' Lahn pointede...@web.de wrote: Ian Kelly wrote: Billy Mays wrote: I gave it a shot.  It doesn't do any of the Unicode delims, because let's face it, Unicode is for goobers. Uh, okay... Your script also misses the requirement of outputting the

Re: a little parsing challenge ☺

2011-07-19 Thread Billy Mays
On 07/19/2011 01:14 PM, Xah Lee wrote: I added other unicode brackets to your list of brackets, but it seems your code still fail to catch a file that has mismatched curly quotes. (e.g.http://xahlee.org/p/time_machine/tm-ch04.html ) LOL Billy. Xah I suspect its due to the file mode being

Re: (Maybe off topic) Can someone explain what a finite state machine is?

2011-07-19 Thread Terry Reedy
On 7/19/2011 9:32 AM, Matty Sarro wrote: Hey everyone. I am currently reading through an RFC, and it mentions that a client and server half of a transaction are embodied by finite state machines. I am reading through the wikipedia article for finite That was going to be my first suggestion,

Re: a little parsing challenge ☺

2011-07-19 Thread Xah Lee
On Jul 17, 8:31 am, Thomas Jollans t...@jollybox.de wrote: On Jul 17, 9:47 am,XahLee xah...@gmail.com wrote: 2011-07-16 folks, this one will be interesting one. the problem is to write a script that can check a dir of text files (and all subdirs) and reports if a file has any

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-19 Thread Terry Reedy
On 7/19/2011 2:15 AM, Thomas 'PointedEars' Lahn wrote: Steven D'Aprano wrote: Nulpum wrote: I want to make sure that folder exists. '2011-07-03' is really exists. but 'os.path.isdir' say false Does anyone know why? Yes. print logs/2011-07-03 logs/2011-07-03 print logs\2011-07-03

Re: a little parsing challenge ☺

2011-07-19 Thread Thomas Jollans
On 19/07/11 18:54, Xah Lee wrote: On Sunday, July 17, 2011 2:48:42 AM UTC-7, Raymond Hettinger wrote: On Jul 17, 12:47 am, Xah Lee xah...@gmail.com wrote: i hope you'll participate. Just post solution here. Thanks. http://pastebin.com/7hU20NNL just installed py3. there seems to be a bug.

Re: a little parsing challenge ☺

2011-07-19 Thread Ian Kelly
On Tue, Jul 19, 2011 at 10:54 AM, Xah Lee xah...@gmail.com wrote: On Sunday, July 17, 2011 2:48:42 AM UTC-7, Raymond Hettinger wrote: On Jul 17, 12:47 am, Xah Lee xah...@gmail.com wrote: i hope you'll participate. Just post solution here. Thanks. http://pastebin.com/7hU20NNL just installed

Re: a little parsing challenge ☺

2011-07-19 Thread Thomas Jollans
On 19/07/11 19:49, Xah Lee wrote: On Jul 17, 8:31 am, Thomas Jollans t...@jollybox.de wrote: I thought I'd have some fun with multi-processing: https://gist.github.com/1087682 hi Thomas. I ran the program, all cpu went max (i have a quad), but after i think 3 minutes nothing happens, so i

Re: a little parsing challenge ☺

2011-07-19 Thread Xah Lee
On Jul 19, 10:33 am, Billy Mays 81282ed9a88799d21e77957df2d84bd6514d9...@myhashismyemail.com wrote: On 07/19/2011 01:14 PM,XahLee wrote: I added other unicode brackets to your list of brackets, but it seems your code still fail to catch a file that has mismatched curly quotes.

Re: a little parsing challenge ☺

2011-07-19 Thread Thomas Jollans
Oh, by the way: On 19/07/11 19:49, Xah Lee wrote: I ran the program, all cpu went max Mission accomplished. -- http://mail.python.org/mailman/listinfo/python-list

Saving changes to path

2011-07-19 Thread Chess Club
Hello, I used sys.path.append() to add to the path directory, but the changes made are not saved when I exit the compiler. Is there a way to save it? Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Saving changes to path

2011-07-19 Thread Billy Mays
On 07/19/2011 02:24 PM, Chess Club wrote: Hello, I used sys.path.append() to add to the path directory, but the changes made are not saved when I exit the compiler. Is there a way to save it? Thank you. Since python is running in a child process, it only affects its own environment

Re: (Maybe off topic) Can someone explain what a finite state machine is?

2011-07-19 Thread Michael Brown
On 2011-07-19, Matty Sarro wrote: Hey everyone. I am currently reading through an RFC, and it mentions that a client and server half of a transaction are embodied by finite state machines. I am reading through the wikipedia article for finite state machines, and sadly it's going a bit above

Re: Stopwatch - pause counter

2011-07-19 Thread Terry Reedy
On 7/19/2011 6:41 AM, Morten Klim wrote: Hello everyone! I've started developing a little application for one of my friends, which he will use at work to measure his hours working + the time he has breaks. I wanna do this in python cause, I just started with this language and wanna get more

Re: Saving changes to path

2011-07-19 Thread Ethan Furman
Chess Club wrote: Hello, I used sys.path.append() to add to the path directory, but the changes made are not saved when I exit the compiler. Is there a way to save it? Do you mean saved as in your PATH environment variable is now changed? This would be bad. Not sure about *nix, but on M$

Debugging cookielib.CookieJar

2011-07-19 Thread Roy Smith
I've got a unit test suite which instantiates an HTTP client to test our server. We depend on session cookies. To handle this, I've got: def setUp(self): self.cj = cookielib.CookieJar() self.opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.cj)) This works fine

Re: a little parsing challenge ☺

2011-07-19 Thread Terry Reedy
On 7/19/2011 2:12 PM, Xah Lee wrote: Also, you may have answered this earlier but I'll ask again anyways: You ask for the first mismatched pair, Are you referring to the inner most mismatched, or the outermost? For example, suppose you have this file: foo[(])bar Would the ( be the first

Re: Python ++ Operator?

2011-07-19 Thread Chris Torek
In article mailman.1057.1310717193.1164.python-l...@python.org Chris Angelico ros...@gmail.com wrote: I agree that [C's ++ operators are] often confusing (i+j) ... For what it is worth, this has to be written as: i++ + ++j /* or i+++ ++j */ or similar (e.g., newline after the middle +

Re: Return and set

2011-07-19 Thread Terry Reedy
On 7/19/2011 1:00 PM, Micah wrote: That sounds artificially backwards; why not let getToken() reuse peekToken()? def peek(self): if self.tok is None: try: self.tok = self.gen.next() If this is changed (as intended for the iteration protocol) to

Re: Debugging cookielib.CookieJar

2011-07-19 Thread Roy Smith
Ah, never mind. I found cookielib.debug = True, which told me exactly what I needed to know. I did indeed have a hostname problem. -- http://mail.python.org/mailman/listinfo/python-list

Re: Stopwatch - pause counter

2011-07-19 Thread Morten Klim
Well that's exactly the problem. My attempt to make this work, made the counter go crazy and didn't care if it was paused or not. So for this for work properly, remove following: def _updatepause(self): self._elapsedpause = time.time() - self._pausestart

Re: Stopwatch - pause counter

2011-07-19 Thread Morten Klim
On Jul 19, 8:55 pm, Terry Reedy tjre...@udel.edu wrote: On 7/19/2011 6:41 AM, Morten Klim wrote: Hello everyone! I've started developing a little application for one of my friends, which he will use at work to measure his hours working + the time he has breaks. I wanna do this in

turtles slowing down

2011-07-19 Thread EricC
Hi, I am a newbie - I have been teaching myself Python 3 since a few months ago. My “self assignments” include some purely for fun. Among them was using the turtle module to have multiple turtles running around on the screen. Recently one such fun turtle “project” showed strange behavior that I

Re: can I distribute Microsoft.VC90.CRT files?

2011-07-19 Thread Chaz
On Jun 27, 1:29 pm, J.O. Aho u...@example.net wrote: miamia wrote: hello, I find out that my program needs Microsoft.VC90.CRT.manifest,msvcm90.dll,msvcp90.dll,msvcr90.dll files when I want to run it on  win 64bit systems. I find these files in some other software. Can I simply take

Re: can I distribute Microsoft.VC90.CRT files?

2011-07-19 Thread Ross Ridge
J.O. Aho u...@example.net wrote: Read the EULA that comes with Microsoft Visual C++ Redistributable Package. Chaz chaz.littlej...@gmail.com wrote: PLEASE RESPOND WITH AN ANSWER NEXT TIME READ THE EULA THAT COMES WITH THE MICROSOFT VISUAL C++ REDISTRIBUTABLE PACKAGE. I hope that helps.

How to get number of bytes written to nonblocking FIFO when EAGAIN is raised?

2011-07-19 Thread Aaron Staley
Scenario. I have a fifo named 'fifo' on my computer (ubuntu linux) operating in nonblocking mode for both read and write. Under normal operation all is good: Interpreter 1 (writer) import os fd = os.open('fifo', os.O_WRONLY | os.O_NONBLOCK) f = os.fdopen(fd,'wb') f.write('k') f.flush()

I am fed up with Python GUI toolkits...

2011-07-19 Thread sturlamolden
What is wrong with them: 1. Designed for other languages, particularly C++, tcl and Java. 2. Bloatware. Qt and wxWidgets are C++ application frameworks. (Python has a standard library!) 3. Unpythonic memory management: Python references to deleted C++ objects (PyQt). Manual dialog destruction

Re: How to get number of bytes written to nonblocking FIFO when EAGAIN is raised?

2011-07-19 Thread Roy Smith
In article 40996f2a-4ed8-4388-ae1a-6f81f57a4...@f17g2000prf.googlegroups.com, Aaron Staley usaa...@gmail.com wrote: Scenario. I have a fifo named 'fifo' on my computer (ubuntu linux) operating in nonblocking mode for both read and write. Under normal operation all is good: Interpreter 1

Re: turtles slowing down

2011-07-19 Thread Terry Reedy
On 7/19/2011 6:02 PM, EricC wrote: Hi, I am a newbie - I have been teaching myself Python 3 since a few months ago. My “self assignments” include some purely for fun. Among them was using the turtle module to have multiple turtles running around on the screen. Recently one such fun turtle

Re: I am fed up with Python GUI toolkits...

2011-07-19 Thread Terry Reedy
On 7/19/2011 10:12 PM, sturlamolden wrote: What is wrong with them: 1. Designed for other languages, particularly C++, tcl and Java. 2. Bloatware. Qt and wxWidgets are C++ application frameworks. (Python has a standard library!) 3. Unpythonic memory management: Python references to deleted

Re: I am fed up with Python GUI toolkits...

2011-07-19 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 There's PyGUI, which, at a glance, fits whit what you want. Looks like it uses OpenGL and native GUI facilities. http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ It has quite a few external dependencies, though (different dependencies for

Re: I am fed up with Python GUI toolkits...

2011-07-19 Thread Kevin Walzer
OK, I'll bite... On 7/19/11 10:12 PM, sturlamolden wrote: 1. Designed for other languages, particularly C++, tcl and Java. So? Doing a GUI toolkit is a hard project. 2. Bloatware. Qt and wxWidgets are C++ application frameworks. (Python has a standard library!) Again, so? This isn't

Re: How to get number of bytes written to nonblocking FIFO when EAGAIN is raised?

2011-07-19 Thread Adam Skutt
On Jul 19, 9:19 pm, Aaron Staley usaa...@gmail.com wrote: However, if interpreter 1 overfills the FIFO, we get an error (EAGAIN) f.write('a'*7) IOError: [Errno 11] Resource temporarily unavailable However interpreter 2 still receives data len(f.read()) 65536 It looks like

Pythonic way with more than one max possible

2011-07-19 Thread CM
I have three items in a dict, like this: the_dict = {'a':1, 'b':2, 'c':3} but the vals could be anything. I want to configure something else based on the winner of such a dict, with these rules: 1. In this dict, if there is a UNIQUE max value, that's the winner. 2. If there are any TIES for

Re: Pythonic way with more than one max possible

2011-07-19 Thread Steven D'Aprano
On Wed, 20 Jul 2011 01:17 pm CM wrote: I have three items in a dict, like this: the_dict = {'a':1, 'b':2, 'c':3} but the vals could be anything. I want to configure something else based on the winner of such a dict, with these rules: 1. In this dict, if there is a UNIQUE max value,

Re: I am fed up with Python GUI toolkits...

2011-07-19 Thread Steven D'Aprano
On Wed, 20 Jul 2011 12:12 pm sturlamolden wrote: What is wrong with them: [...] 4. They might look bad (Tkinter, Swing with Jython). Have you tried Tkinter version 8.0 or better, which offers a native look and feel? 5. All projects to write a Python GUI toolkit die before they are

Re: Pythonic way with more than one max possible

2011-07-19 Thread Chris Rebert
On Tue, Jul 19, 2011 at 8:17 PM, CM cmpyt...@gmail.com wrote: I have three items in a dict, like this: the_dict = {'a':1, 'b':2, 'c':3} but the vals could be anything.  I want to configure something else based on the winner of such a dict, with these rules: 1. In this dict, if there is a

Re: Pythonic way with more than one max possible

2011-07-19 Thread CM
On Jul 19, 11:17 pm, CM cmpyt...@gmail.com wrote: I have three items in a dict, like this: the_dict = {'a':1, 'b':2, 'c':3} but the vals could be anything.  I want to configure something else based on the winner of such a dict, with these rules: 1. In this dict, if there is a UNIQUE max

Re: Pythonic way with more than one max possible

2011-07-19 Thread woooee
1. In this dict, if there is a UNIQUE max value, then its *key* is the winner. 2. If there are any TIES for max value, then the *key* 'b' is the winner by default. This will store the max value(s) in a list. In case of a tie, you can take the first value in the list, but it may be different

[issue12434] Strengthen 2.7 io types warning

2011-07-19 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: Yes, that would be great. It is better than my initial suggestion. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12434 ___

[issue12581] Increased test coverage of test_urlparse

2011-07-19 Thread Petter Haggholm
Petter Haggholm pet...@petterhaggholm.net added the comment: It’s my pleasure — it’s very trivial, but hopefully it’ll get my feet wet and get me in a place where I am familiar enough with procedures and things to contribute something relevant. :) Attaching a modified patch with (1) reversion

[issue12581] Increased test coverage of test_urlparse

2011-07-19 Thread Senthil Kumaran
Senthil Kumaran sent...@uthcode.com added the comment: Hi Petter, writing tests are ofcourse a good way to start. As long as the tests increase the coverage, those are most welcome. Thanks! -- assignee: - orsenthil ___ Python tracker

[issue12372] semaphore errors on AIX 7.1

2011-07-19 Thread Sébastien Sablé
Sébastien Sablé sa...@users.sourceforge.net added the comment: Hi, sorry for the late reply. STINNER Victor added the comment: At least, I would like to know if Sébastien Sablé (the author of the original patch) changed his opinion about this issue since 2007 ;-) I haven't changed my

[issue12546] builtin __format__ methods cannot fill with \x00 char

2011-07-19 Thread Eric V. Smith
Eric V. Smith e...@trueblade.com added the comment: I finally got around to reviewing the patch. A couple of comments: 1. There should be some tests for str.__format__, not just str.format. This is really a bug with str.__format__, after all. I can add those. 2. The bigger issue is that the

[issue10881] test_site and macframework builds fails

2011-07-19 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: I'd like to reopen this, as it doesn't seem to be a duplicate of #8084. Specifically, test_getsitepackages in test_sitepackages appears to be wrong, since it has a correct test for platform builds later in the method, but the failure

[issue12543] `issubclass(collections.deque, collections.Sequence) == False`

2011-07-19 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: The sequence ABCs do not require slicing support. Understood, but is it said in the docs? David said that he couldn’t find that bit of info, which is why I suggested a doc bug. -- ___ Python tracker

[issue11877] Change os.fsync() to support physical backing store syncs

2011-07-19 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: Here is something unsorted and loose: - @neologix: One could argue that something had happened before the fsync(2), so that code which blindly did so is too dumb to do any right decision anyway. Even PEP 3151 won't help. -

[issue6721] Locks in python standard library should be sanitized on fork

2011-07-19 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: If Nir's analysis is right, and Antoines comment pushes me into this direction, (i personally have not looked at that code), then multiprocessing is completely brain-damaged and has been implemented by a moron. And yes, I know this

[issue3232] Wrong str-bytes conversion in Lib/encodings/idna.py

2011-07-19 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3232 ___ ___ Python-bugs-list

[issue6721] Locks in python standard library should be sanitized on fork

2011-07-19 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: Um, and just to add: i'm not watching out for anything, and it won't and it can't be me: ?0%0[steffen@sherwood sys]$ grep -F smp CHANGELOG.svn -B3 | grep -E '^r[[:digit:]]+' | tail -n 1 r162 | steffen | 2006-01-18 18:29:58 +0100

[issue12575] add a AST validator

2011-07-19 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12575 ___ ___ Python-bugs-list

[issue1602133] non-framework python fails to define os.environ properly

2011-07-19 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- stage: - commit review title: non-framework built python fails to define environ properly - non-framework python fails to define os.environ properly versions: +Python 3.3 -Python 3.1 ___ Python tracker

  1   2   >