Re: Ann: Tkinter drag and drop module

2005-07-21 Thread [EMAIL PROTECTED]
yup. that's exactly what i did, on win2k... somehow, i was surprised that it would work - the filepath + file name from the binary i'd dragged and dropped onto the .exe file was properly passed to the frozen python script as an arg... -- http://mail.python.org/mailman/listinfo/python-list

Re: How to limit the uploading file size in python?

2005-07-21 Thread Fuzzyman
Hello Prabahar, It entirely depends on the mechanism you are using to receive the file (there is no generic solution). Is it within a CGI ? The normal way would be to check the file sized and discard if it's too big. You'll have to do it within your code - but it's probably a one line check ! Be

Re: Generating images with text in them

2005-07-21 Thread Terry Hancock
On Wednesday 20 July 2005 11:59 pm, phil hunt wrote: > I am trying to generate some images (gifs or pngs) with text in > them. I can use the Python Imaging Library, but it only has access > to the default, rather crappy, font. On the fly, or just during development? In any case, you should be a

RE: Lots of pdf files

2005-07-21 Thread Tim Golden
[Greg Lindstrom] | There does not appear to be a simple way to merge many pdf's | into one. I'm currently using ghostscript (on Win32) to merge multiple postscript files into one PDF (by specifying multiple inputs to the gswin32c command). I imagine it can do the same for multiple PDF inputs on

Web-Forms

2005-07-21 Thread Mathias Waack
Hi, I need to access some information from a web site which are only accessible through a form. Thus for each bucket of data you have to fill out the form, submit it and wait for an answer. Very easy - if you don't have to check some hundred times. Of course this site requires cookies, it is not

Re: I just wanna know about os.path module..

2005-07-21 Thread Peter Otten
kimes wrote: > You said 'At first os - module, or package, it doesn't matter here - is > imported.' With a file mop.py in your path import mop creates a module instance and executes mop.py to fill it with content -- classes, functions, whatever python objects you can think of -- and puts that m

Re: How to use octave in python

2005-07-21 Thread travlr
And or numarray :) http://www.stsci.edu/resources/software_hardware/numarray -- http://mail.python.org/mailman/listinfo/python-list

Couple quick questions from a Python Noob

2005-07-21 Thread digitalsubjunctive
Hey, I just started on Python and have a few questions I couldn't find answers to on the Python site or it's tutorial. 1. I notice a few "compiled python" files (indicated by reddish snake icons), I thought Python didn't need to be compiled? This is my first venture into programming, but if it doe

spurious syntax error when updating to 2.4 ?

2005-07-21 Thread Simon Dahlbacka
Hi, I'm doing some preparation for a hopefully upcoming transition to python 2.4 (from 2.3.4) on winxp platform However, I'm getting SyntaxErrors in files that worked fine in 2.3, it tells me that e.g. newLanguage.language = languageElement[0].firstChild.data.encode("ascii") this line is broken

Re: Copying attributes

2005-07-21 Thread red
Terry Hancock wrote: > I'm not sure either, yet, but can you indicate which line in your > listing is 102 in the source file? That might be helpful. 101: ## f1.normal = copy.deepcopy(f.normal) 102:f1.normal = NMesh.Vert(f.normal[0], f.normal[1], f.normal[2]) I've tried with deepcopy, but the

RE: returning list of strings from Python COM to Visual basic 6

2005-07-21 Thread Stefan Schukat
You have to wrap the python object with a COM object: def Get_Obj(self): return win32com.server.util.wrap(an_object) Stefan > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of > Philippe C. Martin > Sent: Thursday, July 21, 2005 1:42 AM

Re: is this pythonic?

2005-07-21 Thread Thomas Lotze
Mage wrote: > Or is there better way? > > for (i, url) in [(i,links[i]) for i in range(len(links))]: > ... > > "links" is a list. for i, url in enumerate(links): -- Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Couple quick questions from a Python Noob

2005-07-21 Thread bruno modulix
[EMAIL PROTECTED] wrote: > Hey, I just started on Python and have a few questions I couldn't find > answers to on the Python site or it's tutorial. > > 1. I notice a few "compiled python" files (indicated by reddish snake > icons), I thought Python didn't need to be compiled? This is my first > v

Re: File Table List in Plone

2005-07-21 Thread bruno modulix
[EMAIL PROTECTED] wrote: > All, > > Is there is a Plone type or product for generating a file list on a > plone page, eg: a list of downloadable files in a table? An example of > what I want can be found at > http://www.zope.org/Members/MacGregor/ExtFile under "Available > Releases" where a list

Re: Python IDE

2005-07-21 Thread linuxfreak
ok will give it a shot. I had tried the 0.7.2 version with wxPython 2.6 and the moment i place the cursor in a class name and pressed the space or the enter key.booom there it went crashing without a trace. But i did like what little i saw of it (apart from the crashes, of course) and the UML d

Re: Lots of pdf files

2005-07-21 Thread Ralf Muschall
Greg Lindstrom wrote: > Hello- > I'm running Python 2.3 on a Linux system and have lots (about 2000) > files in pdf format to print each day. If I just wind up and fire all > the files at the printer at once (as 2000 separate print jobs), the > print server throws a fit and our system admin comes

Re: Need to interrupt to check for mouse movement

2005-07-21 Thread stringy
Cheers for the replies people, but I got it sorted by just whacking in wx.YieldIfNeeded() in the code before it communicates over the socket. It's kind of jerky, but it works, where as before I'd click and drag, and the 3d view wouldn't move for about 20 seconds. -- http://mail.python.org/mailman

newbie - mode for directory

2005-07-21 Thread wcc
Hello, When using os.mkdir, what are the numeric numbers for different modes? I could only find mode=0777 means read-only. Thanks, - wcc -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie - mode for directory

2005-07-21 Thread Sybren Stuvel
wcc enlightened us with: > When using os.mkdir, what are the numeric numbers for different > modes? man chmod Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let t

wxPythin installation woes

2005-07-21 Thread linuxfreak
Hi all, Was working with python 2.3 in a fedora core 3 machine. I upgraded it to Fedora Core 4 with a clean install. So now I have python 2.4 installed. But when I try to install wxPython for python 2.4 using an rpm file i downloaded from the wxpython web site i get dependencies errors. Turns out

Python Path Setting

2005-07-21 Thread Neil Benn
Hello, I'm trying to find some detailed documentation about PYTHONPATH, paths.pth, lib/site-packages, sitecustomise and so on. I know what they do but I'd like some detailed documentation about what gets loaded where and when. However I can't find the documentation on this. G

wxPythin installation woes

2005-07-21 Thread linuxfreak
Hi all, Was working with python 2.3 in a fedora core 3 machine. I upgraded it to Fedora Core 4 with a clean install. So now I have python 2.4 installed. But when I try to install wxPython for python 2.4 using an rpm file i downloaded from the wxpython web site i get dependencies errors. Turns out

Re: Web-Forms

2005-07-21 Thread Simon Brunning
On 7/21/05, Mathias Waack <[EMAIL PROTECTED]> wrote: > I need to access some information from a web site which are only accessible > through a form. Thus for each bucket of data you have to fill out the form, > submit it and wait for an answer. Very easy - if you don't have to check > some hundred

Re: Lots of pdf files

2005-07-21 Thread Duncan Booth
Greg Lindstrom wrote: > I'm running Python 2.3 on a Linux system and have lots (about 2000) > files in pdf format to print each day. If I just wind up and fire all > the files at the printer at once (as 2000 separate print jobs), the > print server throws a fit and our system admin comes down

Re: is a file open ?

2005-07-21 Thread luis
John Machin wrote: > Daniel Dittmar wrote: > >> luis wrote: >> >>> for root, dirs, files in os.walk(path): >>>for file in files: >>> # ¿ is opened ? >> >> >> >> On Linux and some other Unixes, you can probably read the /proc >> filesystem. >> >> On Windows, you'll probably get the quick

Re: is a file open ?

2005-07-21 Thread luis
John Machin wrote: > Daniel Dittmar wrote: > >> luis wrote: >> >>> for root, dirs, files in os.walk(path): >>>for file in files: >>> # ¿ is opened ? >> >> >> >> On Linux and some other Unixes, you can probably read the /proc >> filesystem. >> >> On Windows, you'll probably get the quick

Re: Couple quick questions from a Python Noob

2005-07-21 Thread stringy
For compiling Python, http://effbot.org/zone/python-compile.htm appears to have some information, although I've never done it myself, so I wouldn't know any more on the matter. Also http://starship.python.net/crew/theller/py2exe/ appears to have something on Python-> .exe -- http://mail.python.o

Re: Generating images with text in them

2005-07-21 Thread Daren Russell
phil hunt wrote: > I am trying to generate some images (gifs or pngs) with text in > them. I can use the Python Imaging Library, but it only has access > to the default, rather crappy, font. > > Ideally I'd like to use one of the nicer fonts that come with my X > Windows installation. Using Tk

Re: Generating images with text in them

2005-07-21 Thread John Abel
Have you downloaded the pilfonts.zip from effbot.org? J phil hunt wrote: >I am trying to generate some images (gifs or pngs) with text in >them. I can use the Python Imaging Library, but it only has access >to the default, rather crappy, font. > >Ideally I'd like to use one of the nicer fonts

Re: returning list of strings from Python COM to Visual basic 6

2005-07-21 Thread Philippe C. Martin
Thanks a bunch, I'll try this, This raises two questions: 1) How do I declare the receiving VB variable ? 2) Then, can I use the returned object as a COM object: call its public methods (that would be hot)? Dim newobj as ? newobj = acom.Get_Obj() newobj.A_Public() Regards, Philippe

UPDATE: SPE 0.7.4.d Python Editor released

2005-07-21 Thread Stani
Something which prevented SPE 0.7.4.a to start is fixed Stani PS http://www.stani.be/python/spe/blog -- http://mail.python.org/mailman/listinfo/python-list

Re: gdb python C API

2005-07-21 Thread fraca7
derrick a écrit : > are there any tools / methods that others have used to get what line of > the python script is being executed while running in gdb? or if it would > actually show me the source python script (instead of the the python c > source) that would help. I don't think so, but when hav

A sad story about a real "Python"

2005-07-21 Thread Marco Aschwanden
http://www.snopes.com/photos/animals/fencesnake.asp Cheers, Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPythin installation woes

2005-07-21 Thread Sybren Stuvel
linuxfreak enlightened us with: > Turns out that libstdc++.so.5 is needed but I checked and i see > that libstdc++.so.6 is installed on my system. On my system (Ubuntu, based on Debian), I can have multiple versions of libstdc++ installed at the same time. Sybren -- The problem with the world i

Re: is a file open ?

2005-07-21 Thread John Machin
luis wrote: > John Machin wrote: > >> Daniel Dittmar wrote: >> >>> luis wrote: >>> for root, dirs, files in os.walk(path): for file in files: # ¿ is opened ? >>> >>> >>> >>> >>> On Linux and some other Unixes, you can probably read the /proc >>> filesystem. >>> >>> On Wind

Re: spurious syntax error when updating to 2.4 ?

2005-07-21 Thread Simon Dahlbacka
Replying to self, it seems to be related to https://sourceforge.net/tracker/index.php?func=detail&aid=1163244&group_id=5470&atid=105470 (Syntax error on large file with MBCS encoding) even though my files had # -*- coding: ascii -*- However, if I removed this explicit ascii encoding then I did not

Re: gdb python C API

2005-07-21 Thread skip
fraca7> derrick a écrit : >> are there any tools / methods that others have used to get what line >> of the python script is being executed while running in gdb? or if it >> would actually show me the source python script (instead of the the >> python c source) that would help.

Re: UPDATE: SPE 0.7.4.d Python Editor released

2005-07-21 Thread travlr
I just dloaded 0.7.4.b an hour ago... your quik. Ha...lol. :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: gdb python C API

2005-07-21 Thread fraca7
[EMAIL PROTECTED] a écrit : > Actually, take a look in the distribution at Misc/gdbinit. In particular, > check out the pystack command. Wow, nice! This will be put to good use, thanks :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Path Setting

2005-07-21 Thread Chris Curvey
http://www.python.org/doc/2.4.1/inst/search-path.html#SECTION00041 -- http://mail.python.org/mailman/listinfo/python-list

Re: Lots of pdf files

2005-07-21 Thread nick
Paul Rubin wrote: > Greg Lindstrom <[EMAIL PROTECTED]> writes: > > There does not appear to be a simple way to merge many pdf's into one. > There's probably some way to do it with pstops or some related program > or set of programs. Google for "multivalent tools" - a co

print pdf file to network printer using python

2005-07-21 Thread scrimp
Well, Ive been searching through google groups and Ive seen a lot about printing a pdf file, but I havent seen a definite answer. I tried this code: f = open(printer_path, 'w') f.write(pdffile_path) f.close() Basically it doesnt work and what it prints out is the value of pdffile_path variable. I

Re: returning list of strings from Python COM to Visual basic 6

2005-07-21 Thread Philippe C. Martin
I guess that also means (which makes sense) that the returned object has to be registered as a COM object. However, in my case, I just needed that object to pass it to yet another object, I did not need to use it from VB Regards, Philippe Philippe C. Martin wrote: > Thanks a bunch, > > I'll

Re: Need to interrupt to check for mouse movement

2005-07-21 Thread Jp Calderone
On Thu, 21 Jul 2005 00:51:45 -0400, Christopher Subich <[EMAIL PROTECTED]> wrote: >Jp Calderone wrote: > >> In the particular case of wxWidgets, it turns out that the *GUI* blocks >> for long periods of time, preventing the *network* from getting >> attention. But I agree with your position for o

Re: Need to interrupt to check for mouse movement

2005-07-21 Thread Jp Calderone
On 20 Jul 2005 22:06:31 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: >Christopher Subich <[EMAIL PROTECTED]> writes: >> > In the particular case of wxWidgets, it turns out that the *GUI* >> > blocks for long periods of time, preventing the *network* from >> > getting attention. But I

Re: Need to interrupt to check for mouse movement

2005-07-21 Thread Jp Calderone
On Thu, 21 Jul 2005 05:42:32 -, Donn Cave <[EMAIL PROTECTED]> wrote: >Quoth Paul Rubin : >| Christopher Subich <[EMAIL PROTECTED]> writes: >| > > In the particular case of wxWidgets, it turns out that the *GUI* >| > > blocks for long periods of time, preventing the *ne

Re: popen2 usage

2005-07-21 Thread jb
Actually, "-test1" is a text argument that testme.exe should receive from standard input. For example, Executing testme.exe generates the following output, Please select one of the following options: 1) test1 2) test2 3) exit Please enter your option here:-test1 <-This -test1 is what user would typ

Buffering problem using subprocess module

2005-07-21 Thread Dr. Who
I am using the subprocess module in 2.4. Here's the fragment: bufcaller.py: import sys, subprocess proc = subprocess.Popen('python bufcallee.py', bufsize=0, shell=True, stdout=subprocess.PIPE) for line in proc.stdout: sys.stdout.write(line) bufcallee.py:

Re: Need to interrupt to check for mouse movement

2005-07-21 Thread Jp Calderone
On Thu, 21 Jul 2005 02:33:05 -0400, Peter Hansen <[EMAIL PROTECTED]> wrote: >Jp Calderone wrote: >> In the particular case of wxWidgets, it turns out that the *GUI* blocks >> for long periods of time, preventing the *network* from getting >> attention. But I agree with your position for other tool

Listing Processes Running on Remote Machines

2005-07-21 Thread yoda
Hello Hackers, I'm developing a large scale distributed service and part of the requirement is that I be able to monitor clients in a very granular way. To this end, I'd like to know if there is any way to get a list of all the processes running on a remote client\machine. I need to be able to do

Re: Buffering problem using subprocess module

2005-07-21 Thread Jp Calderone
On 21 Jul 2005 06:14:25 -0700, "Dr. Who" <[EMAIL PROTECTED]> wrote: >I am using the subprocess module in 2.4. Here's the fragment: > >bufcaller.py: > import sys, subprocess > proc = subprocess.Popen('python bufcallee.py', bufsize=0, shell=True, >stdout=subprocess.PIPE) > for line

RE: Listing Processes Running on Remote Machines

2005-07-21 Thread George Flaherty
Look into STAF http://staf.sourceforge.net/index.php -g -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of yoda Sent: Thursday, July 21, 2005 9:23 AM To: python-list@python.org Subject: Listing Processes Running on Remote Machines Hello Hackers, I'm develop

Re: wxPythin installation woes

2005-07-21 Thread linuxfreak
Does anyone know if the same can be done in fedora distributions??? Sybren Stuvel wrote: > linuxfreak enlightened us with: > > Turns out that libstdc++.so.5 is needed but I checked and i see > > that libstdc++.so.6 is installed on my system. > > On my system (Ubuntu, based on Debian), I can hav

Re: Filling up commands.getstatusoutput's buffer

2005-07-21 Thread Jeff Epler
On Wed, Jul 20, 2005 at 03:10:49PM -0700, [EMAIL PROTECTED] wrote: > Hey, > > Has anyone ever had commands.getstatusoutput's buffer fill up when > executing a verbose command? [...] How much output are you talking about? I tried outputs as large as about 260 megabytes without any problem. (RedHa

Re: is this pythonic?

2005-07-21 Thread Steven D'Aprano
On Wed, 20 Jul 2005 16:30:10 -0400, Bill Mill wrote: > On 7/20/05, Simon Brunning <[EMAIL PROTECTED]> wrote: >> On 7/20/05, Mage <[EMAIL PROTECTED]> wrote: >> > Or is there better way? >> > >> > for (i, url) in [(i,links[i]) for i in range(len(links))]: >> >> for i, url in enumerate(links): >> >

Re: goto

2005-07-21 Thread Rocco Moretti
> My "favorite" infinte loop with while is: > >i = 0 >while i < 20: > do_process(i) > > Note the prominent *lack* of any change to i here? > > Oh, for: > > from i = 0 > invariant 0 <= i <= 20 > variant 21 - i > until i > 19 > loop > do_process(i) >

Dr. Dobb's Python-URL! - weekly Python news and links (Jul 20)

2005-07-21 Thread Simon Brunning
QOTW: "Discussing goto statements and Microsoft together is like mixing dynamite and gasoline." - DH '"Spaghetti" doesn't quite describe it. I've settled on "Lovecraftian": reading the code, you can't help but get the impression of writhing tentacles and impossible angles.' - Robert Kern Hig

Re: is this pythonic?

2005-07-21 Thread Bill Mill
On 7/21/05, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Wed, 20 Jul 2005 16:30:10 -0400, Bill Mill wrote: > > > On 7/20/05, Simon Brunning <[EMAIL PROTECTED]> wrote: > >> On 7/20/05, Mage <[EMAIL PROTECTED]> wrote: > >> > Or is there better way? > >> > > >> > for (i, url) in [(i,links[i]) for

Python session handling

2005-07-21 Thread mohammad babaei
Hi, What is th best way for "session  tracking" in python ? regards, mo -- http://mail.python.org/mailman/listinfo/python-list

Stupid question: Making scripts python-scripts

2005-07-21 Thread Jan Danielsson
Hello all, How do I make a python script actually a _python_ in unix:ish environments? I know about adding: #!/bin/sh ..as the first row in a shell script, but when I installed python on a NetBSD system, I didn't get a "python" executable; only a "python2.4" executable. Adding "#!/usr/

Re: Stupid question: Making scripts python-scripts

2005-07-21 Thread Jp Calderone
On Thu, 21 Jul 2005 16:34:30 +0200, Jan Danielsson <[EMAIL PROTECTED]> wrote: >Hello all, > > How do I make a python script actually a _python_ in unix:ish >environments? > > [snip] Put "#!/usr/bin/python". Install the program using distutils: if necessary, distutils will rewrite the #! line t

Overriding a built-in exception handler

2005-07-21 Thread callmebill
I'm having a tough time figuring this one out: class MyKBInterrupt( . ): print "Are you sure you want to do that?" if __name__ == "__main__": while 1: print "Still here..." So this thing keeps printing "Still here..." until the user hits ctl-c, at which time the except

Re: Stupid question: Making scripts python-scripts

2005-07-21 Thread callmebill
On your system, do: which python2.4 That will give you the full path to the python2.4 binary (let's call it "path/to/py24"). Then add: #!/path/to/py24 ...to the top of your script. And make sure the file is chmod'd +x -- http://mail.python.org/mailman/listinfo/python-list

Re: Overriding a built-in exception handler

2005-07-21 Thread Jp Calderone
On 21 Jul 2005 07:39:10 -0700, [EMAIL PROTECTED] wrote: >I'm having a tough time figuring this one out: > > >class MyKBInterrupt( . ): > print "Are you sure you want to do that?" > >if __name__ == "__main__": > while 1: > print "Still here..." > > >So this thing keeps printing

Re: Stupid question: Making scripts python-scripts

2005-07-21 Thread Bill Mill
On 7/21/05, Jan Danielsson <[EMAIL PROTECTED]> wrote: > Hello all, > >How do I make a python script actually a _python_ in unix:ish > environments? > > I know about adding: > #!/bin/sh > >..as the first row in a shell script, but when I installed python on > a NetBSD system, I didn't get

Re: Overriding a built-in exception handler

2005-07-21 Thread Jaime Wyant
You can't override an exception. You can only catch whatever exception is thrown. For your case, you would want to wrap that while loop up in a try/catch block like this: try: while 1: print "Yay for me!" except KeyboardInterrupt: print "CTRL-C caught" Someone had mentioned poss

Re: Stupid question: Making scripts python-scripts

2005-07-21 Thread Bill Mill
On 7/21/05, Bill Mill <[EMAIL PROTECTED]> wrote: > On 7/21/05, Jan Danielsson <[EMAIL PROTECTED]> wrote: > > Hello all, > > > >How do I make a python script actually a _python_ in unix:ish > > environments? > > > > I know about adding: > > #!/bin/sh > > > >..as the first row in a shell scri

difficulty connecting to networked oracle database

2005-07-21 Thread yahibble
Now, I am no Python expert but I have dabbled and I have spent a couple of days with another engineer unsuccessfully installing oracle drivers for MS ODBC on the win XP machine. It looked to me like ODBC was the best way to get a (free) python module to upload data to an oracle database table. Asi

Re: difficulty connecting to networked oracle database

2005-07-21 Thread Paul McNett
yahibble wrote: > Now, I am no Python expert but I have dabbled and I have spent a > couple of days with another engineer unsuccessfully installing oracle > drivers for MS ODBC on the win XP machine. > > It looked to me like ODBC was the best way to get a (free) python > module to upload data to a

Re: difficulty connecting to networked oracle database

2005-07-21 Thread Martin Franklin
yahibble wrote: > Now, I am no Python expert but I have dabbled and I have spent a > couple of days with another engineer unsuccessfully installing oracle > drivers for MS ODBC on the win XP machine. > > It looked to me like ODBC was the best way to get a (free) python > module to upload data to a

Re: What does "::" mean?

2005-07-21 Thread Michael Hoffman
Robert Kern wrote: > Rob Williscroft wrote: > >> import sys >> >> live = 'live' >> >> print live[ sys.maxint : : -1 ] >> print live[ len(live)-1 : : -1 ] >> >> print live[ len(live)-1 : -len(live)-1 : -1 ] >> print live[ len(live)-1 : -sys.maxint : -1 ] >> print live[ s

PEP on path module for standard library

2005-07-21 Thread Michael Hoffman
Many of you are familiar with Jason Orendorff's path module , which is frequently recommended here on c.l.p. I submitted an RFE to add it to the Python standard library, and Reinhold Birkenfeld started a discussion on it in python-dev

Hash functions

2005-07-21 Thread Steven D'Aprano
Do people often use hash() on built-in types? What do you find it useful for? How about on custom classes? Can anyone give me some good tips or hints for writing and using hash functions in Python? Thank you, -- Steven. -- http://mail.python.org/mailman/listinfo/python-list

Re: goto

2005-07-21 Thread Michael Hudson
[EMAIL PROTECTED] writes: > >>> what is the equivalent of C languages' goto statement in python? > > >> You really shouldn't use goto. > >> Fortunately you can't. > > Steven> Of course you can :-) > > Steven> You can write your own Python interpreter, in Python, and add a >

Re: Stupid question: Making scripts python-scripts

2005-07-21 Thread callmebill
oops... I missed the "too specific comment." Sorry =) -- http://mail.python.org/mailman/listinfo/python-list

Re: is this pythonic?

2005-07-21 Thread Michael Hoffman
Steven D'Aprano wrote: > The great thing about Usenet and the Internet is that we can pick each > other's brains for answers, instead of flailing around blindly in manuals > that don't understand the simplest natural language query. And isn't that > why we're here? Personally, I feel my time is b

Re: Need to interrupt to check for mouse movement

2005-07-21 Thread Christopher Subich
Paul Rubin wrote: > Huh? It's pretty normal, the gui blocks while waiting for events > from the window system. I expect that Qt and Tk work the same way. Which is why I recommended Twisted for the networking; it integrates with the toolkit event loops so it automagically works: http://twistedm

Re: Stupid question: Making scripts python-scripts

2005-07-21 Thread callmebill
You could also set your "python" environment variable on the system... set it to be "/path/to/python2.4". Then use the "#!/usr/bin/env python" trick. Just make sure that env is working for you, first. -- http://mail.python.org/mailman/listinfo/python-list

Re: print pdf file to network printer using python

2005-07-21 Thread Grant Edwards
On 2005-07-21, scrimp <[EMAIL PROTECTED]> wrote: > Well, Ive been searching through google groups and Ive seen a lot about > printing a pdf file, but I havent seen a definite answer. I tried this > code: > > f = open(printer_path, 'w') > f.write(pdffile_path) > f.close() > > Basically it doesnt wor

Re: is this pythonic?

2005-07-21 Thread Steven D'Aprano
On Thu, 21 Jul 2005 16:43:00 +0100, Michael Hoffman wrote: > Personally, I feel my time is better served by answering questions that > would not be easy to find without assistance. I can't expect everyone to > know about or expect enumerate() from the beginning, so I don't have any > objections

Re: Filling up commands.getstatusoutput's buffer

2005-07-21 Thread travislspencer
Jeff Epler wrote: > On Wed, Jul 20, 2005 at 03:10:49PM -0700, [EMAIL PROTECTED] wrote: > How much output are you talking about? Honestly, I don't know. I came on to a project were they said they were hitting up against some limit, and had a hack to work around it. I just wondered if others had hi

Re: Overriding a built-in exception handler

2005-07-21 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: > I've Read-TFM, but I only see good info on how to create my own class > of exception; I don't see anything on how to override an existing > exception handler. You need to read the tutorial on handling exceptions: http://docs.python.org/tut/node10.html -- Michael Hoff

Re: is this pythonic?

2005-07-21 Thread Steven D'Aprano
On Thu, 21 Jul 2005 10:27:24 -0400, Bill Mill wrote: [snip] > I said the *builtins* section. I think you learn pretty quick that > figuring out what functions are builtins is pretty important in every > language. There's a fair number of people out there giving the advice > to read chapter 2 of t

Re: Hash functions

2005-07-21 Thread Michael Hudson
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Do people often use hash() on built-in types? Only implicitly. > What do you find it useful for? Dictionaries :) > How about on custom classes? Same here. > Can anyone give me some good tips or hints for writing and using > hash functions in Pyt

Re: What does "::" mean?

2005-07-21 Thread Robert Kern
Michael Hoffman wrote: > Robert Kern wrote: >>Well, that part's easy at least: >> >> live[::-1] >> >>:-) And so the circle is complete ... > > What about reversed(live)? Or if you want a list instead of an iterator, > list(reversed(live))? That's fine if you want to iterate over it. Often, es

Re: difficulty connecting to networked oracle database

2005-07-21 Thread Grig Gheorghiu
As the other posters already mentioned, cx_Oracle is the way to go. I'm using it to connect to Oracle not only on Windows, but also on Solaris, Linux and AIX. Grig -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP on path module for standard library

2005-07-21 Thread Peter Hansen
Michael Hoffman wrote: > For the PEP, do any of you have arguments for or against including path? > Code samples that are much easier or more difficult with this class > would also be most helpful. I believe the strongest argument for "path" can be made for how it integrates functionality which

Re: Generating images with text in them

2005-07-21 Thread phil hunt
On Thu, 21 Jul 2005 11:23:46 +0100, Daren Russell <[EMAIL PROTECTED]> wrote: >phil hunt wrote: >> I am trying to generate some images (gifs or pngs) with text in >> them. I can use the Python Imaging Library, but it only has access >> to the default, rather crappy, font. >> >> Ideally I'd like

Re: Generating images with text in them

2005-07-21 Thread phil hunt
On Thu, 21 Jul 2005 02:44:03 -0500, Terry Hancock <[EMAIL PROTECTED]> wrote: >On Wednesday 20 July 2005 11:59 pm, phil hunt wrote: >> I am trying to generate some images (gifs or pngs) with text in >> them. I can use the Python Imaging Library, but it only has access >> to the default, rather cra

Re: PEP on path module for standard library

2005-07-21 Thread Fernando Perez
Peter Hansen wrote: > Michael Hoffman wrote: >> For the PEP, do any of you have arguments for or against including path? >> Code samples that are much easier or more difficult with this class >> would also be most helpful. > > I believe the strongest argument for "path" can be made for how it > i

Re: socket programming

2005-07-21 Thread Helge Aksdal
* gry@ll.mit.edu [2005/07/20 15:26]: > What I have done in similar circumstances is put in a random sleep > between connections to fool the server's load manager. Something like: > > .import time > .min_pause,max_pause = (5.0, 10.0) #seconds > .while True: > . time.sleep(random.uniform(min_p

Re: PEP on path module for standard library

2005-07-21 Thread Reinhold Birkenfeld
FYI: I modified the path module a bit so that it fits many of the suggestions from python-dev, and put the result in the Python CVS tree under nondist/sandbox/path. Most prominent change is that it doesn't inherit from str/unicode anymore. I found this distinction important, because as a str subcl

Re: Buffering problem using subprocess module

2005-07-21 Thread Dr. Who
Unfortunatley that doesn't help. Even when callee is started using the -u, I get the same behavior. -- http://mail.python.org/mailman/listinfo/python-list

Re: print pdf file to network printer using python

2005-07-21 Thread scrimp
I just tried it and all that printed out was garbage. I found another way to do it. It all depends on what you wanna do. If u want to print to the default printer (easiest way) then just use this line: win32api.ShellExecute(0, "print", file_path, None, ".", 0) file_path of course being the full p

Re: PEP on path module for standard library

2005-07-21 Thread Terry Reedy
"Reinhold Birkenfeld" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Most prominent change is that it doesn't inherit from str/unicode > anymore. > I found this distinction important, because as a str subclass the Path > object > has many methods that don't make sense for it. Wh

Python Programming Patterns

2005-07-21 Thread Tin
Hi, I have listed Python Programming Patterns ISBN:0130409561 on ebay.co.uk A brand new with really cheap price-4.99 If you are interested, go and have a look at www.ebay.co.uk and locate that one. Come one, fish and chips would cost more than that. Surely. Cheers Tin -- http://mail.python.o

Re: is this pythonic?

2005-07-21 Thread Terry Reedy
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, 21 Jul 2005 10:27:24 -0400, Bill Mill wrote: > > [snip] > >> I said the *builtins* section. I think you learn pretty quick that >> figuring out what functions are builtins is pretty important in every >> langu

Re: Hash functions

2005-07-21 Thread Cyril Bazin
Maybe in certain case you could use hash to compare objects (hashable of course) quicker by comparing there hash values, if the hash values are the same you test the equality between the objects. But the sets and dicts cover the greatest part of the use of hash. (Personally, I never used that exp

Re: Difference between " and '

2005-07-21 Thread muldoon
[EMAIL PROTECTED] wrote: > Hi, > > Can someone tell me the difference between single quote and double > quote? > > Thanks And please settle the dispute between "xxx". And "xxx". There was a fellow at Oxford who decided these things but I hear he went mad. -- http://mail.python.org/mailma

Re: PEP on path module for standard library

2005-07-21 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: > I really love Jason's 'path' module. Sadly, I've encountered a serious > problem with using it. When you try to 'freeze' an application module, > and Jason's 'path' module is present in any of the directories that are > looked at by freeze's module finder (your app does

  1   2   >