Re: Little Q: how to print a variable's name, not its value?

2005-03-31 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > But surely if you create an integer object and assign it a value, e.g. > a = 3, > why shouldn't Python be able to tell you something like the following: > name(a) >>> 'a' > ? But why should it return 'a' and not one of these? tokenize.tok_name[3] token.tok_name[3] sre

Re: Little Q: how to print a variable's name, not its value?

2005-03-31 Thread Bengt Richter
On 30 Mar 2005 21:56:06 -0800, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >my god, I've created a monster! > >Maybe I should restate my original problem. Actually, the word >'problem' is too strong. I had a little curiosity about whether I could >write a couple of lines of code more succinctly

Re: Little Q: how to print a variable's name, not its value?

2005-03-31 Thread Bill Mill
On 31 Mar 2005 08:13:30 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > But surely if you create an integer object and assign it a value, e.g. > > a = 3, > > why shouldn't Python be able to tell you something like the following: > > name(a) >>> 'a' > > ? > > But why

Re: Little Q: how to print a variable's name, not its value?

2005-03-31 Thread Bill Mill
On Thu, 31 Mar 2005 03:33:10 -0500, Bill Mill <[EMAIL PROTECTED]> wrote: > On 31 Mar 2005 08:13:30 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > > > > > But surely if you create an integer object and assign it a value, e.g. > > > a = 3, > > > why shouldn't Python be ab

Re: More decorator rumination

2005-03-31 Thread Peter Otten
Scott David Daniels wrote: > In particular, I thought about something like: > > @mousexy > def OnRightClick(self, x, y): > ... You could somewhat generalize the idea -- have one argument in the wrapper function provide the arguments missing in the wrapped one. Here is a self-contained example,

Re: LD_LIBRARY_PATH - how to set?

2005-03-31 Thread Serge Orlov
Roman Yakovenko wrote: > Hi. I have small problem. I need to load extension module that depends > on shared library. Before actually importing module I tried to edit > os.environ or to call directly to os.putenv without any success - > shared library was not found. I tried to search the Internet fo

Formated String in optparse

2005-03-31 Thread Norbert Thek
Hi I'm using Python 24 on Windows > (2k) Is there an easy way to convince optparse to accept newline in the helpstring? and more importand also in the 'desc' string. I tried everything (from the os.linesep) to \n, \r, \r\n, ... Norbert -- http://mail.python.org/mailman/listinfo/python-list

Re: Little Q: how to print a variable's name, not its value?

2005-03-31 Thread Aaron Bingham
Stewart Midwinter <[EMAIL PROTECTED]> writes: [snip] > Taking this idea a little further, I'd like to build a 'variable > inspector' for my GUI app, so that I don't have to resort to debug > statements. Instead, I could pop open a window that lists every > variable that has an expected None, str

Re: UnicodeEncodeError in string conversion

2005-03-31 Thread Serge Orlov
Maurice LING wrote: > Hi, > > I'm working on a script that searches a public database and retrives > results using SOAP interface. However, it seems that the results may > contains unicodes. When I try to pump the results into Firebird database > using kinterbasdb module, some results will give me

py2exe sf.net hosed???

2005-03-31 Thread #
download py2exe from here: http://kent.dl.sourceforge.net/sourceforge/py2exe/py2exe-0.3.3.win32-py1.5.exe -- http://mail.python.org/mailman/listinfo/python-list

The value exceptions are raised with (odd behaviour?)

2005-03-31 Thread Ola Natvig
When raising an exception with a value for instance an integer you assume that when catching the exception the value can be compared with other integers. That is not what happens. try: raise Exception, 12 except Exception, number: print number == 12 # False This is because the number var

Re: The value exceptions are raised with (odd behaviour?)

2005-03-31 Thread Ola Natvig
Ola Natvig wrote: When raising an exception with a value for instance an integer you assume that when catching the exception the value can be compared with other integers. That is not what happens. try: raise Exception, 12 except Exception, number: print number == 12 # False This is beca

Re: Formated String in optparse

2005-03-31 Thread Peter Otten
Norbert Thek wrote: > Is there an easy way to convince optparse to accept newline in the > helpstring? and more importand also in the 'desc' string. I tried > everything > (from the os.linesep) to \n, \r, \r\n, ... The "official" way (write your own Formatter class) is a bit tedious indeed. Here

Re: LD_LIBRARY_PATH - how to set?

2005-03-31 Thread Roman Yakovenko
On 31 Mar 2005 00:51:21 -0800, Serge Orlov <[EMAIL PROTECTED]> wrote: > Roman Yakovenko wrote: > > Hi. I have small problem. I need to load extension module that > depends > > on shared library. Before actually importing module I tried to edit > > os.environ or to call directly to os.putenv without

Re: PIL

2005-03-31 Thread Denis S. Otkidach
On Wed, 30 Mar 2005 08:33:44 -0800 (PST) suresh mathi wrote: SM> All 3 images that i try to paste are having a SM> transparent background. SM> When i try to open the image and paste the background SM> becomes black. I masked the black areas but still the SM> shape is not that clear. I had similar

Re: is there a problem on this simple code

2005-03-31 Thread jrlen balane
hi! could anyone give their input on my previous post about timer and threading...] pleaseee... my program seemed to just run first the thread then when it encounters error on the thread that's the time that other part of the program got the chance to be executed even the timer even is not execute

Re: PIL

2005-03-31 Thread Laszlo Zsolt Nagy
suresh mathi wrote: I use PIL for image manipulation. For drawing rectangles and other shapes PIL was really good. Now i am trying to paste 3 images into a single image. All 3 images that i try to paste are having a transparent background. When i try to open the image and paste the background becom

Re: Secure scripts variables

2005-03-31 Thread Paul Rubin
Florian Lindner <[EMAIL PROTECTED]> writes: > AFAIK scripts can't be setuid? Can you tell me what you mean and how to do > it? Actually it looks like Linux doesn't support setuid scripts. I thought the feature had been restored. There is a well-known security hole but there are workarounds for i

Re: Formated String in optparse

2005-03-31 Thread MyHaz
If you haven't looked into it, you may like the way class OptionParser() makes the help text for you. - Haz -- http://mail.python.org/mailman/listinfo/python-list

Re: Formated String in optparse

2005-03-31 Thread Peter Otten
MyHaz wrote: > If you haven't looked into it, you may like the way class > OptionParser() makes the help text for you. What do you mean? To clarify: OptionParser's help message in the default format is """ usage: discard_newline.py [options] einsamer nie als im august erfuellungsstunde im gela

Re: [Tkinter] LONG POST ALERT: Setting application icon on Linux

2005-03-31 Thread Tim Jarman
Jeff Epler wrote: > I have written a rather hackish extension to use NET_WM_ICON to set > full-color icons in Tkinter apps. You can read about it here: > http://craie.unpy.net/aether/index.cgi/software/01112237744 > you'll probably need to take a look at the EWMH spec, too. If KDE > supports

property and virtuality

2005-03-31 Thread Laszlo Zsolt Nagy
My problem is about properties and the virtuality of the methods. I would like to create a property whose get and set methods are virtual. I had the same problems in Delphi before and the solution was the same. I created a private _get method and a public get method. The former one will call the

no module named fcntl

2005-03-31 Thread Prakash A
Hello All,           I new user to python. I am using a product called FSH, some of its parts are implemented in Python. This is like a ssh to run a command on remote machine. First time while running the fsh there was on.       # fshd         Traceback (most recent call last):         

Re: How To Do It Faster?!?

2005-03-31 Thread Laszlo Zsolt Nagy
[EMAIL PROTECTED] wrote: Hello NG, in my application, I use os.walk() to walk on a BIG directory. I need to retrieve the files, in each sub-directory, that are owned by a particular user. Noting that I am on Windows (2000 or XP), this is what I do: for root, dirs, files in os.walk(MyBIGDirecto

Re: property and virtuality

2005-03-31 Thread Diez B. Roggisch
> I cannot override C2._getname instead, because c2.name would print > 'Test2" instead of lala. Clearly, the property stores a reference to the > get and set methods and it is not possible to have it use the new > methods. Creating a new property is the worst - need to duplicate code > and also C3

Re: LD_LIBRARY_PATH - how to set?

2005-03-31 Thread Joal Heagney
Roman Yakovenko wrote: Thanks for help. But it is not exactly solution I am looking for. I would like to do it from python script. For example update_env() #<- this function will change LD_LIBRARY_PATH import extension_that_depends_on_shared_library Roman On Mar 31, 2005 9:35 AM, John Abel <[EMAIL

Re: LD_LIBRARY_PATH - how to set?

2005-03-31 Thread Joal Heagney
Joal Heagney wrote: Roman Yakovenko wrote: Thanks for help. But it is not exactly solution I am looking for. I would like to do it from python script. For example update_env() #<- this function will change LD_LIBRARY_PATH import extension_that_depends_on_shared_library Roman On Mar 31, 2005 9:35 AM

Re: math - need divisors algorithm

2005-03-31 Thread Joal Heagney
Ed Suominen wrote: Philp Smith wrote: Hi Does anyone have suggested code for a compact, efficient, elegant, most of all pythonic routine to produce a list of all the proper divisors of an integer (given a list of prime factors/powers) Is this compact enough? :-) def properDivisors(N): return

Error

2005-03-31 Thread Bounced mail
The original message was received at Thu, 31 Mar 2005 14:40:33 +0200 from python.org [34.34.108.175] - The following addresses had permanent fatal errors - - Transcript of the session follows - ... while talking to 136.158.179.151: >>> DATA <<< 400-aturner; -RMS-E-CRE, ACP file

Re: LD_LIBRARY_PATH - how to set?

2005-03-31 Thread Antoon Pardon
Op 2005-03-31, Joal Heagney schreef <[EMAIL PROTECTED]>: > Joal Heagney wrote: >> Roman Yakovenko wrote: >> >>> Thanks for help. But it is not exactly solution I am looking for. I >>> would like to do it from python script. For example >>> >>> update_env() #<- this function will change LD_LIBRARY_

How To Do It Faster?!?

2005-03-31 Thread andrea . gavana
Hello NG, in my application, I use os.walk() to walk on a BIG directory. I need to retrieve the files, in each sub-directory, that are owned by a particular user. Noting that I am on Windows (2000 or XP), this is what I do: for root, dirs, files in os.walk(MyBIGDirectory): a = os.popen

Re: property and virtuality

2005-03-31 Thread Laszlo Zsolt Nagy
I'm not aware of possibility that works as you first expected. You yourself explained why. But _maybe_ you can use lambda here - that creates the layer of indirection one needs. foo = property(lambda self: self.get_foo(), lamda self,v: self.set_foo(v)) Great. I'll think about this and decide w

Rif: Re: How To Do It Faster?!?

2005-03-31 Thread andrea . gavana
Hello Lazslo & NG, >You can use the stat module to get attributes like last modification >date, uid, gid etc. The documentation of the stat module has a nice >example. Probably it will be faster because you are running an external >program (well, "dir" may be resident but still the OS needs to cr

hex string into binary format?

2005-03-31 Thread Tertius Cronje
Hi, How do I get a hexvalued string to a format recognized for binary calculation? import binascii s1 = '1C46BE3D9F6AA820' s2 = '8667B5236D89CD46' i1 = binascii.unhexlify(s1) i2 = binascii.unhexlify(s2) x = i1 ^i2 TypeError: unsupported operand type(s) for ^: 'str' and 'str' Many TIA

Generating RTF with Python

2005-03-31 Thread Andreas Jung
Hi, does anyone know of a high-level solution to produce RTF from Python (something similar to Reportlab for producing PDF)? Thanks, Andreas pgptlX6o8zD33.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

RE: Generating RTF with Python

2005-03-31 Thread Tertius Cronje
I'll use http://www.tug.org/ or a smaller solution http://lout.sourceforge.net/ together with one of many Python template solutions to generate to generate reports. HTH T > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Andreas Jung > Sent: Thursda

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: 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: property and virtuality

2005-03-31 Thread Diez B. Roggisch
> Great. I'll think about this and decide which is better - lamba or > private functions. Lambda seems much > shorter but it is not as clear why it is there. :-) I did put comments above each property line - so one might argue that's about the same effort as writing the method explicit. Alternativ

Re: Rif: Re: How To Do It Faster?!?

2005-03-31 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Am I missing something on the stat module? I'm running Python 2.3.4. > Yes, you are missing that this is more unix-like. It seems to work in a certain degree on windows - but as the user-model between unix and windows is considerably different, you found a not-so-well w

Re: returning a list: IndexError

2005-03-31 Thread shama . bell
Thats right. I wanted c1 and c2 to retrieve the values returned by t1 and t2 . Values for t1 and t2 could be anything. Also tbl is global. -SB -- http://mail.python.org/mailman/listinfo/python-list

Recording Video with Python

2005-03-31 Thread googlemike
Is there a video module so that I can write a Linux Python script to record video coming over USB video cams? What about these side-thoughts: * What about recording multiple streams over multiple USB ports? (Think in the context of a security system.) * What about lossy compression? * What abou

Re: Making a DLL with python?

2005-03-31 Thread Larry Bates
I don't think you can make a .DLL (but someone else might). Why can't you use a COM server? MS seems to have written some pretty sophisticated software using COM objects. Almost all languages can dispatch a COM object easily. -Larry [EMAIL PROTECTED] wrote: > Can I use python to make a regular

Re: How To Do It Faster?!?

2005-03-31 Thread Aquila Deus
[EMAIL PROTECTED] wrote: > Hello NG, > > in my application, I use os.walk() to walk on a BIG directory. I need > to retrieve the files, in each sub-directory, that are owned by a > particular user. Noting that I am on Windows (2000 or XP), this is what I > do: > > for root, dirs, files in os.

Re: urllib.urlretireve problem

2005-03-31 Thread Wade
Diez B. Roggisch wrote: > It makes no sense having urllib generating exceptions for such a case. From > its point of view, things work pefectly - it got a result. No network error > or whatsoever. > > Its your application that is not happy with the result - but it has to > figure that out by itsel

Re: How To Do It Faster?!?

2005-03-31 Thread Max Erickson
I don't quite understand what your program is doing. The user=a[18::20] looks really fragile/specific to a directory to me. Try something like this: >>> a=os.popen("dir /s /q /-c /a-d " + root).read().splitlines() Should give you the dir output split into lines, for every file below root(notice t

Re: Making a DLL with python?

2005-03-31 Thread Gerald Klix
I think you can, as long as you have a C-Compiler available. I used pyrex to embedd python into a Linux PAM-Module and i used C-Types to embbed Python into a Windows DLL. With hindsight, the pyrex solution was much fatser to develop and less complicated. Pyrex provides an example. Ctypes: http://

AttributeError: 'module' object has no attribute 'setdefaulttimeout'

2005-03-31 Thread adrian
I get those errors when I run: /usr/local/bin/SquidClamAV_Redirector.py -c /etc/squid/SquidClamAV_Redirector.conf ## Traceback (most recent call last): File "/usr/local/bin/SquidClamAV_Redirector.py", line 573, in ? redirector = SquidClamAV_Redirector(config) File "/usr/lo

Re: Recording Video with Python

2005-03-31 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Is there a video module so that I can write a Linux Python script to > record video coming over USB video cams? You can open the device and read the images - I've done that before. No module needed. But I don't remember how things worked - just download the source for a

Re: Making a DLL with python?

2005-03-31 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Can I use python to make a regular Windows DLL that will be called from > other programs? > > I know I can use the win32 extensions to make a COM server, but I need > a straight DLL. Maybe elmer is what you need - no own experiences though. http://www.python.org/moin/

Re: AttributeError: 'module' object has no attribute 'setdefaulttimeout'

2005-03-31 Thread Peter Otten
adrian wrote: > urllib.socket.setdefaulttimeout(self.timeout) > AttributeError: 'module' object has no attribute 'setdefaulttimeout' socket.setdefaulttimeout() was added in Python 2.3. You need to upgrade. Peter -- http://mail.python.org/mailman/listinfo/python-list

(no subject)

2005-03-31 Thread python-list-bounces+archive=mail-archive . com
#! rnews 1066 Newsgroups: comp.lang.python Path: news.xs4all.nl!newsspool.news.xs4all.nl!transit.news.xs4all.nl!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!attws2!ip.att.net!NetNews1!xyzzy!nntp From: Harry George <[EMAIL PROTECTED]> Subject: Re: hex string into binary format? X-Nn

Re: redundant imports

2005-03-31 Thread max(01)*
Tim Jarman wrote: max(01)* wrote: hi everybody. suppose that code-1.py imports code-2.py and code-3.py (because it uses names from both), and that code-2.py imports code-3.py. if python were c, code-1.c should only *include* code-2.c, because the latter in turns includes code-3.c. inclusion of mod

Re: property and virtuality

2005-03-31 Thread Michele Simionato
I think you may find Alex Martelli's PyCon slides somewhere on the net. The black magic slides discuss this issue. But I think the fix he suggests is not dissimilar from what you are already doing. I don't remember exactly now, but it is always worth a look. Michele Simionato -- http:

Re: redundant imports

2005-03-31 Thread max(01)*
Peter Hansen wrote: max(01)* wrote: hi everybody. suppose that code-1.py imports code-2.py and code-3.py (because it uses names from both), and that code-2.py imports code-3.py. if python were c, code-1.c should only *include* code-2.c, because the latter in turns includes code-3.c. inclusion o

Re: is there a problem on this simple code

2005-03-31 Thread Peter Hansen
jrlen balane wrote: hi! could anyone give their input on my previous post about timer and threading...] pleaseee... A few bits of unrequested advice which might help you get more and better responses (though the ones you have got in the past already appear to be above and beyond the call of duty, g

Re: Generating RTF with Python

2005-03-31 Thread Axel Straschil
Hello! > does anyone know of a high-level solution to produce RTF from Python=20 > (something similar to > Reportlab for producing PDF)? Spend hours of googeling and searching, also in this NG, about two months ago. My conclusion is: On windwos, maybe you can include some hacks with dll's, under

Re: urllib problem (maybe bugs?)

2005-03-31 Thread Timothy Wu
On Wed, 30 Mar 2005 18:25:56 +0200, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Timothy Wu wrote: > > > After I've done that it works fine for small SEQ values. Then, when I > > try to send large amount of data (1.4MB), it fails miserably with > > AttributeError exception. > > the page states that

Re: Rif: Re: How To Do It Faster?!?

2005-03-31 Thread Peter Hansen
[EMAIL PROTECTED] wrote: Unfortunately, on Windows it does not seem to work very well: st = os.stat('MyFile.txt') print st.st_uid 0 I don't think my user ID is 0... While with the OS dos command I get: userid: \\ENI\ag12905 I would recommend using the pywin32 support that almost certainly exists fo

Re: hex string into binary format?

2005-03-31 Thread Peter Hansen
Tertius Cronje wrote: How do I get a hexvalued string to a format recognized for binary calculation? import binascii s1 = '1C46BE3D9F6AA820' s2 = '8667B5236D89CD46' i1 = binascii.unhexlify(s1) i2 = binascii.unhexlify(s2) Try this instead: i1 = long(s1, 16) i2 = long(s2, 16) x = i1 ^i2 -- http://mai

Re: tkinter destroy()

2005-03-31 Thread max(01)*
[EMAIL PROTECTED] wrote: Your app seems to give the right state values only if you select 'Freni a posto'. But I see you recognize that with your 'FIXME' note. also the app seems to have too many variables and widgets defined as self objects. That isn't necessary unless they will be used outside

Re: redundant imports

2005-03-31 Thread Peter Hansen
max(01)* wrote: this leads me to another question. since *.pyc files are automatically created the first time an import statement in executed on a given module, i guess that if i ship a program with modules for use in a directory where the user has no write privileges then i must ship the *.pyc

Re: PyParsing module or HTMLParser

2005-03-31 Thread Paul McGuire
Yes, drop me a note if you get stuck. -- Paul base64.decodestring('cHRtY2dAYXVzdGluLnJyLmNvbQ==') -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib problem (maybe bugs?)

2005-03-31 Thread Diez B. Roggisch
> >> my guess is that the server shuts the connection down when you're send >> too much data to it. have you contacted the server administrators? (see >> the bottom of that page). > > I'll try to check on this. Thanks. However that > filling-in-incorrect-value-for-an-attribute error is still > u

ANN: PyDev 0.9.2 released

2005-03-31 Thread Fabio Zadrozny
Hi All, PyDev - Python IDE (Python development enviroment for Eclipse) version 0.9.2 has just been released. Check the homepage (http://pydev.sourceforge.net/) for more details. Regards, Fabio Zadrozny -- Software Developer ESSS - Engineering Si

Re: problem running the cgi module

2005-03-31 Thread Kent Johnson
chris patton wrote: Hi everyone. I'm trying to code an HTML file on my computer to make it work with the cgi module. For some reason I can't get it running. This is my HTML script: -- HOWDY! You don't seem to be using a web server at all here

Re: Generating RTF with Python

2005-03-31 Thread Max M
Axel Straschil wrote: Hello! does anyone know of a high-level solution to produce RTF from Python=20 (something similar to Reportlab for producing PDF)? Spend hours of googeling and searching, also in this NG, about two months ago. My conclusion is: On windwos, maybe you can include some hacks wit

Re: Access denied calling FireEvent in Python

2005-03-31 Thread calfdog
Regarding the call to FireEvent: I still do not understand why you could call fi­reEvent('onchange') and now it you have to call "Fi­reEvent('onchange')" to avoid the Access denied message In Ruby or Perl you still call "fi­reEvent('onchange')" it has not changed and you do not get the access den

Re: AttributeError: 'module' object has no attribute 'setdefaulttimeout'

2005-03-31 Thread infidel
That just means the urllib.socket module doesn't have any function named setdefaulttimeout in it. It appears there might be something wrong with your socket module as mine has it: py> import urllib py> f = urllib.socket.setdefaulttimeout py> f -- http://mail.python.org/mailman/listinfo/python-

A question about the use of PyArg_Parse function

2005-03-31 Thread Barak Azulay
Hi,   I hope I'm writing to the right place. In case I'm out of place can you please refer to the right direction.     I have a question about the correct way to use PyArg_Parse API function. I'm writing a C module to be called from python code  (ver 2.3.4)   In one of the function I have

Re: property and virtuality

2005-03-31 Thread Steven Bethard
Laszlo Zsolt Nagy wrote: My problem is about properties and the virtuality of the methods. I would like to create a property whose get and set methods are virtual. Perhaps you want to roll your own VirtualProperty descriptor? Here's one based off the property implementation in Raymond Hettinger'

Re: returning a list: IndexError

2005-03-31 Thread Steven Bethard
[EMAIL PROTECTED] wrote: Thats right. I wanted c1 and c2 to retrieve the values returned by t1 and t2 . Values for t1 and t2 could be anything. Also tbl is global. Then you need to return t1 and t2 in test, e.g.: py> import numarray as na py> tbl = na.zeros((32, 16)) py> def test(): ... t1 = 0x

Problem with national characters

2005-03-31 Thread Leif B. Kristensen
I'm developing a routine that will parse user input. For simplicity, I'm converting the entire input string to upper case. One of the words that will have special meaning for the parser is the word "før", (before in English). However, this word is not recognized. A test in the interactive shell rev

Re: Generating RTF with Python

2005-03-31 Thread Axel Straschil
Hello! > I looked at this a while ago, which might be a starter. > http://pyrtf.sourceforge.net/ Don't remember why I didn't spent much time on that. Sombody has experience with pyrtf on an production project (is it stable ;-)) Lg, AXEL. -- "Aber naja, ich bin eher der Forentyp." Wolfibolfi's o

Re: urllib.urlretireve problem

2005-03-31 Thread Ritesh Raj Sarraf
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Diez B. Roggisch wrote: > You could for instance try and see what kind of result you got using the > unix file command - it will tell you that you received a html file, not a > deb. > > Or check the mimetype returned - its text/html in the error case

split an iteration

2005-03-31 Thread Robin Becker
This function from texlib in oedipus.sf.net is a real cpu hog and I determined to see if it could be optimized. def add_active_node(self, active_nodes, node): """Add a node to the active node list. The node is added so that the list of active nodes is always sorted by line number, and

Re: Turn of globals in a function?

2005-03-31 Thread Ron_Adam
On Thu, 31 Mar 2005 16:28:15 +1200, Greg Ewing <[EMAIL PROTECTED]> wrote: >Oren Tirosh wrote: >> def noglobals(f): >> . import new >> . return new.function( >> . f.func_code, >> . {'__builtins__':__builtins__}, >> . f.func_name, >> . f.func_defaults, >> . f.fun

ANN: ActivePython 2.4.1 build 245 is available

2005-03-31 Thread Trent Mick
I'm pleased to announce that ActivePython 2.4.1 build 245 is now available from: http://www.ActiveState.com/Products/ActivePython ActivePython 2.4.1.245 is a bug-fix release matching the recent core Python 2.4.1 release. ActivePython builds for Linux, Solaris and Windows are available. We w

Re: AttributeError: 'module' object has no attribute 'setdefaulttimeout'

2005-03-31 Thread Steve Holden
Peter Otten wrote: adrian wrote: urllib.socket.setdefaulttimeout(self.timeout) AttributeError: 'module' object has no attribute 'setdefaulttimeout' socket.setdefaulttimeout() was added in Python 2.3. You need to upgrade. Peter Alternatively you might still be ablet o get Tom O'Malley's tiemouts

Re: Little Q: how to print a variable's name, not its value?

2005-03-31 Thread Ron_Adam
On 30 Mar 2005 08:43:17 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote: >Here is a rough attempt at printing the names of a variable. It will pick >up several names where appropriate, but deliberately doesn't attempt to >get all possible names (as you say, that could result in endless loops). >In par

Re: split an iteration

2005-03-31 Thread Peter Otten
Robin Becker wrote: > Is there a fast way to get enumerate to operate over a slice of an > iterable? I think you don't need that here: e = enumerate(active_nodes) for insert_index, a in e: # ... for index, a in e: # ... Peter -- http://mail.python.org/mailman/listinfo/python-list

Printing Varable Names Tool.. Feedback requested.

2005-03-31 Thread Ron_Adam
Hi, Sometimes it just helps to see what's going on, so I've been trying to write a tool to examine what names are pointing to what objects in the current scope. This still has some glitches, like not working in winpython or the command line, I get a 'stack not deep enough' error. I haven't tes

Re: hiding a frame in tkinter

2005-03-31 Thread faramarz yari
thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Printing Varable Names Tool.. Feedback requested.

2005-03-31 Thread Ron_Adam
On Thu, 31 Mar 2005 18:37:53 GMT, Ron_Adam <[EMAIL PROTECTED]> wrote: > >Hi, Sometimes it just helps to see what's going on, so I've been >trying to write a tool to examine what names are pointing to what >objects in the current scope. > >This still has some glitches, like not working in winpyth

Re: problem running the cgi module

2005-03-31 Thread chris patton
Thanks alot. This helps tremendously -- http://mail.python.org/mailman/listinfo/python-list

How To Do It Faster?!?

2005-03-31 Thread andrea_gavana
Hello max & NG, >I don't quite understand what your program is doing. The user=a[18::20] >looks really fragile/specific to a directory to me. I corrected it to user=a[18::5][:-2], it was my mistake. However, that command is NOT specific to a particular directory. You can try to whatever directory

Stylistic question about inheritance

2005-03-31 Thread Andrew Koenig
Suppose I want to define a class hierarchy that represents expressions, for use in a compiler or something similar. We might imagine various kinds of expressions, classified by their top-level operator (if any). So, an expression might be a primary (which, in turn, might be a variable or a con

Change between Python 2.3 and 2.4 under WinXP

2005-03-31 Thread Franz Steinhäusler
Hello, My second question from my last post (PyQt on Python 2.4), I think, is a little got under (i have installed both Python 2.3 and Python 2.4) Is there any possibility under WinXP, to alterntate quickly (with batch file or similary) between python23 and python24. Many thanks, -- Franz Ste

Controling the ALU

2005-03-31 Thread Cesar Andres Roldan Garcia
Hi How can I control an ALU from a PC using Python? Thanks! Hola... Como puedo controlar la ALU de un PC usando Pyhton? Gracias! -- Atentamente, Cesar Andres Roldan Garcia Presidente Comunidad Académica Microsoft Javeriana Teléfono: 300 8169857 Cali - Colombia -- http://mail.python.org/mai

Re: Stylistic question about inheritance

2005-03-31 Thread Carl Banks
Andrew Koenig wrote: [snip] > Of course, there are reasons to have a base class anyway. For example, I > might want it so that type queries such as isinstance(foo, Expr) work. My > question is: Are there other reasons to create a base class when I don't > really need it right now? Well, Python

Re: Stylistic question about inheritance

2005-03-31 Thread "Martin v. Löwis"
Andrew Koenig wrote: Of course, there are reasons to have a base class anyway. For example, I might want it so that type queries such as isinstance(foo, Expr) work. My question is: Are there other reasons to create a base class when I don't really need it right now? You would normally try to a

Re: Stylistic question about inheritance

2005-03-31 Thread Lonnie Princehouse
If you try this sort of inheritance, I'd recommend writing down the formal grammar before you start writing classes. Don't try to define the grammar through the inheritance hierarchy; it's too easy to accidentally build a hierarchy that can't be translated into a single-pass-parsable grammar... I

Re: Stylistic question about inheritance

2005-03-31 Thread Andrew Koenig
"Carl Banks" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Well, Python seems to get along fine without the ability to do > isinstance(foo,file_like_object); probably better off in the end for > it. So I'd say you should generally not do it. Inheritence is for > when different c

Re: Stylistic question about inheritance

2005-03-31 Thread Andrew Koenig
""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You would normally try to avoid type queries, and rely on virtual > methods instead, if possible. Of course. > It seems likely for the application > that code can be shared across different subclasses, for example

Re: Change between Python 2.3 and 2.4 under WinXP

2005-03-31 Thread "Martin v. Löwis"
Franz Steinhäusler wrote: Is there any possibility under WinXP, to alterntate quickly (with batch file or similary) between python23 and python24. No need to change between them. Just install them both, and select which one to use on a per-invocation base. I.e. do c:\python23\python.exe foo.py c:\

Re: Stylistic question about inheritance

2005-03-31 Thread Andrew Koenig
"Lonnie Princehouse" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > If you try this sort of inheritance, I'd recommend writing down the > formal grammar before you start writing classes. Don't try to define > the grammar through the inheritance hierarchy; it's too easy to > accide

Re: Stylistic question about inheritance

2005-03-31 Thread Irmen de Jong
Andrew Koenig wrote: > "Lonnie Princehouse" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > >>If you try this sort of inheritance, I'd recommend writing down the >>formal grammar before you start writing classes. Don't try to define >>the grammar through the inheritance hierar

Re: Controling the ALU

2005-03-31 Thread Grant Edwards
On 2005-03-31, Cesar Andres Roldan Garcia <[EMAIL PROTECTED]> wrote: > How can I control an ALU from a PC using Python? The ALU is buried pretty deep in the CPU. The ALU is part of what is actually executing the instructions that _are_ Python. -- Grant Edwards grante

Re: Stylistic question about inheritance

2005-03-31 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "Andrew Koenig" <[EMAIL PROTECTED]> wrote: > "Carl Banks" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > Well, Python seems to get along fine without the ability to do > > isinstance(foo,file_like_object); probably better off in the end for

RE: IMAP4.search by message-id ?

2005-03-31 Thread Sean Dodsworth
Tony Meyer wrote: >> Can anyone tell me how to get a message's number from the message-id >> using IMAP4.search? >> I've tried this: >> resp, items = server.search(None, 'HEADER', >> '"Message-id"', msgID) but it gives me a 'bogus search criteria' error > import imaplib i = imaplib.

  1   2   >