Re: Generating .pyc/.pyo from a make file

2005-02-03 Thread Roland Heiber
Roland Heiber wrote: Tim Daneliuk wrote: under the impression that "compiled" meant optimized byte code that You where right, i was totally mislead by "optimized" ... ;) Greetings, Roland -- http://mail.python.org/mailman/listinfo/python-list

SysV IPC message queues

2005-02-03 Thread Aki Niimura
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 stream. I thought Python had a support of SysV message queues (I have found

Re: Finding user's home dir

2005-02-03 Thread Miki Tebeka
Hello Nemesis, > 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. Bye. -- Mi

Re: python-2.4.msi installation issue

2005-02-03 Thread Wolfram Kraus
[EMAIL PROTECTED] wrote: O/S: Windows XP Home (with Service Pack 2) Downloaded python-2.4.msi from python.org (10,632KB). When I double click on the file from Windows Explorer, the installation process presents the window in which I am prompted to either install for all users (the default) or inst

Re: IDLE history, Python IDE, and Interactive Python with Vim

2005-02-03 Thread Fuzzyman
If you use IPython for your interactive mode stuff, you'll have a nice history... Regards, Fuzzy http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list

Re: new style exception handleing

2005-02-03 Thread Ola Natvig
Peter Hansen wrote: Ola Natvig wrote: Does anybody know why it's not possible to raise Exceptions which are types (new-style-classes). I know all standard exceptions are classic classes, but if you make a custom exception which both inherits from a exception class and a new-style one the it caus

Re: pyFMOD problem

2005-02-03 Thread Thomas Heller
[EMAIL PROTECTED] (Tian) writes: > I am trying to use pyfmod in python to manipulate sound. > i have installed pyfmod, ctype, numarray (if they are necessary), i > also copied fmod.dll to python/DLLs as well as windows/system32, but First, you should copy fmod.dll to a directory somewhere where L

Re: new style exception handleing

2005-02-03 Thread Michele Simionato
Google is your friend. This has been discussed a lot in the past. For instance, google for the thread, "Exceptions as New Style Classes", there was also a PEP by Steven Taschuk, IIRC. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: IDLE history, Python IDE, and Interactive Python with Vim

2005-02-03 Thread Pierre Barbier de Reuille
Fuzzyman a écrit : If you use IPython for your interactive mode stuff, you'll have a nice history... Regards, Fuzzy http://www.voidspace.org.uk/python/index.shtml Best event : if your "EDITOR" system variable in "vim", using the "ed" command in ipython will bring "vim" with (eventually) the code y

Re: python and visual C++

2005-02-03 Thread Olivier Ravard
"Caleb Hattingh" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > Olivier > > If you consider using the ctypes module, you can write a dll (windows) or > a shared object (linux) using anything that can make one of those. > > For example, I have successfully used FreePascal

Re: Generating modul classes with eval

2005-02-03 Thread Axel Straschil
Hello! > Note that we don't need eval anywhere. Uuups, that looks realy cool! Thanks for that! Im fooling around with generating html-tags. As there are only two kind of html tags, one who can nest chields, and one who cant, i wantet to play arround with something like: I've got two base classe

Re: IDLE history, Python IDE, and Interactive Python with Vim

2005-02-03 Thread Bruno Desthuilliers
Daniel Bickett a écrit : This is certainly a worthy topic. There are several IDEs for Python (one I like very much being Komodo) that have plenty of fancy debugging features and advanced operations, however I have yet to encounter (elsewhere) the convenience that comes with being able to press F5 a

Re: IDLE history, Python IDE, and Interactive Python with Vim

2005-02-03 Thread Bruno Desthuilliers
Pierre Barbier de Reuille a écrit : Fuzzyman a écrit : If you use IPython for your interactive mode stuff, you'll have a nice history... Regards, Fuzzy http://www.voidspace.org.uk/python/index.shtml Best event : if your "EDITOR" system variable in "vim", using the "ed" command in ipython will brin

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

2005-02-03 Thread Robert
I just tried to convert a (hugh size) ftp.retrbinary run into a pseudo-file object with .read(bytes) method in order to not consume 500MB on a copy operation. First I thought, its easy as usual with python using something like 'yield' or so. Yet I didn't manage to do (without using threads or rew

Re: Finding user's home dir

2005-02-03 Thread Marc Christiansen
Miki Tebeka <[EMAIL PROTECTED]> wrote: > Hello Nemesis, > >> 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. Except it also execfile()s $HOME

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

2005-02-03 Thread Claudio Grondi
> {Key11: Value11 > > {Keyn1: Valuen1 > Keyn2: Valuen2 > ... > Keynn:Valuenn} > > Each pair in a dictionary is separated by CRLF and in each dictionary > numbers of pairs can be different. > I need to read only the last dictionary.What is a > best solution? > Thanks > Lad What about (not test

pyGTK warning

2005-02-03 Thread alexrait1
Hello, GtkWarning: gtk_widget_grab_default: assertion `GTK_WIDGET_CAN_DEFAULT (widget)' failed I am using python gtk binding with glade. All I did was to create a gui interface with glade (Stored as xml) and to load it with gtk.glade.XML("filename.glade"); Then I run it with gkt.main() and got th

Re: Logging

2005-02-03 Thread Neil Benn
Samuel Kilchenmann wrote: " .>>> logging._handlers.clear() .>>> logging.root.handlers = [] .>>> for l in logging.Logger.manager.loggerDict.values(): .>>> l.handlers = [] after logging.shutdown() and before getting the new logger, your script will probably run without errors. Hello,

Re: Crashing Python interpreter! (windows XP, python2.3.4, 2.3.5rc1, 2.4.0)

2005-02-03 Thread John Machin
Leeuw van der, Tim wrote: > >> > Do you have a file called drwtsn32.log anywhere on your computer? > > No, unfortunately I cannot find such file anywhere on my computer > > What do I do to get such file? Or anything equally useful? > On my Windows 2000 box, just crash something :-) Perhaps t

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

2005-02-03 Thread Martin Franklin
Robert wrote: I just tried to convert a (hugh size) ftp.retrbinary run into a pseudo-file object with .read(bytes) method in order to not consume 500MB on a copy operation. First I thought, its easy as usual with python using something like 'yield' or so. Yet I didn't manage to do (without using th

Re: new style exception handleing

2005-02-03 Thread Nick Coghlan
Ola Natvig wrote: Peter Hansen wrote: I can't actually think of a reason to need to base an exception on a new-style class, but perhaps you have a good one... It's quite simple to bypass the problem, it was more the reason I was wondering about too. Basically because fixing it without killing back

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

2005-02-03 Thread Martin Franklin
Martin Franklin wrote: Robert wrote: I just tried to convert a (hugh size) ftp.retrbinary run into a pseudo-file object with .read(bytes) method in order to not consume 500MB on a copy operation. [snip] H this is nearly there I think...: whoops... spoke too soon.. import ftplib class TransferA

Re: SUCCESS!

2005-02-03 Thread Peter Otten
Erik Johnson wrote: > I installed readline-devel. (Thank you for re-asking that question.) I had that hunch :-) > Interestingly, configure *still* says... > [EMAIL PROTECTED]:~/Python-2.3.4> ./configure | grep readline > checking for rl_pre_input_hook in -lreadline... no > checking for rl_compl

Re: Popularizing SimpleHTTPServer and CGIHTTPServer

2005-02-03 Thread Thomas Guettler
Am Wed, 02 Feb 2005 22:37:34 -0800 schrieb Michele Simionato: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/365606 >The standard library modules SimpleHTTPServer and CGIHTTPServer are >extremely >useful, but the documentation hides their virtues. I hope to improve the >situation with t

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

2005-02-03 Thread Martin Franklin
Martin Franklin wrote: Martin Franklin wrote: Robert wrote: I just tried to convert a (hugh size) ftp.retrbinary run into a pseudo-file object with .read(bytes) method in order to not consume 500MB on a copy operation. [snip] H this is nearly there I think...: whoops... spoke too soon.. Tri

Re: IDLE history, Python IDE, and Interactive Python with Vim

2005-02-03 Thread Richie Hindle
[Ashot] > I have been frustrated for quite some time with a lack of a history > command in IDLE To recall a line from your history in IDLE, cursor up to that line and hit Enter. > I've tried something called pyCrust, but this too didn't have history To recall a line from your history in PyCru

Re: Reinstall python 2.3 on OSX 10.3.5?

2005-02-03 Thread Just
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: 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: test_socket.py failure

2005-02-03 Thread Nick Coghlan
[EMAIL PROTECTED] wrote: Marc, it is possible that there was a change between glibc-2.2.4 and 2.2.5 that would account for the difference in behaviour. I think i'll write a little test program in C to check out getservbyname's return values in a little more controled env

Re: Easy Q: dealing with object type

2005-02-03 Thread Just
In article <[EMAIL PROTECTED]>, Steven Bethard <[EMAIL PROTECTED]> wrote: > Erik Johnson wrote: > > "Erick" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > >>Ah, you're running into the "old-style classes vs. new style classes". > >>Try subclassing from "object". > >> > >>F

Re: Generating .pyc/.pyo from a make file

2005-02-03 Thread Just
In article <[EMAIL PROTECTED]>, vincent wehren <[EMAIL PROTECTED]> wrote: > Tim Daneliuk wrote: > > Steve Holden wrote: > > > >> Roland Heiber wrote: > >> > >>> Tim Daneliuk wrote: > >>> > > Aha! Exactly ... and that makes perfect sense too. D'oh! I guess a > > better > > distribution strate

Re: errors

2005-02-03 Thread Kartic
Joel Eusebio said the following on 2/2/2005 4:53 PM: Can someone help me on this, I don' know where the "testmptest" came from but the mptest.py is at the /usr/local/apache2/htdocs/test directory and this error came from apache's error_log PythonHandler mod_python.publisher: ImportError: No module

Re: Basic file operation questions

2005-02-03 Thread Michael . Lang
In article <[EMAIL PROTECTED]>, 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() >> f.close() >> for line in lines: >> print line >

Re: Generating modul classes with eval

2005-02-03 Thread Peter Otten
Axel Straschil wrote: > class_dic = {} > class_dic['Br'] = _Tag > class_dic['Hr'] = _Tag > class_dic['Html'] = _ContainerTag > class_dic['Table'] = _ContainerTag > > for class_name, class_base in class_dic.items(): > class TmpClass(class_base): > def __init__(self, **props): >

RE: Crashing Python interpreter! (windows XP, python2.3.4, 2.3.5rc1, 2.4.0)

2005-02-03 Thread Leeuw van der, Tim
> > > -Original Message- > From: [EMAIL PROTECTED] on behalf of John Machin > Sent: Thu 2/3/2005 12:00 PM > To: python-list@python.org > Subject: Re: Crashing Python interpreter! (windows XP, python2.3.4, > 2.3.5rc1,2.4.0) > > > Leeuw van der, Tim wrote: > > > >> > Do you have a file

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() >> f.close() >> for line in lines: >> print line >> *** >> > > Can you not write

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

2005-02-03 Thread Fuzzyman
That's neater than my suggestion. Regards, Fuzzy http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list

Re: IDLE history, Python IDE, and Interactive Python with Vim

2005-02-03 Thread Steve Holden
Ashot wrote: WingIDE looks nice though, and it seems that the interactive shell is built in from the screenshots. Can you run a program to a certain point break point and use the shell? Indeed you can - there's an interpreter available that executes in the context of the current stack frame

Re: IDLE history, Python IDE, and Interactive Python with Vim

2005-02-03 Thread Steve Holden
Richie Hindle wrote: [Ashot] I have been frustrated for quite some time with a lack of a history command in IDLE To recall a line from your history in IDLE, cursor up to that line and hit Enter. The history is required to be available in a chunk, to copy and paste into a file. I've tried some

Re: IDLE history, Python IDE, and Interactive Python with Vim

2005-02-03 Thread Kartic
Ashot said the following on 2/2/2005 9:45 PM: Vim related: -- Ideally, it would be nice to have a command mapped to a keystroke that can append the last executed command to a file. Even better would be a system that would integrate the file editing and interactive command

Re: Awkwardness of C API for making tuples

2005-02-03 Thread Steve Holden
Fredrik Lundh wrote: Dave Cole wrote: for (i = 0; i < num_values; i++) { PyObject *obj; obj = PyInt_FromLong(value[i]); if (obj == NULL || PyTuple_SetItem(tuple, i, obj) != 0) { Py_DECREF(tuple); return NULL; } } in theory, if PyInt_FromLong succeeds, and PyTuple_SetItem fa

Re: IDLE history, Python IDE, and Interactive Python with Vim

2005-02-03 Thread Richie Hindle
[Steve] > The history is required to be available in a chunk, to copy and paste > into a file. I see, sorry, I didn't catch that the first time round. (In PyCrust you can use Alt+LeftDrag to copy a rectangular selection - you'll still need to remove any output, but at least you can get rid of

Re: Apache & Python 500 Error

2005-02-03 Thread Christian
Jeremy Bowers schrieb: But first, check your apache error log. Then you will know what your error is, too. Thanks for help, here is my error log: [Thu Feb 3 13:52:49 2005] [error] PythonHandler python: Traceback (most recent call last): [Thu Feb 3 13:52:49 2005] [error] PythonHandler python: F

Re: Generating modul classes with eval

2005-02-03 Thread Axel Straschil
Hello! > After the loop has finished, the global variable TmpClass will be bound to > whatever class was created last, and the variable class_base will be bound > to that the base class of that same TmpClass. Therefore only this last class > is guaranteed to work as expected. Great, now it workes

Re: Basic file operation questions

2005-02-03 Thread Steve Holden
[EMAIL PROTECTED] wrote: In article <[EMAIL PROTECTED]>, 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() f.close() for line in lines: print line *** Can you

Re: global variables

2005-02-03 Thread Steve Holden
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 signing myself "Stv

Re: Apache & Python 500 Error

2005-02-03 Thread Peter van Kampen
On 2005-02-02, Christian <[EMAIL PROTECTED]> wrote: > Hello, > > i have an apache 1.3 server with python on debian. Python works fine but > the scripts wont´t work. > > This easy script i want to do on apache: > > #!/usr/bin/python > import os > os.getcwd() > > in apache config i have done this:

ModPython: passing variables between handlers?

2005-02-03 Thread Andrew James
Hi all, I'm writing an application which runs within Apache and uses mod_python to provide basic authentication and return content to the user, something like: import modpython def handler(): # main part of the application starts here ... def authenhandler(): ... # Store information

Re: ModPython: passing variables between handlers?

2005-02-03 Thread Diez B. Roggisch
> import modpython > > def handler(): ># main part of the application starts here >... > > def authenhandler(): >... ># Store information about the user in an object >u = new User(req.user, pass) > What I'm really looking for is some sort of global dictionary like PHP'

Re: ModPython: passing variables between handlers?

2005-02-03 Thread Steve Holden
Andrew James wrote: Hi all, I'm writing an application which runs within Apache and uses mod_python to provide basic authentication and return content to the user, something like: import modpython . def handler(): # main part of the application starts here ... def authenhandler(): ...

Re: Finding user's home dir

2005-02-03 Thread Peter Hansen
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 didn't know about it. I didn't either... Nemesis, please use t

Re: streaming a file object through re.finditer

2005-02-03 Thread TZOTZIOY
On Wed, 2 Feb 2005 22:22:27 -0500, rumours say that Daniel Bickett <[EMAIL PROTECTED]> might have written: >Erick wrote: >> True, but it doesn't work with multiline regular expressions :( >If your intent is for the expression to traverse multiple lines (and >possibly match *across* multiple lines

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

2005-02-03 Thread Fuzzyman
By the way - all suggestions so far rely on chopping the last dictionary out as a string (naturally) and then using 'eval' to evaluate it. This has the inherent security problem that embedded python code will also be run. This is not just a security risk (which may *not* be an issue) but might cau

Re: Finding user's home dir

2005-02-03 Thread Lars
Works great with Python 2.3.4 on... dare I say it... windows xp >>> getHomeDir() 'C:\\Documents and Settings\\Lars' Regards Lars Nemesis wrote: > (..) > Please, could you test it on your systems and tell me what you got? > (..) -- http://mail.python.org/mailman/listinfo/python-list

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

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: 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: 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: 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: 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

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

test msg

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

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

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: 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: 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: 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: 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 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: 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: 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: 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: 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: 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: 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: 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: 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

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: 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

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
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 -

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: 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

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, *

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: 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

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: 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.

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

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

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

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

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

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

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

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: 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: 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: 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: 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

  1   2   3   >