Extreme Python

2005-02-03 Thread troyf
Hello all, I've created a web/email group for topics related to both Extreme Programming (or other Agile methodologies) and Python. If you're interested, please visit http://groups-beta.google.com/group/extreme-python/ and subscribe. Or just post directly to [EMAIL PROTECTED] Hope to see you there

List mapping question

2005-02-03 Thread Marc Huffnagle
I have a number of variables that I want to modify (a bunch of strings that I need to convert into ints). Is there an easy way to do that other than saying: > a = int(a) > b = int(b) > c = int(c) I tried > [i = int(i) for i in [a, b, c]] but that didn't work because it was creating a list with

Re: pyFMOD problem

2005-02-03 Thread Tian
I think I did have put the DLL file in the correct place, but I still cannot make it work. same problem. I checked my version of pyfmod, ctypes, they are all the newest one. can you tell me the version you are using? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: remove duplicates from list *preserving order*

2005-02-03 Thread [EMAIL PROTECTED]
You could create a class based on a list which takes a list as argument, like this: -class uniquelist(list): -def __init__(self, l): -for item in l: -self.append(item) - -def append(self, item): -if item not in self: -list.append(self, item) - -l = [1

python-mode tab completion problem

2005-02-03 Thread test1dellboy3
Hi, I am exploring python-mode on emacs. When I open foo.py in emacs and hit C-!, it starts the python interpreter in another window. Next, I execute - import rlcompleter, readline readline.parse_and_bind('tab: complete') Now I will test the completion by trying to complete sys.v (which could be

Re: bytecode obfuscation

2005-02-03 Thread Jarek Zgoda
snacktime napisał(a): Everything except the libraries that actually connect to the bank networks would be open source, and those libraries aren't something that you would even want to touch anyways. This sounds suspicious to me. Really. Normal payment clearance programs have open-spec API's. -- J

Re: variable declaration

2005-02-03 Thread Paddy McCarthy
Alexander Zatvornitskiy wrote: Hello All! I'am novice in python, and I find one very bad thing (from my point of view) in language. There is no keyword or syntax to declare variable, like 'var' in Pascal, or special syntax in C. It can cause very ugly errors,like this: epsilon=0 S=0 while epsilon<1

Re: Basic file operation questions

2005-02-03 Thread Peter Otten
Caleb Hattingh wrote: >> Yes, you can even write >> >> f = open("data.txt") >> for line in f: >> # do stuff with line >> f.close() >> >> This has the additional benefit of not slurping in the entire file at >> once. > > Is there disk access on every iteration? I'm guessing yes? It shouldn'

Re: remove duplicates from list *preserving order*

2005-02-03 Thread Steven Bethard
Carl Banks wrote: from itertools import * [ x for (x,s) in izip(iterable,repeat(set())) if (x not in s,s.add(x))[0] ] Wow, that's evil! Pretty cool, but for the sake of readers of my code, I think I'll have to opt against it. ;) STeVe -- http://mail.python.org/mailman/listinfo/python-list

Re: The next Xah-lee post contest

2005-02-03 Thread PA
On Feb 02, 2005, at 02:10, alex23 wrote: Which bits especially impress you, the rampant misogyny or the unwarranted intellectual arrogance? A bit of both, really. "Barbie Anthropology" http://xahlee.org/Periodic_dosage_dir/20030919_barbie.html Cheers -- PA, Onnay Equitursay http://alt.textdrive.com

bytecode obfuscation

2005-02-03 Thread snacktime
I am attempting to put together and open source project, but some of the libraries cannot be open source due to non disclosure agreements. The non disclosures specifically specify that the implementation of their api's can only be distributed as object code. I might be able to get them to agree t

Re: Reinstall python 2.3 on OSX 10.3.5?

2005-02-03 Thread Jorl Shefner
In article <[EMAIL PROTECTED]>, Robert Kern <[EMAIL PROTECTED]> wrote: > Christian Dieterich wrote: > > On Dé Céadaoin, Feabh 2, 2005, at 17:48 America/Chicago, > > [EMAIL PROTECTED] wrote: > > > >> Hi there > >> > >> I started a very long and roundabout process of attempting to install > >> py

Re: Two classes problem

2005-02-03 Thread Caleb Hattingh
Gurpreet You can manage the namespace more formally. Or to put it another way, "global" gives me the heebie-jeebies. I recently worked on a project replacing a legacy reactor model in FORTRAN, and between COMMON blocks, and GOTO statements, I didn't know up from down. How about this: *** cl

Re: remove duplicates from list *preserving order*

2005-02-03 Thread Larry Bates
Take a look at this recipe on ASPN: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/204297 I think it might help. Larry Bates Steven Bethard wrote: I'm sorry, I assume this has been discussed somewhere already, but I found only a few hits in Google Groups... If you know where there's a g

Re: Basic file operation questions

2005-02-03 Thread Jeff Shannon
Caleb Hattingh wrote: Peter Yes, you can even write f = open("data.txt") for line in f: # do stuff with line f.close() This has the additional benefit of not slurping in the entire file at once. Is there disk access on every iteration? I'm guessing yes? It shouldn't be an issue in the va

Re: Basic file operation questions

2005-02-03 Thread Steven Bethard
Caleb Hattingh wrote: Peter Yes, you can even write f = open("data.txt") for line in f: # do stuff with line f.close() This has the additional benefit of not slurping in the entire file at once. Is there disk access on every iteration? I'm guessing yes? It shouldn't be an issue in the va

Re: remove duplicates from list *preserving order*

2005-02-03 Thread [EMAIL PROTECTED]
You could do it with a class, like this, I guess it is a bit faster than option 1, although I'm no connaisseur of python internals. -class uniquelist(list): -def __init__(self, l): -for item in l: -self.append(item) -def append(self, item): -if item not in s

Re: remove duplicates from list *preserving order*

2005-02-03 Thread Carl Banks
Steven Bethard wrote: > I'm sorry, I assume this has been discussed somewhere already, but I > found only a few hits in Google Groups... If you know where there's a > good summary, please feel free to direct me there. > > > I have a list[1] of objects from which I need to remove duplicates. I > h

Re: python and visual C++

2005-02-03 Thread Caleb Hattingh
Olivier But the problem is about modules thats are developped from others with distutils... Yes, sorry, I reread your original post and now realise that you were referring to other people's modules. And with your comments there, I agree with you -> MSVC as a requirement is unfortunate. thx Ca

Re: streaming a file object through re.finditer

2005-02-03 Thread Erick
I did try to see if I could get that to work, but I couldn't figure it out. I'll see if I can play around more with that api. So say I did investigate a little more to see how much work it would take to adapt the re module to accept an iterator (while leaving the current string api as another code

Re: Basic file operation questions

2005-02-03 Thread Caleb Hattingh
Peter Yes, you can even write f = open("data.txt") for line in f: # do stuff with line f.close() This has the additional benefit of not slurping in the entire file at once. Is there disk access on every iteration? I'm guessing yes? It shouldn't be an issue in the vast majority of cases,

Re: Why does super() require the class as the first argument?

2005-02-03 Thread Steve Holden
Kevin Smith wrote: I like the idea of the super() function, but it doesn't seem to solve the problem that I'm trying to fix. I don't like hard-coding in calls to super classes using their names: class A(object): def go(self): ... class B(A): def go(self): ... A.g

Re: Reinstall python 2.3 on OSX 10.3.5?

2005-02-03 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: >Hi there > >I started a very long and roundabout process of attempting to install >python 2.3.4 along side my apple-installed 2.3 system. To make a long >story short, I have completely confabulated my environment ( i deleted >the 2.3 binar

remove duplicates from list *preserving order*

2005-02-03 Thread Steven Bethard
I'm sorry, I assume this has been discussed somewhere already, but I found only a few hits in Google Groups... If you know where there's a good summary, please feel free to direct me there. I have a list[1] of objects from which I need to remove duplicates. I have to maintain the list order t

Re: Calling a method using an argument

2005-02-03 Thread Diez B. Roggisch
> > def test(self, method, *args): > return getattr(self, method)(*args) Yup, forgot abount that. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding user's home dir

2005-02-03 Thread Nemesis
Mentre io pensavo ad una intro simpatica "Peter Hansen" scriveva: > 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 do

Re: Finding user's home dir

2005-02-03 Thread Nemesis
Mentre io pensavo ad una intro simpatica "Miki Tebeka" scriveva: >> 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. On my Win2000 box it ret

Re: Is there a market for python developers?

2005-02-03 Thread Harald Massa
> 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? Absolutely no. Only unimportant and unknown companies like Google, Nokia, Industrial Light and Magic as well as GHUM Harald Massa do work with Python. Haral

Re: continuous plotting with Tkinter

2005-02-03 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, "Martin Blume" <[EMAIL PROTECTED]> wrote: >I have a number-crunching application that spits out >a lot of numbers. Now I'd like to pipe this into a python >app and plot them using Tkinter, such as: >$ number_cruncher | myplot.py >But with Tkinter once I call Tkin

Re: Why does super() require the class as the first argument?

2005-02-03 Thread Chris Cioffi
At runtime there is nothing to say that the class hasn't been subclassed again. example: class A(someclass): def __init__(self): super(self).__init__() do_something() class B(A): """No __init__""" def blah(self): pass When you use class B, how does the super

¡Þ¿¬.ü.´ë.±Ý 5õ¸¸¿ø±îÁö Àú·ÅÇÏ°Ô36°³¿ùºÐÇÒ»óȯ

2005-02-03 Thread ´Ã~Ǫ¸¥·Ð15
Title: www.kc-loan.com -- http://mail.python.org/mailman/listinfo/python-list

Why does super() require the class as the first argument?

2005-02-03 Thread Kevin Smith
I like the idea of the super() function, but it doesn't seem to solve the problem that I'm trying to fix. I don't like hard-coding in calls to super classes using their names: class A(object): def go(self): ... class B(A): def go(self): ... A.go(self) I don't l

Re: debugging os.spawn*() calls

2005-02-03 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Martin Franklin <[EMAIL PROTECTED]> wrote: > Skip Montanaro wrote: > > I have an os.spawnv call that's failing: > > > > pid = os.spawnv(os.P_NOWAIT, "ssh", > > ["ssh", remote, > > "PATH=%(path)s nice -20 make -C %(pwd)s

Re: Nested scopes and class variables

2005-02-03 Thread Steven Bethard
I wrote: Alex Martelli wrote: See the difference? In a function, the 'x = x' compiles into LOAD_FAST, STORE_FAST, which only looks at locals and nowhere else. In a classbody, it compiles to LOAD_NAME, STORE_NAME, which looks at locals AND globals -- but still not at closure cells... Is there a re

Re: Calling a method using an argument

2005-02-03 Thread Jeremy Bowers
On Thu, 03 Feb 2005 15:48:05 +, C Gillespie wrote: > Dear All, > > I have a simple class > class hello: > def world(self): > return 'hello' > def test(self,arg): > return self.arg > > When I want to do is: >>hello.test('world') > 'hello' > > i.e. pass the method name

Re: Awkwardness of C API for making tuples

2005-02-03 Thread Jeremy Bowers
On Thu, 03 Feb 2005 07:45:22 -0500, Steve Holden wrote: > Fredrik Lundh wrote: >> in theory, if PyInt_FromLong succeeds, and PyTuple_SetItem fails, you'll leak >> an object. >> >> >> > And in practice this will only happen during a period when you are > relying critically on it *not* to ...

Re: Apache & Python 500 Error

2005-02-03 Thread Jeremy Bowers
On Thu, 03 Feb 2005 13:55:13 +0100, Christian wrote: > from mod_python import apache > ^ > SyntaxError: invalid syntax > > > My test script: > #!/usr/bin/python > > print 'Content-Type: text/plain\r' > print '\r' > import os > print os.getcwd() For the quote of the error message, I'

RE: errors

2005-02-03 Thread Joel Eusebio
Tried looking for the misspelled oldmtime on apache.py but can't find it. Joel -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kartic Sent: Thursday, February 03, 2005 4:00 AM To: python-list@python.org Subject: Re: errors Joel Eusebio said the followi

Re: Integrated Testing - Peppable?

2005-02-03 Thread Jeremy Bowers
On Thu, 03 Feb 2005 09:40:55 -0800, [EMAIL PROTECTED] wrote: > Thanks, Jeremy, > >> No prose can compare to a live, functional demonstration. > > I agree; that's what my prototype amounts to: > > > > (sorry, it's Windows-only) > > But

Re: [EVALUATION] - E01: The Java Failure - May Python Helps?

2005-02-03 Thread Jeremy Bowers
On Thu, 03 Feb 2005 09:26:08 +0200, Ilias Lazaridis wrote: > My question is essentially: > > How many of those constructs are already supported by python (and the > surrounding open-source-projects): > > http://lazaridis.com/case/stack/index.html This post is hard to follow, but I'm going to as

Re: Printing Filenames with non-Ascii-Characters

2005-02-03 Thread Marian Aldenhövel
Hi, > Python's drive towards uncompromising explicitness pays off big time when you're dealing with multilingual data. Except for the very implicit choice of 'ascii' as an encoding when it cannot make a good guess of course :-). All in all I agree, however. Ciao, MM -- Marian Aldenhövel, Rosenhain

Re: About standard library improvement

2005-02-03 Thread Steve Holden
Frank Abel Cancio Bello wrote: Hi! If I make some improvement to xmlrpclib module, where I should send this improvement to form part of next standard library release? Thank Well done! The standard place to lodge patches (whether for bug fixes or improvements) is SourceForge. You'll need an ac

Re: About standard library improvement

2005-02-03 Thread Fredrik Lundh
Frank Abel Cancio Bello wrote: > If I make some improvement to xmlrpclib module, where I should send this > improvement to form part of next standard library release? http://sourceforge.net/tracker/?group_id=5470&atid=305470 -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy Q: dealing with object type

2005-02-03 Thread Fredrik Lundh
Erik Johnson wrote: >As an aside, I notice a lot of other people's interpreters actually > print 'True' or 'False' where my system prints 0 or 1. Is that a > configuration that can easily set somewhere? $ python2.1 -c "print 1 == 1" 1 $ python2.2 -c "print 1 == 1" 1 $ python2.3 -c "print 1

About standard library improvement

2005-02-03 Thread Frank Abel Cancio Bello
Hi! If I make some improvement to xmlrpclib module, where I should send this improvement to form part of next standard library release? Thank -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy Q: dealing with object type

2005-02-03 Thread Steve Holden
Erik Johnson wrote: Steven Bethard <[EMAIL PROTECTED]> wrote: py> class A: ... pass ... py> class B: ... pass ... py> a = A() py> a.__class__ == A True py> a.__class__ == B False "Just" <[EMAIL PROTECTED]> wrote Uh, isinstance(a, A) works for both new-style and old-style classes. Heck, is

Re: Is there a market for python developers?

2005-02-03 Thread Paul Rubin
"Mabon Dane" <[EMAIL PROTECTED]> writes: > 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? Well, there's two ways to look at that question: 1) Are there many companies with with openings like "we want to hire

Re: Easy Q: dealing with object type

2005-02-03 Thread Erik Johnson
> Steven Bethard <[EMAIL PROTECTED]> wrote: > > py> class A: > > ... pass > > ... > > py> class B: > > ... pass > > ... > > py> a = A() > > py> a.__class__ == A > > True > > py> a.__class__ == B > > False "Just" <[EMAIL PROTECTED]> wrote > Uh, isinstance(a, A) works for both new-style

Re: global variables

2005-02-03 Thread Steve Holden
Steven Bethard wrote: Steve Holden wrote: M.E.Farmer wrote: Ok it has been a long day, In my reply to Steven Bethard , Steve should read Steven ;) M.E.Farmer Well, since he signs himself "Steve" too I guess we'll just have to put up with the ambiguities. Or perhaps, given my (lack of) typing skil

Re: managing multiple subprocesses

2005-02-03 Thread Skip Montanaro
> "Marcos" == Marcos <[EMAIL PROTECTED]> writes: Marcos> I have tried all sorts of popens / excevs / os.systems / Marcos> commands etc etc. I think os.spawn* and os.wait will do what you want. I have trouble with os.spawn* myself, so may just fall back to fork/exec + os.wait in the

Re: Is there a market for python developers?

2005-02-03 Thread Steve Holden
[EMAIL PROTECTED] wrote: 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? You can Google this newsgroup for "[EMAIL PROTECTED] jobs" to find two messages I posted with statistics. Also, take a l

Re: Computing class variable on demand?

2005-02-03 Thread Steven Bethard
fortepianissimo wrote: This seems to be what I need. My use case is to do lengthy intialization as late as possible. In this case this is to initialize class variables. Does this make sense? Yup. If they definitely have to be class variables, then yeah, you probably need to use a metaclass. If y

ANN: PyDev 0.9.0 released

2005-02-03 Thread Fabio Zadrozny
Hi All, PyDev - Python IDE (Python development enviroment for Eclipse) version 0.9.0 has just been released. This release supports python 2.4 and has PyLint 0.6 integrated. Code completion had some improvements too. Check the homepage for more details (http://pydev.sourceforge.net/). Regards, Fab

Re: SysV IPC message queues

2005-02-03 Thread Christian Dieterich
On Déardaoin, Feabh 3, 2005, at 02:29 America/Chicago, Aki Niimura wrote: Hello everyone. I'm trying to control a program from a Python program using IPC. Although using a socket is a common choice for such applications, I would like to use SysV message queues because I don't need to parse the st

Re: Where is WSAEnumNetworkEvents???

2005-02-03 Thread Thomas Heller
Dave Brueck <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: >> I was trying to write an asyncronous TCP server for win32 using >> WSAEventSelect (which lives if win32file). Such events require >> WaitForMultipleObjects (which lives if win32event) and >> WSAEnumNetworkEvents WHICH IS NOT EXP

Re: Integrated Testing - Peppable?

2005-02-03 Thread [EMAIL PROTECTED]
Thanks, John, I think there's a true, powerful, difference between inline tests and external (albeit adjacent) ones. I think the developer experience should be superior with inline tests for several reasons: - during initial development, without any navigation beyond the Enter key, you flow direc

Re: Easy Q: dealing with object type

2005-02-03 Thread Steven Bethard
Just wrote: In article <[EMAIL PROTECTED]>, Steven Bethard <[EMAIL PROTECTED]> wrote: py> class A: ... pass ... py> class B: ... pass ... py> a = A() py> a.__class__ == A True py> a.__class__ == B False Uh, isinstance(a, A) works for both new-style and old-style classes. Heck, isinstance(

Re: global variables

2005-02-03 Thread Steven Bethard
Steve Holden wrote: M.E.Farmer wrote: Ok it has been a long day, In my reply to Steven Bethard , Steve should read Steven ;) M.E.Farmer Well, since he signs himself "Steve" too I guess we'll just have to put up with the ambiguities. Or perhaps, given my (lack of) typing skill, I should just start

Re: Integrated Testing - Peppable?

2005-02-03 Thread [EMAIL PROTECTED]
Thanks, Jeremy, > No prose can compare to a live, functional demonstration. I agree; that's what my prototype amounts to: (sorry, it's Windows-only) But I take your larger message, and John's, to heart - this isn't worthy of making it i

Re: character sets? unicode?

2005-02-03 Thread Fredrik Lundh
Michael wrote: > I'm trying to import text from email I've received, run some regular > expressions on it, and save > the text into a database. I'm trying to figure out how to handle the issue of > character sets. I've > had some problems with my regular expressions on email that has interesti

exporting mesh from image data

2005-02-03 Thread John Hunter
I am trying to generate a mesh for a finite volume solver (gambit, fluent) from 3D image data (CT, MRI). To generate the fluent msh file, you need not only a list of vertices and polygons, much like what is available in the vtk file format, but also the volume elements in the mesh that the polygo

ModPython: passing variables between handlers?

2005-02-03 Thread Steve Holden
Diez B. Roggisch wrote: Hi, first of all - please quote appropriately - especially if you receive the postings as digest. That prevents the signal-to-noise-ratio dropping to unknown lows... Your responses will give me the required lifetime for my variables, but not the required access at all level

Re: global variables

2005-02-03 Thread Michael
Probably naming it something other than 'globals' would be a good idea -- otherwise you'll hide the builtin globals() function. But I agree that the attributes of a class instance (as you suggest) or the attributes of a module (as Steve Holden suggests) is probably the right way to go. I like t

Re: convert ftp.retrbinary to file object? - Python language lacks expression?

2005-02-03 Thread Steve Holden
Robert wrote: That turns into periodic new RETR commands with offset. Think its more an "odd" trick. I'd even prefer a threaded approach (thread puts the blocks into a stack; a while ... yield generator loop in the main thread serves the .read() function of the pseudo file object, which is my w

Sendmail with many attach and recipients

2005-02-03 Thread Tim Williams
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Here, my code of sendmail If Somebody had a doubt please contact me? [EMAIL PROTECTED] [snip] If you have multiple recipients, you need to modify server.sendmail(msg['From'],toaddrs,msg.as_string()) to failed = server.sendmail(msg['F

character sets? unicode?

2005-02-03 Thread Michael
I'm trying to import text from email I've received, run some regular expressions on it, and save the text into a database. I'm trying to figure out how to handle the issue of character sets. I've had some problems with my regular expressions on email that has interesting character sets. Korean

Re: Finding user's home dir

2005-02-03 Thread Michael
My own, less than perfect, way of finding the users home directory is like this: def personal_directory ( default = None ): pdir = None if sys.platform.startswith ( 'win' ): import _winreg reg = _winreg.ConnectRegistry ( None, _winreg.HKEY_CURRENT_USER ) pkey = _winreg.

Re: Redirecting stdout/err under win32 platform

2005-02-03 Thread David Bolen
Pierre Barbier de Reuille <[EMAIL PROTECTED]> writes: > AFAIK, there is no working bidirectionnal pipes on Windows ! The > functions exists in order for them to claim being POSIX, but they're > not working properly. (...) Can you clarify what you believe doesn't work properly? The os.popen* func

Re: CONTEST - What is the (best) solution?

2005-02-03 Thread Larry Bates
The data contains only references to variables in the local namespace an not literal values. Since local variable names cannot include '{' or '}' characters, my solution does in fact meet the criteria outlined. Larry Bates Fuzzyman wrote: Doesn't work if '{' or '}' can appear in the values

Sendmail with many attach and recipients

2005-02-03 Thread fernandestb
Here, my code of sendmail If Somebody had a doubt please contact me? [EMAIL PROTECTED] # -*- coding: cp1252 -*- ## Faz o import das bibliotecas necessarias. import mimetypes import os.path import smtplib import sys from email.Encoders import encode_base64 from email.MIMEAudio import MIMEAudio f

Re: Calling a method using an argument

2005-02-03 Thread Duncan Booth
Diez B. Roggisch wrote: > If you have more args, do this: > > def test(self, *args): > return getattr(self, args[0])(*args[1:]) > This would be cleaner written as: def test(self, method, *args): return getattr(self, method)(*args) and for complete generality: def test(self, method, *

Re: Nested scopes and class variables

2005-02-03 Thread Dave Benjamin
Thanks, Nick and Alex, for the nice, detailed explanations. My understanding of Python bytecode is not deep enough to comment at this time. ;) -- .:[ dave benjamin: ramen/[sp00] -:- spoomusic.com -:- ramenfest.com ]:. "talking about music is like dancing about architecture." -- http://m

Type inference, lessons learned from Vyper

2005-02-03 Thread Dave Benjamin
Hey all, I came across a fascinating thread on the Caml mailing list this morning. It's about writing an interpreter for Python that can do type inference, and John Skaller shares a lot of his experiences with the Vyper project: http://groups-beta.google.com/group/fa.caml/browse_frm/thread/4f65d0

Re: Calling a method using an argument

2005-02-03 Thread Diez B. Roggisch
Diez B. Roggisch wrote: > def test(self,arg): > return getattr(self, arg) > Oops, missed the calling: def test(self,arg): return getattr(self, arg)() If you have more args, do this: def test(self, *args): return getattr(self, args[0])(*args[1:]) -- Regards, Diez B. Roggisch -

Re: Where is WSAEnumNetworkEvents???

2005-02-03 Thread Dave Brueck
[EMAIL PROTECTED] wrote: I was trying to write an asyncronous TCP server for win32 using WSAEventSelect (which lives if win32file). Such events require WaitForMultipleObjects (which lives if win32event) and WSAEnumNetworkEvents WHICH IS NOT EXPOSED. This makes WSAEventSelect useless. Does somebody

Re: Calling a method using an argument

2005-02-03 Thread Diez B. Roggisch
def test(self,arg): return getattr(self, arg) -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Calling a method using an argument

2005-02-03 Thread C Gillespie
Dear All, I have a simple class class hello: def world(self): return 'hello' def test(self,arg): return self.arg When I want to do is: >hello.test('world') 'hello' i.e. pass the method name as an argument. How should I do this? Thanks Colin -- http://mail.python.org/

Re: Computing class variable on demand?

2005-02-03 Thread fortepianissimo
This seems to be what I need. My use case is to do lengthy intialization as late as possible. In this case this is to initialize class variables. Does this make sense? Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Hey, get this!

2005-02-03 Thread Just
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: > > If it's a path importer, it could be a cookie, specific to the importer. > > I think in Steve's case initializing __path__ to ["*db*"] should work. > > > > Just > > And that's exactly the conclusion I came to when impo

Re: convert ftp.retrbinary to file object? - Python language lacks expression?

2005-02-03 Thread Robert
That turns into periodic new RETR commands with offset. Think its more an "odd" trick. I'd even prefer a threaded approach (thread puts the blocks into a stack; a while ... yield generator loop in the main thread serves the .read() function of the pseudo file object, which is my wish). Yet such

Re: Reinstall python 2.3 on OSX 10.3.5?

2005-02-03 Thread Christian Dieterich
On Déardaoin, Feabh 3, 2005, at 01:52 America/Chicago, Robert Kern wrote: Christian Dieterich wrote: On Dé Céadaoin, Feabh 2, 2005, at 17:48 America/Chicago, [EMAIL PROTECTED] wrote: Hi there I started a very long and roundabout process of attempting to install python 2.3.4 along side my apple-i

Re: Where is WSAEnumNetworkEvents???

2005-02-03 Thread Roger Upole
>From a quick look, it wouldn't be too difficult to wrap this function. Both the input arguments can be already be handled by Swig, and the outputs would just be an int and a fixed size tuple of ints. Roger <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I was trying to

Re: Is there a market for python developers?

2005-02-03 Thread beliavsky
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? You can Google this newsgroup for "[EMAIL PROTECTED] jobs" to find two messages I posted with statistics. -- http://mail.python.org/mailman

Re: Popularizing SimpleHTTPServer and CGIHTTPServer

2005-02-03 Thread Steve Holden
Jorey Bump wrote: "Michele Simionato" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: Just submitted a recipe with this goal in mind: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/365606 You may want to warn people that if they run those commands in their home directory, they wi

Re: Hey, get this!

2005-02-03 Thread Steve Holden
Just wrote: In article <[EMAIL PROTECTED]>, Bernhard Herzog <[EMAIL PROTECTED]> wrote: Bernhard Herzog <[EMAIL PROTECTED]> writes: Steve Holden <[EMAIL PROTECTED]> writes: if package: module.__path__ = sys.path You usually should initialize a package's __path__ to an empty li

Re: Finding user's home dir

2005-02-03 Thread Duncan Booth
Peter Hansen wrote: > Nemesis, please use the above recipe instead, as it makes > the more reasonable (IMHO) choice of checking for a HOME > environment variable before trying the expanduser("~") > approach. This covers folks like me who, though stuck > using Windows, despise the ridiculous Micro

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: 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 suspect he simply

Re: test msg

2005-02-03 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > tes tmsg if you meant to send this to a test group, it didn't work. complain to your provider. -- http://mail.python.org/mailman/listinfo/python-list

Re: Hey, get this!

2005-02-03 Thread Just
In article <[EMAIL PROTECTED]>, Bernhard Herzog <[EMAIL PROTECTED]> wrote: > Bernhard Herzog <[EMAIL PROTECTED]> writes: > > > Steve Holden <[EMAIL PROTECTED]> writes: > >> if package: > >> module.__path__ = sys.path > > > > You usually should initialize a package's __path_

Re: Popularizing SimpleHTTPServer and CGIHTTPServer

2005-02-03 Thread Irmen de Jong
Jorey Bump wrote: Does anyone know how to use SimpleHTTPServer to: 1. Support virtual hosts? 2. Support SSL? I'd like to use SimpleHTTPServer to create some simple reporting utilities, but can't get past these two points. Is there a NotSoSimpleHTTPServer? Give Snakelets a try (snakelets.sf.net). I

Re: Popularizing SimpleHTTPServer and CGIHTTPServer

2005-02-03 Thread Jorey Bump
"Michele Simionato" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Just submitted a recipe with this goal in mind: > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/365606 You may want to warn people that if they run those commands in their home directory, they will instantly

test msg

2005-02-03 Thread [EMAIL PROTECTED]
tes tmsg -- http://mail.python.org/mailman/listinfo/python-list

Is there a market for python developers?

2005-02-03 Thread Mabon Dane
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? Mabon Dane -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 17, Issue 54

2005-02-03 Thread Diez B. Roggisch
Hi, first of all - please quote appropriately - especially if you receive the postings as digest. That prevents the signal-to-noise-ratio dropping to unknown lows... > Your responses will give me the required lifetime for my variables, but > not the required access at all levels of code (unless r

Re: Python-list Digest, Vol 17, Issue 54

2005-02-03 Thread Andrew James
Diez/Steve, Thanks for your responses. I did consider using the req object to store my request-life variables, but then I'm still stuck with having to pass the req object to every class in my application (and have to import modpython into every script as well) if I want to get some information a

Re: Hey, get this!

2005-02-03 Thread Bernhard Herzog
Bernhard Herzog <[EMAIL PROTECTED]> writes: > Steve Holden <[EMAIL PROTECTED]> writes: >> if package: >> module.__path__ = sys.path > > You usually should initialize a package's __path__ to an empty list. Actually, normally it's a list that contains the name of the package d

Re: Reinstall python 2.3 on OSX 10.3.5?

2005-02-03 Thread Joe Block
In article <[EMAIL PROTECTED]>, Just <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, Robert Kern <[EMAIL PROTECTED]> > wrote: > > > Christian Dieterich wrote: > > > On Dé Céadaoin, Feabh 2, 2005, at 17:48 America/Chicago, > > > [EMAIL PROTECTED] wrote: > > > > > >> Hi there > > >

Re: Finding user's home dir

2005-02-03 Thread Bernhard Herzog
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 suspect he

Re: global variables

2005-02-03 Thread Mark Jackson
Steve Holden <[EMAIL PROTECTED]> writes: > M.E.Farmer wrote: > > > Ok it has been a long day, > > In my reply to Steven Bethard , Steve should read Steven ;) > > > > M.E.Farmer > > > Well, since he signs himself "Steve" too I guess we'll just have to put > up with the ambiguities. Or perhaps, g

<    1   2   3   >