Re: Occasional OSError: [Errno 13] Permission denied on Windows

2006-01-05 Thread pyguy2
File attributes may be an issue to. Take look at the recipe at: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303343 which ensures the file attributes are normal before you delete it. john -- http://mail.python.org/mailman/listinfo/python-list

Re: Translate this to python?

2006-01-04 Thread pyguy2
For some reason, ocassionally when I see xrange, I think "But wasn't that deprecated since range is now a . . oh wait that's xreadlines". xrange is a cool thing the few times where you really need it. john > Not sure what i is really for, but j seems to be independent, > so perhaps (also untes

Re: How to find Windows "Application data" directory??

2005-06-29 Thread pyguy2
I had a post yesterday on just that. Anyways, I always love it when what can be a really annoying problem, reduces into as something simple and elegant like a python dict. (in general, I find dictionaries rock). I remember a similar eureka, when some time ago I found it really neat that split

Re: windows/distutils question

2005-06-28 Thread pyguy2
If the environment variable: os.environ['APPDATA'] is present on non-English Windows, you may be able to use that to get what you need. john -- http://mail.python.org/mailman/listinfo/python-list

Re: SSL (HTTPS) with 2.4

2005-05-25 Thread pyguy2
After failed attempts at trying to get my code to work with squid. I did some research into this and came up with some info. http://www.python.org/peps/pep-0320.txt "- It would be nice if the built-in SSL socket type could be used for non-blocking SSL I/O. Currently packages such as Twisted wh

Re: SSL (HTTPS) with 2.4

2005-05-19 Thread pyguy2
If you need some help, send me an email and if we figure this out we can post a resolution. I have used both approaches (having authored them). Or at least let me know what site you are going to and I will try them on a windows box and see if I can debug that the [EMAIL PROTECTED]@ is going on.

Re: How to run Python in Windows w/o popping a DOS box?

2005-04-25 Thread pyguy2
>I am objecting to embeddeding metadata in data. >I think we were just looking a different aspects of the elephant ;-) I think you are right on both counts. Given current filesystems, I like the #! method. I tend to like approaches that have very low entrance access fees and can scale up. Ki

Re: How to run Python in Windows w/o popping a DOS box?

2005-04-23 Thread pyguy2
>>I think of it like the ''.join semantics. The object knows best how to >>handle join (even if it looks wierd to some people). In the #! case, >>the program knows best how to start itself. >This I don't understand ;-) With ','.join(['a','b','c'])You rely on what wants to join the sequence t

Re: How to run Python in Windows w/o popping a DOS box?

2005-04-22 Thread pyguy2
click on my computer Then select tools->folder options->File Types scroll down the where the py extension is defined, highlight it, click on advanced then highlight open and hit the edit button. There you should see python.exe with some other stuff, change it to pythonw.exe Then, in the future,

Re: How to run Python in Windows w/o popping a DOS box?

2005-04-20 Thread pyguy2
Python.exe starts up a windows console which gives you things stdin, stderr, and stdout from the C runtime. Be warned that you do not have those things with the consoleless(?) pythonw.exe, stuff which MS intends for gui applications. It reminds me of select() on windows only working halfway (jus

Re: HTTPSConnection script fails, but only on some servers (long)

2005-04-13 Thread pyguy2
I have a couple of recipes at the python cookbook site, that allows python to do proxy auth and ssl. The easiest one is: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/301740 john [EMAIL PROTECTED] wrote: > Well HTTPSConnection does not support proxies. (HTTP/CONNECT + switch to HTTPS)

Is socket.shutdown(1) useless

2005-04-13 Thread pyguy2
Issues of socket programming can be wierd, so I'm looking for some comments. In my python books I find exclusive use of socket.close(). From my other readings, I know about a "partial close operation". So, I figured it would be useful to post some code about how socket.close() has an implicit send

Re: Queue.Queue-like class without the busy-wait

2005-03-31 Thread pyguy2
Thinking about cross-platform issues. I found this, from the venerable Tim Peters to be enlightening for python's choice of design: "It's possible to build a better Queue implementation that runs only on POSIX systems, or only on Windows systems, or only on one of a dozen other less-popular target

Re: Queue.Queue-like class without the busy-wait

2005-03-31 Thread pyguy2
Cool Code! One possible sticking point is that I think select only works on network sockets on windows. This would make the code not crossplatforn. john -- http://mail.python.org/mailman/listinfo/python-list

Re: Python - what is the fastest database ?

2005-02-28 Thread pyguy2
It depends on what you mean by database. If you want really fast I/O, try pytables. "PyTables is a hierarchical database package designed to efficiently manage very large amounts of data." http://pytables.sourceforge.net/html/WelcomePage.html some more comments from the webpage: # High perform

Re: low-end persistence strategies?

2005-02-18 Thread pyguy2
You do not need to use a 24/7 process for low end persistance, if you rely on the fact that only one thing can ever succeed in making a directory. If haven't seen a filesystem where this isn't the case. This type of locking works cross-thread/process whatever. An example of that type of locking c

Re: low-end persistence strategies?

2005-02-16 Thread pyguy2
People sometimes run to complicated systems, when right before you there is a solution. In this case, it is with the filesystem itself. It turns out mkdir is an atomic event (at least on filesystems I've encountered). And, from that simple thing, you can build something reasonable as long as you

Re: Cookbook 2nd ed Credits (was Re: The Industry choice)

2005-01-05 Thread pyguy2
Wow I didn't realize that I made that significant of a contribution :-) > 3: 9 u'John Nielsen' Well, I guess I did and I didn't. I worked hard to put postings up before I started taking classes again at a university last fall (with little kids and working full time, classes are a frustrating ti