[issue7980] time.strptime not thread safe

2013-03-12 Thread William McBrine
William McBrine added the comment: I'm still seeing this, in the 2.7.2 that comes with OS X 10.8.2. -- nosy: +William.McBrine ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7980

Re: RELEASED Python 3.0 final

2008-12-06 Thread William McBrine
On Fri, 05 Dec 2008 12:16:47 -0800, Fernando H. Sanches wrote: I agree that the tab/space thing should be changed. Would it be too hard to make the parser see if the indentation is consistent in the whole file? *Something* has changed. I had a piece of code where, without realizing it, I had

Re: What is not objects in Python?

2008-10-02 Thread William McBrine
On Wed, 01 Oct 2008 17:56:34 +0200, Boris Borcic wrote: 42, for instance. Proof : 42 is not object True QED isinstance(42, object) True -- 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 -- pass it on -- http://mail.python.org/mailman/listinfo/python-list

Re: like py2exe, but on a mac

2008-07-30 Thread William McBrine
On Tue, 29 Jul 2008 12:24:49 -0700, Russell E. Owen wrote: That is exactly what py2app does by default if you run py2app with the system python. Thanks. I see that it* avoids the issue with Tk starting in the background that I get with Platypus, too. In fact, it looks like the bundlebuilder

Re: like py2exe, but on a mac

2008-07-30 Thread William McBrine
On Wed, 30 Jul 2008 16:57:35 +, I wrote: [bundlebuidler] does put in a version-specific #! line, but if I change that to #!/usr/bin/env python, the app still works, and it seems to me that it will work for any version of Python on OS 10.4, 10.5, and maybe 10.3. Then again, I see now that

Re: like py2exe, but on a mac

2008-07-28 Thread William McBrine
On Mon, 28 Jul 2008 19:51:26 +0200, Tommy Nordgren wrote: There is Platypus, a general open source program to wrap a script in an Macintosh (GUI) Application. Thanks. I tried Platypus, and it's close to what I want. But I still can't seem to get rid of the small Console window that pops up

Re: Questions on 64 bit versions of Python

2008-07-28 Thread William McBrine
On Sun, 27 Jul 2008 20:31:07 +0200, Martin v. Löwis wrote: Originally, AMD called it x86-64, and later renamed it to AMD64. Intel originally implemented it under the name EM64T (for Extended Memory 64 Technology), and now calls the architecture Intel 64. I hadn't heard Intel 64 before. That's

Re: like py2exe, but on a mac

2008-07-28 Thread William McBrine
On Mon, 28 Jul 2008 21:09:10 +0200, Tommy Nordgren wrote: Try setting the Output popup menu to 'None' That was the first thing I did. -- 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 -- pass it on -- http://mail.python.org/mailman/listinfo/python-list

Re: like py2exe, but on a mac

2008-07-28 Thread William McBrine
On Mon, 28 Jul 2008 15:18:43 -0400, Kevin Walzer wrote: Add this call to your Python script somewhere (modify as needed): try: self.tk.call('console', 'hide') except TclError: pass Ah, yes! Thanks. -- 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0

Re: like py2exe, but on a mac

2008-07-27 Thread William McBrine
On Sun, 13 Jul 2008 00:58:59 +0200, Python.Arno wrote: http://undefined.org/python/py2app.html py2app bundles Python itself into the app, right? I wonder, is there no way to create an app bundle that relies on the existing installation of Python, since OS X already comes with Python? I have a

Re: Can't get Python for Windows to run

2008-07-04 Thread William McBrine
On Fri, 04 Jul 2008 16:19:34 +0100, Tim Rowe wrote: pythonw.exe (that's the windows executable, right?) python.exe and pythonw.exe are both Windows executables. There are no non- Windows executables in a Python for Windows package. python.exe is used for console apps or interactive sessions.

Re: Newbie question about tuples and list comprehensions

2008-06-25 Thread William McBrine
On Wed, 25 Jun 2008 16:02:52 -0700, John Machin wrote: Here's one approach (requires Python 2.5 or later): [(50 if x 50 else x, 50 if y 50 else y, 50 if z 50 else z) for (x, y, z) in source] [(max(x, 50), max(y, 50), max(z, 50)) for (x, y, z) in source] -- 09 F9 11 02 9D 74 E3 5B D8 41

Re: Learning Python: Code critique please

2008-06-22 Thread William McBrine
On Sun, 22 Jun 2008 08:44:25 -0500, Saul Spatz wrote: macoovacany wrote: http://macoovacany.wordpress.com/ When I tried to run it, I got all kinds of syntax errors because of non-ASCII characters; namely, you have fancy left and right single and double quotes. That's probably WordPress'

Re: Python Socket programming

2008-06-13 Thread William McBrine
On Fri, 13 Jun 2008 21:59:06 +0530, srinivasan srinivas wrote: I am going to do some socket related programming in Python. Before that, I wish to know the Gotchas of Python Scoket Programming. The only gotcha I see is that you won't want to go back to doing it in C. -- 09 F9 11 02 9D 74 E3

Re: Converting a simple python script to a simple windows executable

2008-06-12 Thread William McBrine
On Wed, 11 Jun 2008 12:25:29 -0700, geoffbache wrote: (1) py2exe. This is really for when python isn't installed on the remote user's machine, so it requires you to distribute a large amount of DLLs etc which are part of the python installation. A bit silly when I know that the remote user

Keeping focus with sequential Tkinter windows?

2008-05-27 Thread William McBrine
So, basically what I'm doing is this: window1 = Tkinter.Tk() ... window1.destroy() ... window2 = Tkinter.Tk() This works well in Linux and Mac OS X (and the PyGtk equivalent works on all platforms), but in Windows XP, the second window comes up without focus. (I have to click on it to focus

Re: Assignment and comparison in one statement

2008-05-24 Thread William McBrine
On Sat, 24 May 2008 13:12:13 +0200, Johannes Bauer wrote: char *tmp; tmp = fgets(buf, sizeof(buf), f); while (tmp) { printf(%s\n, buf); tmp = fgets(buf, sizeof(buf), f); } I think a more Pythonic way to write this, in general, would be: while (1) { char *tmp = fgets(buf,

When file-like objects aren't file-like enough for Windows

2008-03-16 Thread William McBrine
This is proving to be a recurring problem for me. First, I used the save() method of a Python Imaging Library Image object to write directly to the wfile of a BaseHTTPRequestHandler- derived class: pic.save(self.wfile, 'JPEG') Worked great in Linux, barfed in Windows. I had to do this to

Re: Removal of element from list while traversing causes the next element to be skipped

2008-02-01 Thread William McBrine
On Wed, 30 Jan 2008 06:07:45 -0800, cokofreedom wrote: Anyone else noticed that the OP has not actually replied to any of the suggestions... Sorry. I was just fascinated at the turns it was taking. But the first answer was fine for me: for name in apps[:]: etc. Thanks all. -- 09 F9 11

Removal of element from list while traversing causes the next element to be skipped

2008-01-29 Thread William McBrine
Look at this -- from Python 2.5.1: a = [1, 2, 3, 4, 5] for x in a: ... if x == 3: ... a.remove(x) ... print x ... 1 2 3 5 a [1, 2, 4, 5] Sure, the resulting list is correct. But 4 is never printed during the loop! What I was really trying to do was this: apps = [name for

Re: Big-endian binary data to/from Python ints?

2007-12-27 Thread William McBrine
On Wed, 26 Dec 2007 16:50:53 -0800, Dennis Lee Bieber wrote: your code might (I've not actually checked it) be incorrect if ported to another machine. Nope. :-) If the problem is that you have the four bytes as a character string, use the struct module to interpret it as a binary integer

Re: Performance on local constants?

2007-12-26 Thread William McBrine
Thanks for all the answers on this. (And, sorry the lousy Subject line; I couldn't think of a better one.) -- 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 -- pass it on -- http://mail.python.org/mailman/listinfo/python-list

Big-endian binary data to/from Python ints?

2007-12-26 Thread William McBrine
Here are a couple of functions that I feel stupid for having written. They work, and they're pretty straightforward; it's just that I feel like I must be missing an easier way to do this... def net_to_int(numstring): Convert a big-endian binary number, in the form of a string of

Performance on local constants?

2007-12-22 Thread William McBrine
Hi all, I'm pretty new to Python (a little over a month). I was wondering -- is something like this: s = re.compile('whatever') def t(whatnot): return s.search(whatnot) for i in xrange(1000): print t(something[i]) significantly faster than something like this: def t(whatnot): s