Re: building Python: up arrow broken on SuSE Linux 8.2

2005-01-28 Thread Peter Otten
readline 4.0 and 4.2, so version 4.3 should be sufficient. So let me ask you again, you have both the readline and the readline-devel package installed? If yes, and configure still complains, it may be time to look for something entirely different... Peter -- http://mail.python.org/mailman/lis

Re: get list of member variables from list of class

2005-01-28 Thread Peter Otten
tertools import imap >>> items_a = List(items, attrgetter("a")) >>> items_a <__main__.List instance at 0x402ae2cc> >>> items_a[2] 2 >>> list(items_a) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> items[2] = A(42) >>> items [A(0), A(1), A(42), A(3), A(4), A(5), A(6), A(7), A(8), A(9)] >>> items_a[2] 42 Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Hey, get this! [was: import from database]

2005-01-28 Thread Peter Otten
all last): File "", line 1, in ? File "arbitrary.py", line 2, in ? import not_there ImportError: No module named not_there >>> import arbitrary Traceback (most recent call last): File "", line 1, in ? File "arbitrary.py", line 2, in ? import not_there ImportError: No module named not_there >>> Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: future of computing languages

2005-01-29 Thread Peter Hansen
with what appear to be a random collection of wild predictions about the future, and Python is barely mentioned in any case. Perhaps you could take the time to write a little about just *what* you found so "Amazin"... -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: cx_freeze error

2005-01-29 Thread Peter Hansen
Possibly do not use the name "re.py" for your own module, as it is the name of a standard library module as well. At least, that's what an analysis of line 81 of "textwrap.py" suggests might be your problem. Do you have a module named "re.py"? -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: cx_freeze error

2005-01-29 Thread Peter Hansen
"re" kicking around that shouldn't be there, or cx_freeze is doing something weird... at least, those are the only theories that come to mind. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: cx_freeze error

2005-01-29 Thread Peter Hansen
xtwrap.py module is being imported by cx_freeze, it is not finding the correct "re" module when it imports it. I don't know anything about cx_freeze, and I don't have an appropriately configured Linux box to help troubleshoot, so I can't help further, but maybe somebody else

Re: Disassembling strings and turning them into function parameters

2005-01-30 Thread Peter Hansen
s to a function like ftp_connect(ip, port, user, pw) etc...? I have no idea how to "break" the string up so I can get these out of it.. The .split() method of strings should work for you. If you need more, provide more background... and maybe let us know that this isn't homework. ;-) -P

Re: variable declaration

2005-01-31 Thread Peter Otten
a function, though: $ cat epsilon.py def loop(): epsilon=0 S=0 while epsilon<10: S=S+epsilon epselon=epsilon+1 print S $ pychecker epsilon.py Processing epsilon... Warnings... epsilon.py:6: Local variable (epselon) not used Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Next step after pychecker

2005-02-01 Thread Peter Maas
ogram with pychecker. -- --- Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0 E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64') --- -- http://mail.python.org/mailman/listinfo/python-list

Re: The next Xah-lee post contest

2005-02-01 Thread Peter Hansen
Arthur wrote: Steve Holden <[EMAIL PROTECTED]> wrote: Would there, I wonder, be any enthusiasm for a "Best Xah Lee impression" prize at PyCon? And the rules of the game, if he shows? Arthur, if Xah Lee shows up at Pycon, he most definitely will not be giving the best impr

Re: The next Xah-lee post contest

2005-02-01 Thread Peter Hansen
Luis M. Gonzalez wrote: Peter Hansen wrote: Arthur wrote: And the rules of the game, if he shows? Arthur, if Xah Lee shows up at Pycon, he most definitely will not be giving the best impression... Have you visited his website? I kind of like this guy... it's like he has a few bugs in his

ftplib help - delete from server after download results in 0-byte file

2005-02-01 Thread Peter A.Schott
Got a strange scenario going on here in that I could have sworn this worked yesterday. I am issuing binary retrieval calls to an FTP server, writing to a file, close the file, then removing the file from the remote site. When I do this, I end up with 0 byte files. I was hoping to avoid parsing a

Re: Python Code Auditing Tool

2005-02-02 Thread Peter Hansen
n those cases (although I personally would prefer a different name than "Error") there's often no good alternative to making your own unique module-specific Exception subclass. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: new style exception handleing

2005-02-02 Thread Peter Hansen
to need to base an exception on a new-style class, but perhaps you have a good one... -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: SUCCESS!

2005-02-03 Thread Peter Otten
> Thanks again for your help! :) You're welcome. Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Basic file operation questions

2005-02-03 Thread Peter Nuttall
On Wed, Feb 02, 2005 at 11:47:41PM -0500, Caleb Hattingh wrote: > Hi Alex > > Assuming you have a file called "data.txt": > > *** > f = open('data.txt','r') > lines = f.readlines() > f.close() > for line in lines: > print line > *** > Can you not write this: f=open("data.txt", "r") for line

Re: Generating modul classes with eval

2005-02-03 Thread Peter Otten
gt; text = "gamma" >>> classes[0]() gamma <__main__.T instance at 0x402a9f8c> One way to fix this is to introduce a factory function: >>> def make_class(text): ... class T: ... def __init__(self): print text ... return T ... >>> cla

Re: Basic file operation questions

2005-02-03 Thread Peter Otten
Peter Nuttall wrote: > On Wed, Feb 02, 2005 at 11:47:41PM -0500, Caleb Hattingh wrote: >> Hi Alex >> >> Assuming you have a file called "data.txt": >> >> *** >> f = open('data.txt','r') >> lines = f.readlines() >

Re: Finding user's home dir

2005-02-03 Thread Peter Hansen
f "user folders" named like "C:\Documents and Settings\Peter" and prefer to create sensible folder like c:\users\peter and set a HOME variable to point to it. Your approach ignores our HOME variable. c:\>python Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)

Re: Finding user's home dir

2005-02-03 Thread Peter Hansen
Bernhard Herzog wrote: Peter Hansen <[EMAIL PROTECTED]> writes: Miki Tebeka wrote: Hi all, I'm trying to write a multiplatform function that tries to return the actual user home directory. ... What's wrong with: from user import home which does about what your code does. :-) I s

Re: Is there a market for python developers?

2005-02-03 Thread Peter Hansen
Mabon Dane wrote: I am new to python and took my first attempts at working with this language today. Is there a market for people who work with Python? Yes. -- http://mail.python.org/mailman/listinfo/python-list

Re: Basic file operation questions

2005-02-03 Thread Peter Otten
ot;fileobject.c")' 'while 1:' ' if not f.readline(): break' 100 loops, best of 3: 2.08 msec per loop So not only is for line in file(...): # do stuff the most elegant, it is also the fastest. file.readlines() comes close, but is only viable for "small" files. Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding user's home dir

2005-02-03 Thread Peter Hansen
ariable substitution generally or ever has "lazy evaluation" semantics...) Now that I know how to do what Duncan described (thanks Duncan!), either approach works for me. Of course, whether I'm a likely eventual user of your particular program is an entirely different question. ;-) -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: returning True, False or None

2005-02-04 Thread Peter Otten
s not None: return item or True in it Not as elegant as max(), but makes me wonder whether a max() that accepts an additional upper_bound argument and returns upper_bound as soon as it encounters a value >= upper_bound would be worth the effort. Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: variable declaration

2005-02-05 Thread Peter Otten
Alexander Zatvornitskiy wrote: > ÐÑÐÐÐÑ Peter! > > 31 ÑÐÐÐÑÑ 2005 Ð 09:09, Peter Otten Ð Ñ ÐÐÑÑÐÐ Ð All > ÐÐÑÐÐ: > PO> pychecker may help you find misspelled variable names. You have to > PO> move the code into a function, though: > > PO> $ cat

Re: extreme newbie

2005-06-18 Thread Peter Hansen
might be trying to profit from your efforts without your permission, you'll either be in a good position to ignore them or sue them, as you will -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Unbound names in __del__

2005-06-18 Thread Peter Hansen
Torsten Bronger wrote: > Peter Hansen <[EMAIL PROTECTED]> writes: >>What's your use case for del? > > Every instance represents a "session" to a measurement instrument. > After the instance is deleted, the session should be closed to free > resources. Yo

Re: thread.start_new_thread question

2005-06-18 Thread Peter Hansen
if you use the "threading" module, as is recommended, you won't have to deal with this issue at all, and your code will generally be simpler. (To answer your real question I'd have to check the docs for "thread" and, since I _never_ use that module in spite of heavy use

Re: How should threads be terminated? (related to 'Help with thread related tracebacks')

2005-06-18 Thread Peter Hansen
Maxwell Hammer wrote: > On Thu, 16 Jun 2005 16:20:23 -0400, Peter Hansen wrote: >>If the question was well formulated, and it's been more than a couple of >>days, you should consider reposting. It's very unusual for a post with >>such a subject (if it was a clear

Re: Shortcut to initialize variables

2005-06-18 Thread Peter Hansen
avy of a project to learn the language? Not at all, provided you're somewhat expert in the domain already, and are just using it as a means to help learn Python. If you are learning both Python and how to break ciphers at the same time, I'd personally call it a "little" he

Re: case/switch statement?

2005-06-18 Thread Peter Hansen
D H wrote: > Peter Hansen wrote: [some stuff Doug didn't like] > I don't think you could have misread my simple suggestion to you any > more completely than you did. Sorry, I'll try harder next time. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: regarding popen function

2005-06-18 Thread Peter Hansen
asking. Yes, it's an appropriate way to use popen(), and it does seem to work if you have tai64nlocal in your path. (Michael, tai64nlocal is a program that converts a special "packed" timestamp to human-readable form. These timestamps are created, as I recall, by the multilog program that the developer of Qmail created.) -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: What is different with Python ?

2005-06-18 Thread Peter Hansen
D H wrote: > Peter Hansen wrote: >> With respect to the author, and an understanding that there is >> probably much that didn't go into his self-description (add >> "about.htm" to the above URL), it sounds as though he knows primarily, >> perhaps

Re: pysqlite - Checking the existance of a table

2005-06-18 Thread Peter Hansen
l_name TEXT, rootpage INTEGER, sql TEXT ); -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: extreme newbie

2005-06-18 Thread Peter Hansen
ng on the second is entirely up to you. ;-) (I recall hearing of at least one programmer who made his first million around the age of 14 after having written some brilliant game back in the days of Apple IIs and C-64s. These days I'd be surprised if 14 was still the lower limit for millionair

Re: Unbound names in __del__

2005-06-18 Thread Peter Hansen
it and, unfortunately, unreliable nature of __del__. (Which is probably the real wart in Python, unfortunately.) -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Unbound names in __del__

2005-06-18 Thread Peter Hansen
working directly with you. I guess you'll have to explore the __del__ approach through to its conclusion before you'll be confident it won't work (or perhaps you'll find a solution after all!). -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there something similar to ?: operator (C/C++) in Python?

2005-06-18 Thread Peter Hansen
follows, but you'd do well to read all the entries: http://www.python.org/doc/faq/programming.html#is-there-an-equivalent-of-c-s-ternary-operator -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: extreme newbie

2005-06-19 Thread Peter Hansen
en source movement continues to prove successful. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: functions with unlimeted variable arguments...

2005-06-20 Thread Peter Hansen
they avoid making themselves look like complete and utter fools by appearing to learn only by looking up things in the index. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there something similar to ?: operator (C/C++) in Python?

2005-06-20 Thread Peter Hansen
D H wrote: > Peter Hansen wrote: >> Bo Peng wrote: >> >>> I need to pass a bunch of parameters conditionally. In C/C++, I can do >>> func(cond1?a:b,cond2?c:d,.) >>> >>> Is there an easier way to do this in Python? >> >> Please read

Re: Couple functions I need, assuming they exist?

2005-06-20 Thread Peter Hansen
arithmetic problems of various types. > > The target of the problems (my daughter) would prefer that the thousands > be delimited. Is there a string function that does this? You refer to something like putting a comma between groups of three digits, as in 1,000? This is locale-specifi

Re: Python choice of database

2005-06-20 Thread Peter Hansen
t ZODB). I believe Durus is pure Python, but it might have some C code for performance (like ZODB). It's not SQL, and should perhaps be thought of (as it describes itself) as an object persistence solution, rather than a "database". -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Python choice of database

2005-06-20 Thread Peter Hansen
a .pyd which contains a statically linked version of the complete SQLite library. No additional installation is required, making it an even simpler solution than I thought at first. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: getting list of all available modules

2005-06-21 Thread Peter Otten
king into that file, a suspiciously named ModuleScanner class is right over there. Now what is your excuse for not finding it yourself in the first place? You seem to be on Linux, so "That's not how I do it with Visual Basic" can't be it :-) Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: FAQ: __str__ vs __repr__

2005-06-21 Thread Peter Hansen
Simon Brunning wrote: > On 6/15/05, Peter Hansen <[EMAIL PROTECTED]> wrote: >>__repr__ shouldn't be anything, if you don't have an actual need for it. >> Neither should __str__. > > Oh, I don't know. __str__ is so frequently useful in debugging and &g

Re: eval() in python

2005-06-21 Thread Peter Hansen
Xah Lee wrote: > the doc seems to suggest that eval is only for expressions... it says > uses exec for statements, but i don't seem to see a exec function? Because it's a statement: http://docs.python.org/ref/exec.html#l2h-563 -- http://mail.python.org/mailman/listinfo/python-list

Re: A tool for Python - request for some advice

2005-06-21 Thread Peter Maas
you were fishing for compliments: Your English IS good enough. ;) -- ------- Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0 E-mail 'cGV0ZXIubWFhc0BtcGx1

Re: Python choice of database

2005-06-21 Thread Peter Hansen
In the case of bitmaps, this might well be a deciding factor, but each case should be addressed on its own merits.) -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: asynchronous comunication, wxPython and threads.

2005-06-21 Thread Peter Hansen
confirmation socket will > arrive in the correct order (one after each sended socket)? No more so than using threads, unless your problem is caused by the threads themselves (as I suggested above) in which case it might be easier to just fix the problem. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: A World Beyond Capitalism 2005, An Annual International Multiracial Alliance Building Peace Conference Is Accepting Proposals...

2005-06-22 Thread Peter Hansen
w.afilias.info/cgi-bin/whois.cgi . (It's registered to something called the Institute of Pamela, which seems to stand for "Peaceful Alliances facilitated by Multilingual, multiracial Education, handicapable outreach and native Language Accessibility". I think this thing really

Re: asynchronous comunication, wxPython and threads.

2005-06-22 Thread Peter Hansen
he socket, connect to the server, communicate, close it down, and go back to waiting all in one place (so to speak... of course this would be several methods all called from a top-level loop in that thread). No chance of mis-steps. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Python API to manipulate CAB files.

2005-06-22 Thread Peter Maas
Isaac Rodriguez schrieb: > Does anyone know of a Python API to manipulate CAB files? If there is a Windows API you can probybly call it from Python using Mark Hammond's Win32 extensions. -- --- Peter Maas, M+R Infosys

Re: PEP ? os.listdir enhancement

2005-06-22 Thread Peter Hansen
" module, all this code basically collapses down to this beauty (with your variable "path" renamed to myPath to avoid a name collision): from path import path dirs = path(myPath).abspath().dirs() -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Database recommendations for Windows app

2005-06-22 Thread Peter Hansen
atures to see that it really does what you need. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP ? os.listdir enhancement

2005-06-23 Thread Peter Otten
re should be listdir(path, with_path=False) and cater absolute and relative paths alike. The need for such an enhancement is not particularly pressing, as workarounds abound. Here's another one: >>> glob.glob("/usr/lib/games/../games/*") ['/usr/lib/games/../games/schwarzerpeter'] Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Database recommendations for Windows app

2005-06-23 Thread Peter Hansen
#x27;t consider it outright to be a Bad Thing. I'd say more on the issue, if I knew anything that I hadn't just read in the documentation. ;-) -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: suggestions invited

2005-06-23 Thread Peter Herndon
As Konstantin alludes, your request is not specified clearly enough. In all-caps you write "APPLICATION MONITORING SYSTEM", yet your only use-case is "it lets the it employee enter the name of the application and gives him all the details about it", where "the details are ... " a bunch of fields th

Re: suggestions invited

2005-06-23 Thread Peter Herndon
Reasonable enough. As per Mike's suggestion below, building a few web pages to document the apps is a good start. To expand on that idea, you could write daemons/cron jobs, perhaps in Python if Python runs on OS/400, that monitor each app's status and log that information to the web server. You

Re: os.system(cmd) isn't working

2005-06-23 Thread Peter Hansen
rate lines must mean that there was whitespace between them, or the line break would have occurred before the ' ... but it did seem like a good theory while it lasted. ;-) -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: howto load and unload a module

2005-06-24 Thread Peter Hansen
some of the introspection features available in the "inspect" module. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Help wanted in piping in Windows

2005-06-24 Thread Peter Hansen
even be able to get support from Microsoft's update site (such as if you have to reinstall), isn't it time to move on? to Linux... -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: howto load and unload a module

2005-06-24 Thread Peter Hansen
essarily release any memory back to the operating system, and it won't necessarily unload any extension modules or other shared libraries that are loaded. The whole concept of "unloading" a module is pretty much undefined in Python, so whatever you can get is the best you ca

Re: webserver application (via Twisted?)

2005-06-24 Thread Peter Hansen
earch for Python web frameworks. There are perhaps dozens -- though less than a dozen really popular ones -- and most will do what you want, going by the most general interpretation of your question. (If you're talking about duplicating whatever specific architecture appeals to you in

Re: howto load and unload a module

2005-06-24 Thread Peter Hansen
John Machin wrote: > Peter Hansen wrote: [sample code] > Ummm ... doesn't appear to scale well for multiple modules and multiple > attributes & functions. It certainly wouldn't! :-) I was posting mainly to elicit more information, since clearly you wouldn't get

Re: Favorite non-python language trick?

2005-06-24 Thread Peter Hansen
; green := 0 What do you think this actually does? It doesn't do anything remotely resembling either of the things quoted above. In fact, the "from color import *" line is pretty much useless here. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question: how to keep a socket listening?

2005-06-24 Thread Peter Hansen
rying to see whether it is obvious that the listen(1) is at fault -- and it's not obvious. I thought this response might clarify the meaning of listen(1) a little bit for some folks nevertheless. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question: SOLVED (how to keep a socket listening), but still some questions

2005-06-24 Thread Peter Hansen
() before one does a socket.close?? Not normally, AFAIK. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: a dictionary from a list

2005-06-24 Thread Peter Hansen
ually a generator expression as the sole argument to a generic dict() constructor. Think of the generator expression as sort of like the list comprehension that it resembles, minus the square brackets, but which doesn't have to create the entire list before the dict() constructor starts t

Re: Favorite non-python language trick?

2005-06-25 Thread Peter Otten
Mandus wrote: > By using the builtin reduce, I > move the for-loop into the c-code which performs better. No. There is no hope of ever writing fast code when you do not actually measure its performance. Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Big problem fetching members from dynamically loaded module

2005-06-25 Thread Peter Otten
owing the steering wheel out of the window. Seriously, try to make do with __import__() and getattr() to clean up your code a bit. Driving-analogies-well-beyond-the-abyss-ly yours Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Big problem fetching members from dynamically loaded module

2005-06-25 Thread Peter Otten
Philippe C. Martin wrote: > OK Peter, first of all thanks. > > You seem to be German and although I leave in the states, I'm French and > your english is clearly far more advanced than mine: I have yet to > understand a few of your comments ;-) My French is mostly read-only

Re: Favorite non-python language trick?

2005-06-25 Thread Peter Otten
he best possible efficiency you would probably have to code the loop in C. Incidentally, for add() this has already been done with the sum() builtin. Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Favorite non-python language trick?

2005-06-25 Thread Peter Otten
Steven D'Aprano wrote: > On Sat, 25 Jun 2005 21:30:26 +0200, Peter Otten wrote: > >> Mandus wrote: >> >>> By using the builtin reduce, I >>> move the for-loop into the c-code which performs better. >> >> No. There is no hope of ever writ

Re: Big problem fetching members from dynamically loaded module

2005-06-25 Thread Peter Otten
st recent call last): File "", line 1, in ? NameError: name 'alpha' is not defined >>> beta The 'right' way to do the imports if you want both 'alpha' and 'beta' is of course from package import alpha from package import beta Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Daten Kinderheilkunde

2005-06-27 Thread Peter Maas
Peter Maas schrieb: > vielen Dank für die Zusendung der Daten. Es handelt sich allerdings > nicht um jpeg-Dateien, wie die Erweiterung nahelegt. Wir konnten sie > nur mit dem PictureViewer auf einem Apple anzeigen. Sie werden unter > MacOS als Adobe-Photoshop-Dokument angezeigt. Sor

Daten Kinderheilkunde

2005-06-27 Thread Peter Maas
Dateien als jpegs bekommen oder sollen wir sie selbst umwandeln? Mit freundlichen Gruessen, Peter Maas -- --- Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0 E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.deco

Re: tkinter radiobutton

2005-06-27 Thread Peter Otten
Radiobutton): def __getattr__(self, name): if name == "selected": return self.getvar(self["variable"]) == self["value"] raise AttributeError Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Non-blocking raw_input

2005-06-27 Thread Peter Hansen
Jorge Louis de Castro wrote: > Could anyone tell me whether I can find a non blocking alternative to > raw_input that works on windows? Is there not a python way of achieving > this? Can I find it somewhere in the documentation? > Any help will be highly appreciated Depending on what your requir

Re: OO refactoring trial ??

2005-06-27 Thread Peter Otten
Chinook wrote: > 3) Any other comments you might offer > if tv == 'relates to A': > return True > else: > return False Make that return tv == 'relates to A' lest your zen master hit you. Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: How to compress a folder and all of its sub directories and files into a zip file?

2005-06-27 Thread Peter Szinek
e.zip ;-) Probably this is not needed, so an additional test (something like fileName != 'myfile.zip' would be needed. HTH, Peter could ildg wrote: > I want to compress a folder and all of its sub files including empty folders > into a zip file. what's the pythoni

Re: Boss wants me to program

2005-06-28 Thread Peter Maas
C# when doing .net. Basic is the ugliest and most mind corrupting language I've come across. And the OP has a C/C++ background. -- --- Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0 E-mail 'cGV0ZXIub

Re: Python 2.1 / 2.3: xreadlines not working with codecs.open

2005-06-28 Thread Peter Otten
""" return getattr(self.stream, name) > At least, it does provide a workaround... Note that the xreadlines module hasn't made it into Python 2.4. Peter -- http://mail.python.org/mailman/listinfo/python-list

[OT] Re: What is different with Python ? (OT I guess)

2005-06-28 Thread Peter Otten
man has one term for both 'dandruff' and 'scale' (Schuppe). Still not funny? at least you have learned some German. Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: building python 2.4.1

2005-06-28 Thread Peter Otten
Andreas Heiss wrote: > However, there are no tcl.h and tk.h header files. I haven't ssen those > files since Tcl/Tk8.0 You may also need to install the development packages (tk-devel and tcl-devel on Suse) Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter radiobutton

2005-06-28 Thread Peter Otten
ld avoid duplicate state and require only log N instead of N bits. Wouldn't that be an elegant implementation, at least in theory? So why bother about the layers below when you have all the information to write code that works? Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Which kid's beginners programming - Python or Forth?

2005-06-28 Thread Peter Hansen
t of the "mainstream of current programming", even if you're the one doing it... -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: benchmarking with threading module

2005-06-28 Thread Peter Hansen
Matteo Memelli wrote: > Hi, I'd like to know if it is possible to use the threading module to > benchmark a web server. > Do you think that using the Threading module would be a good idea? > Any other suggestion? This sounds like a good time to use Twisted instead of "thread

Re: whois like functionality on Windows?

2005-06-28 Thread Peter Hansen
ing. You are looking for the capability provided by "domain name servers" (DNSes), not "whois" servers. But Thomas has just given you the solution... -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Set/Get attribute syntatic sugar

2005-06-28 Thread Peter Hansen
se: >>> class C: ... def __setattr__(self, e, v): ... print 'setting %s to %s' % (e, v) ... self.__dict__[e] = v ... >>> o = C() >>> v = 'mystring' >>> o.e = v setting e to mystring >>> o.e 'mystring' >>> -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter radiobutton

2005-06-28 Thread Peter Otten
print rg = Radiogrid(root, ["alpha beta gamma".split(), "one two three".split(), "guido van rossum".split()], show_state ) rg.pack() root.mainloop() I hope this will move further discussion from the abstract to the concrete :-) Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-28 Thread Peter Hansen
Jarek Zgoda wrote: > Grant Edwards napisał(a): > >>> To be blunt, I have no idea what this has to do with Python. >> >> >> Monty Python was mostly Brits? > > > Wasn't they all Brits? I think one was a lumberjack (but he's okay), which would make him a Canadian, eh? -- http://mail.python.org/ma

Re: Set/Get attribute syntatic sugar

2005-06-28 Thread Peter Hansen
Elmo Mäntynen wrote: > > Peter Hansen wrote: >>Заур Шибзухов wrote: >>>Anybody thought about this issue? >> >>Perhaps not, but now that you've pointed it out they've taken the time >>machine back and fixed the problem before it arose: > >

Re: tkinter radiobutton

2005-06-28 Thread Peter Otten
w/row 1 selected, and > accomodates cases where nothing is selected in any column. Another option would have been to initialize the variables ... var = tk.IntVar() var.set(-1) if trace_write: ... Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-29 Thread Peter Maas
muldoon schrieb: >Now, what forum would you recommend? Any help would be appreciated. alt.culture.us.* -- --- Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0 E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n

Re: whois like functionality on Windows?

2005-06-29 Thread Peter Hansen
e providers, and they're often not interested in providing any reverse mapping for them. Some do (for example, mine is pc-136-15.scpe.powergate.ca right now), but many don't... I'm sure there's a way to identify the domain of the owner of a block of addresses in which a give

importing packages from a zip file

2005-06-29 Thread Peter Tillotson
Hi all, I was wondering if this is possible. In python v2.3 the import systems was extended via PEP302 to cope with packages. *.py files in a directory hierarchy can be imported as modules each level in the directory hierarchy needs to contain at least an empty __init__.py file. eg. With the file

Re: importing packages from a zip file

2005-06-29 Thread Peter Tillotson
solution: have to add the zip archives to the PYTHONPATH, can be done in the env but also as below import sys, os.path zipPackages=['base.zip'] for package in zipPackages: sys.path.insert(0,os.path.join(sys.path[0],package)) import base.branch1.myModule Peter Tillotson wrote

Re: importing packages from a zip file

2005-06-29 Thread Peter Tillotson
cheers Scott should have been from myZip.zip import base.branch1.myModule.py and no it didn't work, anyone know a reason why this syntax is not preferred ?? sorry posted the soln again, it works but feels nasty Scott David Daniels wrote: > Peter Tillotson wrote: > >> ... Wit

<    20   21   22   23   24   25   26   27   28   29   >