Re: Where is the syntax for the dict() constructor ?!

2007-07-06 Thread Hendrik van Rooyen
"Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote: > On Fri, 06 Jul 2007 08:34:55 +0200, Hendrik van Rooyen wrote: > > > You can even do it more simply - by writing a GetField() that > > scans for either the delimiter or end of line or end of file, and > > returns the "field" found, along wit

Getting the home directory in Python and a bug in os.path.expanduser

2007-07-06 Thread Edward Diener
What is the generic operating system way of getting the home directory ? I am guessing it is os.path.expanduser("~"). Is there a better way or an alternate way ? If it is as I surmise, the aforementioned expanduser("~") of os.path seems incorrect to me under Windows. The document says: "On Win

Re: object references/memory access

2007-07-06 Thread Alex Martelli
Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: ... > Think VMS was the most applicable for that behavior... Haven't seen > any dynamic priorities on the UNIX/Linux/Solaris systems I've > encountered... Dynamic priority scheduling is extremely common in Unixen today (and has been for many ye

Re: How would I write this C code in Python?

2007-07-06 Thread Steven D'Aprano
On Fri, 06 Jul 2007 17:31:50 +, DeveloperX wrote: > Python Attempt: Please note that since I can't type TABs online > easily, I am using the @ character to represent TABs in the following > Python code. Why not indent with spaces, just like you did for the example C code? -- Steven. --

Re: C++ Modules for python: How to?

2007-07-06 Thread John Machin
On Jul 7, 9:26 am, Robert Dailey <[EMAIL PROTECTED]> wrote: > On Jul 6, 3:06 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > > > Robert Dailey schrieb: > > > > Hi, > > > > I'm interested in making a C++ library of mine usable through python. > > > Python does a similar thing with Expat (the

Re: Repeating Thread Error

2007-07-06 Thread Steve Holden
Jonathan Shan wrote: Hello, I am trying to call a function every 5 seconds. My understanding of time.sleep() is during the sleep time everything "stops". However, in my application, there are background processes that must be running continuously during the five second interval. Thus, threading.

Re: ImportError: "No Module named xxx"

2007-07-06 Thread John Machin
On Jul 7, 7:37 am, Robert Dailey <[EMAIL PROTECTED]> wrote: > On Jul 6, 4:04 pm, Bjoern Schliessmann > > > [EMAIL PROTECTED]> wrote: > > Robert Dailey wrote: > > > The description of -m is confusing in the documentation, what does > > > it really do? > > > IMHO, it's quite clear. What's unclear wi

Re: Repeating Thread Error

2007-07-06 Thread jimxu
hmm.. why use while True? After 5 secs, the function is going to run. so t = threading.Thread(5.0, func) t.start() should just work. Put it in a infinite loop will start the thread and then start a the stopped thread... forever. Jim On Jul 6, 2007, at 2:40 PM, Jonathan Shan wrote: > Hello,

Re: Expandable 2D Dictionaries?

2007-07-06 Thread Steve Holden
Jean-Paul Calderone wrote: > On Fri, 06 Jul 2007 15:43:55 -, Robert Dailey <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I am interested in creating an expandable (dynamic) 2D dictionary. For >> example: >> >> myvar["cat"]["paw"] = "Some String" >> >> The above example assumes "myvar" is declared. In

Re: C++ Modules for python: How to?

2007-07-06 Thread Robert Dailey
On Jul 6, 3:06 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Robert Dailey schrieb: > > > Hi, > > > I'm interested in making a C++ library of mine usable through python. > > Python does a similar thing with Expat (the non-validating XML > > parser). I notice that with Expat, python is importi

Re: Repeating Thread Error

2007-07-06 Thread Marc 'BlackJack' Rintsch
On Fri, 06 Jul 2007 14:40:16 -0700, Jonathan Shan wrote: > I am trying to call a function every 5 seconds. My understanding of > time.sleep() is during the sleep time everything "stops". Not "everything", just the thread in which `sleep()` is called. > However, in my application, there are backg

Re: Auto-parallelizing with decorators?

2007-07-06 Thread Kirk Strauser
In article <[EMAIL PROTECTED]>, Kirk Strauser <[EMAIL PROTECTED]> wrote: > I was thinking about how a lot of Lisp proponents claim that Lisp is > inherently parallelizable because its functions don't have (or are not > supposed to have) side effects, and therefore the compiler can easily tell > w

Repeating Thread Error

2007-07-06 Thread Jonathan Shan
Hello, I am trying to call a function every 5 seconds. My understanding of time.sleep() is during the sleep time everything "stops". However, in my application, there are background processes that must be running continuously during the five second interval. Thus, threading.Timer seems like a good

Re: ImportError: "No Module named xxx"

2007-07-06 Thread Robert Dailey
On Jul 6, 4:04 pm, Bjoern Schliessmann wrote: > Robert Dailey wrote: > > The description of -m is confusing in the documentation, what does > > it really do? > > IMHO, it's quite clear. What's unclear with this description: > > -m module-nameSearches sys.path for the named module and runs >

Re: ImportError: "No Module named xxx"

2007-07-06 Thread Bjoern Schliessmann
Robert Dailey wrote: > The description of -m is confusing in the documentation, what does > it really do? IMHO, it's quite clear. What's unclear with this description: -m module-nameSearches sys.path for the named module and runs the corresponding .py file as a script. Reg

hi everyone if you want to be come a member please follow the lınk

2007-07-06 Thread kasim
Sample email Dear __, I recently joined AGLOCO because of a friend recommended it to me. I am now promoting it to you because I like the idea and I want you to share in what I think will be an exciting new Internet concept. AGLOCO's story is simple: Do you realize how valuable you are?

Re: The best platform and editor for Python

2007-07-06 Thread J Sisson
On 7/6/07, Ed Jensen <[EMAIL PROTECTED]> wrote: Alex Martelli <[EMAIL PROTECTED]> wrote: > Calling all vi/vim users (and we'll heartily appreciate the support of > TextMate fans, BBEdit ones, etc, etc) -- we're at risk being defined out > of existence, since we're neither happy with Emacs nor wa

Re: The best platform and editor for Python

2007-07-06 Thread Ed Jensen
Alex Martelli <[EMAIL PROTECTED]> wrote: > Calling all vi/vim users (and we'll heartily appreciate the support of > TextMate fans, BBEdit ones, etc, etc) -- we're at risk being defined out > of existence, since we're neither happy with Emacs nor wanting anything > like Visual Studio, and yet Kay cl

Re: Python's "only one way to do it" philosophy isn't good?

2007-07-06 Thread Douglas Alan
"Chris Mellon" <[EMAIL PROTECTED]> writes: > Sure, but thats part of the general refcounting vs GC argument - > refcounting gives (a certain level of) timeliness in resource > collection, GC often only runs under memory pressure. If you're > saying that we should keep refcounting because it provid

Re: The file executing

2007-07-06 Thread Benjamin
On Jul 3, 8:56 am, Sebastian Wiesner <[EMAIL PROTECTED]> wrote: > [ Benjamin <[EMAIL PROTECTED]> ] > > > On Jul 2, 9:47 pm, Justin Ezequiel <[EMAIL PROTECTED]> > > > wrote: > > > On Jul 3, 9:40 am, Benjamin <[EMAIL PROTECTED]> wrote: > > > > How does one get the path to the file currently executing

Re: C++ Modules for python: How to?

2007-07-06 Thread Diez B. Roggisch
Robert Dailey schrieb: > Hi, > > I'm interested in making a C++ library of mine usable through python. > Python does a similar thing with Expat (the non-validating XML > parser). I notice that with Expat, python is importing a C++ header > file into a PY file and the interface is available to pyth

Re: Auto-parallelizing without decorators?

2007-07-06 Thread John Nagle
Kirk Strauser wrote: > I was thinking about how a lot of Lisp proponents claim that Lisp is > inherently parallelizable because its functions don't have (or are not > supposed to have) side effects, and therefore the compiler can easily tell > which calls may be run in parallel instead of strictly

Re: ImportError: "No Module named xxx"

2007-07-06 Thread Robert Dailey
Never mind, I found the problem. I was doing: python -m compile.py I really should have been doing: python compile.py The description of -m is confusing in the documentation, what does it really do? -- http://mail.python.org/mailman/listinfo/python-list

ImportError: "No Module named xxx"

2007-07-06 Thread Robert Dailey
I created a basic python file and made an attempt to execute it from the command line, however it gives me a weird error after the python file has been executed: Traceback (most recent call last): File "C:\Python25\lib\runpy.py", line 87, in run_module raise ImportError("No module named " +

C++ Modules for python: How to?

2007-07-06 Thread Robert Dailey
Hi, I'm interested in making a C++ library of mine usable through python. Python does a similar thing with Expat (the non-validating XML parser). I notice that with Expat, python is importing a C++ header file into a PY file and the interface is available to python. I've read through the python do

Re: IDEs for COM scripting: C# v. Python v. Iron Python v. JPython

2007-07-06 Thread John J. Lee
"Méta-MCI" <[EMAIL PROTECTED]> writes: [...] > And, all COM-servers builds with Python are dynamic-COM-server. Not true. Look for "comtypes" on this page: http://python.net/crew/theller/ctypes/ [...] > about Iron Python: is there a good IDE for it that has a typing assist? MS calls this "typin

Re: urllib to cache 301 redirections?

2007-07-06 Thread John J. Lee
"O.R.Senthil Kumaran" <[EMAIL PROTECTED]> writes: > Hi, > There is an Open Tracker item against urllib2 library python.org/sf/735515 > which states that. > urllib / urllib2 should cache the results of 301 (permanent) redirections. > This shouldn't break anything, since it's just an internal optimi

Re: file reading anomaly

2007-07-06 Thread Gerry
Final update: problem solved. In the big script, the snippet was reading depstats.txt which hadn't been closed. Sorry for all the bother. Gerry -- http://mail.python.org/mailman/listinfo/python-list

Re: Restarting a Python Application

2007-07-06 Thread kyosohma
On Jul 3, 5:00 pm, Matimus <[EMAIL PROTECTED]> wrote: > On Jul 3, 2:27 pm, [EMAIL PROTECTED] wrote: > > > > > Hi, > > > I packaged up an application I am developing into an executable. In > > the application, it has user configurable options. I would like a way > > to restart the application so tha

Re: file reading anomaly

2007-07-06 Thread Gerry
Update: The PC seems to not be a factor (same problem exist on two PCs). The entire script does some computation and writes depstats.txt. The code snippet below attempts to read depstats.txt and write another file. When the code below is run stand-alone, it succeeds. When run in-line as p

Re: connecting to serial port + python

2007-07-06 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Japan Shah <[EMAIL PROTECTED]> wrote: >Hello, > >I am trying to connect my Nokia 6610 using usb cable, >I have installed usb-serial driver of it. > > >I hv tested it with Hyperterminal and it works fine. > >but when I wrote a python script I am not able to receive t

Re: Mixing Python and C threads

2007-07-06 Thread Stéphane Larouche
Aahz pythoncraft.com> writes: > In article python.org>, > =?utf-8?b?U3TDqXBoYW5l?= Larouche polymtl.ca> wrote: > > > >If I call the methods in the C++ modules from the Python main thread, I > >don't have any problem. However, they are usually called from another > >Python thread (using the thre

Re: Expandable 2D Dictionaries?

2007-07-06 Thread Marc 'BlackJack' Rintsch
On Fri, 06 Jul 2007 16:22:35 +, Robert Dailey wrote: > On Jul 6, 11:09 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> This gets much easier if you change your structure around a bit: >> >> d = {} >> d["cat", "paw"] = "some string" >> >> Jean-Paul > > I like this format. I'm not

Re: How would I write this C code in Python?

2007-07-06 Thread Marc 'BlackJack' Rintsch
On Fri, 06 Jul 2007 17:31:50 +, DeveloperX wrote: > I am trying to figure out how to rewrite the following chunk of code > in Python: > > C source > [code] > typedef struct PF > { > int flags; > long user; > char*filename; > unsigned char buffer[MAXBUFFERSIZE]; > } PF; > > typedef BL

How would I write this C code in Python?

2007-07-06 Thread DeveloperX
I am trying to figure out how to rewrite the following chunk of code in Python: C source [code] typedef struct PF { int flags; long user; char*filename; unsigned char buffer[MAXBUFFERSIZE]; } PF; typedef BLOCK { PF * packdata; } BLOCK; BLOCK* blocks; [/code] My first idea was to creat

Re: Tiny/small/minimalist Python?

2007-07-06 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Irmen de Jong <[EMAIL PROTECTED]> wrote: >Paul Rubin wrote: >> rtk <[EMAIL PROTECTED]> writes: >>> FYI.. I wanted a simple version of Python to run on an ancient DEC >>> Alpha box. I got VMS Python 2.5 up and running but it is too slow to >>> use. It takes *minute

file reading anomaly

2007-07-06 Thread Gerry
Python 2.5, Windows XP. I have a 48-line text file written by a Windows python script, I try to read it as follows: f = open ("depstats.txt", "r", 0) for index, line in enumerate(f): print index, len(line), len(line.split()) f.close() On one PC, this runs without any problem. On an

Re: Expandable 2D Dictionaries?

2007-07-06 Thread Robert Dailey
Thank you all very much for your valuable replies. I wasn't aware that tuples were valid keys in a dictionary object. This is actually the solution I was looking for. Thank you all once again. -- http://mail.python.org/mailman/listinfo/python-list

Re: what is wrong with that r"\"

2007-07-06 Thread i3dmaster
Then you can use other chars as the delimiter, [EMAIL PROTECTED]@b@ or r!a!b!, etc... The import thing is so long as the interpreter doesn't get confused on the data and the delimiter. sed also allows for arbitrary delimiters too as long as you maintain the integrity of the original meanin

Re: Expandable 2D Dictionaries?

2007-07-06 Thread Tommy Nordgren
On 6 jul 2007, at 17.43, Robert Dailey wrote: > Hi, > > I am interested in creating an expandable (dynamic) 2D dictionary. For > example: > > myvar["cat"]["paw"] = "Some String" > > The above example assumes "myvar" is declared. In order for this to > work, I have to know ahead of time the conten

Re: Expandable 2D Dictionaries?

2007-07-06 Thread Robert Dailey
On Jul 6, 11:09 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Fri, 06 Jul 2007 15:43:55 -, Robert Dailey <[EMAIL PROTECTED]> wrote: > >Hi, > > >I am interested in creating an expandable (dynamic) 2D dictionary. For > >example: > > >myvar["cat"]["paw"] = "Some String" > > >The above ex

Re: Expandable 2D Dictionaries?

2007-07-06 Thread Matimus
I'm not sure I completely understand what you want, but if you are using Python2.5 defaultdict might be useful. Below is some example code using defaultdict. [code] from collections import defaultdict myvar = defaultdict(dict) myvar["cat"]["paw"] = "SomeString" myvar["dog"]["tail"] = "wags" myv

Re: Expandable 2D Dictionaries?

2007-07-06 Thread Jean-Paul Calderone
On Fri, 06 Jul 2007 15:43:55 -, Robert Dailey <[EMAIL PROTECTED]> wrote: >Hi, > >I am interested in creating an expandable (dynamic) 2D dictionary. For >example: > >myvar["cat"]["paw"] = "Some String" > >The above example assumes "myvar" is declared. In order for this to >work, I have to know a

Re: Expandable 2D Dictionaries?

2007-07-06 Thread Carsten Haese
On Fri, 2007-07-06 at 15:43 +, Robert Dailey wrote: > Hi, > > I am interested in creating an expandable (dynamic) 2D dictionary. For > example: > > myvar["cat"]["paw"] = "Some String" > > The above example assumes "myvar" is declared. In order for this to > work, I have to know ahead of time

Re: Auto-parallelizing with decorators?

2007-07-06 Thread Kirk Strauser
Stefan Behnel wrote: > Wouldn't that require parallelism in the interpreter first? Mind the > GIL... That may be. I'd bet though that I could whip up a native Python workalike using os.fork() that would work around GIL, at least on Unix (just because I don't know if Windows has os.fork(), having

Re: Expandable 2D Dictionaries?

2007-07-06 Thread Robert Dailey
On Jul 6, 10:54 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Robert Dailey wrote: > > Hi, > > > I am interested in creating an expandable (dynamic) 2D dictionary. For > > example: > > > myvar["cat"]["paw"] = "Some String" > > > The above example assumes "myvar" is declared. In order for this

Re: Expandable 2D Dictionaries?

2007-07-06 Thread Diez B. Roggisch
Robert Dailey wrote: > Hi, > > I am interested in creating an expandable (dynamic) 2D dictionary. For > example: > > myvar["cat"]["paw"] = "Some String" > > The above example assumes "myvar" is declared. In order for this to > work, I have to know ahead of time the contents of the dictionary. F

Expandable 2D Dictionaries?

2007-07-06 Thread Robert Dailey
Hi, I am interested in creating an expandable (dynamic) 2D dictionary. For example: myvar["cat"]["paw"] = "Some String" The above example assumes "myvar" is declared. In order for this to work, I have to know ahead of time the contents of the dictionary. For the above to work, my declaration mus

Re: Auto-parallelizing with decorators?

2007-07-06 Thread Stefan Behnel
Kirk Strauser wrote: > Suppose that Python had a new decorator, say "@parallelizable". Functions > so decorated would be eligible for multi-processed or multi-threaded > execution by such native constructs as list comprehensions, or the map() > function. Wouldn't that require parallelism in the i

Auto-parallelizing with decorators?

2007-07-06 Thread Kirk Strauser
I was thinking about how a lot of Lisp proponents claim that Lisp is inherently parallelizable because its functions don't have (or are not supposed to have) side effects, and therefore the compiler can easily tell which calls may be run in parallel instead of strictly serially. I'm not a Lisp exp

Re: VB frontend to Python COM backend

2007-07-06 Thread nik
Thank you for the lead. That is exactly what I was wishing for. Thank you, Nik -- http://mail.python.org/mailman/listinfo/python-list

Re: Mixing Python and C threads

2007-07-06 Thread Aahz
In article <[EMAIL PROTECTED]>, =?utf-8?b?U3TDqXBoYW5l?= Larouche <[EMAIL PROTECTED]> wrote: > >If I call the methods in the C++ modules from the Python main thread, I >don't have any problem. However, they are usually called from another >Python thread (using the threading module) to keep the GUI

Re: Re-raising exceptions with modified message

2007-07-06 Thread Gerard Flanagan
On Jul 6, 12:18 am, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: > Sorry for the soliloquy, but what I am really using is the following so > that the re-raised excpetion has the same type: > > def PoliteException(e): > class PoliteException(e.__class__): > def __init__(self, e): >

Mixing Python and C threads

2007-07-06 Thread Stéphane Larouche
I am currently developing a software called OpenFilters (available at www.polymtl.ca/larfis). Most of the software is written in Python, but the classes that do the hard work are written in C++ modules. Since, nowadays, most new computers have multiple cores and that I want to speed up the software

Re: VB frontend to Python COM backend

2007-07-06 Thread Harry George
nik <[EMAIL PROTECTED]> writes: > I have a VB6 application that I would like to attach to a python > communications application. > > I have come across several discussions on using VB with a Python COM > back-end, but no starting point. I haven't had anymore luck with > google at finding out what

Maria Sharapova Angelina joli

2007-07-06 Thread A KOURNIKOVA
Maria Sharapova Angelina joli search engines , cams , adult , photogallery , dating , travel , autos, cars , real estate , ads , spor , shopping , domain names www.alphasearch.gr-- http://mail.python.org/mailman/listinfo/python-list

Re: VB frontend to Python COM backend

2007-07-06 Thread Giles Brown
On 6 Jul, 06:58, nik <[EMAIL PROTECTED]> wrote: > I have a VB6 application that I would like to attach to a python > communications application. > > I have come across several discussions on using VB with a Python COM > back-end, but no starting point. I haven't had anymore luck with > google at fi

Re: Where is the syntax for the dict() constructor ?!

2007-07-06 Thread Neil Cerutti
On 2007-07-06, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-07-05, John Machin <[EMAIL PROTECTED]> wrote: >> On Jul 6, 5:31 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: >>> >>> Mostly you can use the default 'excel' dialect and be quite >>> happy, since Excel is the main reason anybody still ca

Re: Python's "only one way to do it" philosophy isn't good?

2007-07-06 Thread Chris Mellon
On 7/5/07, Douglas Alan <[EMAIL PROTECTED]> wrote: > "Chris Mellon" <[EMAIL PROTECTED]> writes: > > >> Some people here have been arguing that all code should use "with" to > >> ensure that the files are closed. But this still wouldn't solve the > >> problem of the large data structures being left

Re: Where is the syntax for the dict() constructor ?!

2007-07-06 Thread Neil Cerutti
On 2007-07-05, John Machin <[EMAIL PROTECTED]> wrote: > On Jul 6, 5:31 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: >> >> Mostly you can use the default 'excel' dialect and be quite >> happy, since Excel is the main reason anybody still cares about >> this unecessarily hard to parse (it requires mor

Re: The best platform and editor for Python

2007-07-06 Thread Neil Cerutti
On 2007-07-06, Alex Martelli <[EMAIL PROTECTED]> wrote: > Kay Schluehr <[EMAIL PROTECTED]> wrote: >> half of the community is happy with Emacs and the other half >> wants to program in a VS-like environment, neither consensus >> nor progress has > > Calling all vi/vim users (and we'll heartily appr

Re: list.append not working?

2007-07-06 Thread Rex Turnbull
Wildemar Wildenburger wrote: > Abhishek Jain wrote: >> with every iteration your previous values are overwritten ('md' is a >> dictionary) so thats why your are observing this ouput.. >> >> check if the following patch solves your problem >> >> for entity in temp: >> md['module']= ent

Re: Learn Oracle Database Administration in 10 Minutes

2007-07-06 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > Learn Oracle Database Administration in 10 Minutes. No kidding. Check > it yourself, > > http://www.takveen.com It already takes longer than 10 minutes to install, so I have the time to learn more than I find in that book before I even get to using it. Besides, this is

Learn Oracle Database Administration in 10 Minutes

2007-07-06 Thread [EMAIL PROTECTED]
Learn Oracle Database Administration in 10 Minutes. No kidding. Check it yourself, http://www.takveen.com Only good analogy makes complex concepts simple! -- http://mail.python.org/mailman/listinfo/python-list

Re: Re-raising exceptions with modified message

2007-07-06 Thread Neil Cerutti
On 2007-07-06, Alex Popescu <[EMAIL PROTECTED]> wrote: > On Jul 6, 4:20 am, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: >> Alex Popescu wrote: >> > Probably the simplest solution would be to create a new exception and >> > wrapping the old one and the additional info. Unfortunately, this >> > ma

Re: deliberate versus os socket timeout

2007-07-06 Thread Robin Becker
John J. Lee wrote: > > What do you mean "is in fact true"? Is what true? That the reason is > always formatted in those ways when those particular errors occur? > Not sure there's any reason to rely on that: I'd expect .reason to be > an exception object, so (reading the docs for module socket)

Re: SMTP server w/o using Twisted framework

2007-07-06 Thread Steve Holden
Gerhard Häring wrote: > _spitFIRE wrote: >> [looking up DNS MX records] >> Thanks for the pointer. However, as I said currently, I can't use >> anything other than the standard libraries. > > Sure you can. You just need to get rid of the "only standard library" > requirement rule. > > That works

Auto-response for your message to the "marketing-python" mailing list

2007-07-06 Thread marketing-python-bounces
This mailing list has been retired. Please use the new Python Advocacy mailing list instead: http://mail.python.org/mailman/listinfo/advocacy Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Where is the syntax for the dict() constructor ?!

2007-07-06 Thread Marc 'BlackJack' Rintsch
On Fri, 06 Jul 2007 08:34:55 +0200, Hendrik van Rooyen wrote: > "John Machin" wrote: > >> >> I don't know what you mean by "requires more than one >> character of lookahead" -- any non-Mickey-Mouse implementation of a >> csv reader will use a finite state machine with about half-a-dozen >> stat

Re: Re-raising exceptions with modified message

2007-07-06 Thread Alex Popescu
On Jul 6, 4:20 am, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: > Alex Popescu wrote: > > Probably the simplest solution would be to create a new exception and > > wrapping the old one and the additional info. Unfortunately, this > > may have a huge impact on 3rd party code that was catching the

Re: Re-raising exceptions with modified message

2007-07-06 Thread Alex Popescu
On Jul 6, 4:20 am, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: > Alex Popescu wrote: > -- http://mail.python.org/mailman/listinfo/python-list

Re: MethodType/FunctionType and decorators

2007-07-06 Thread Alex Popescu
On Jul 6, 6:19 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > Alex Popescu <[EMAIL PROTECTED]> wrote: > >... > > > frameworks (TestNG is not a unit testing framework, > > but a full flavored testing framework that fits perfectly functional > > testing, integration testing, and with some of the

Re: Writing a read only attribute

2007-07-06 Thread Martin v. Löwis
> root = Tk() > > # save call address > original_tk_call = root.tk.call > > # disable tcl command execution (this is the read-only attribute) > root.tk.call = tk_dummy_call > > ... some code ... > > # restore tcl command execution > root.tk.call = original_tk_call > > > My goal is to make ins

Writing a read only attribute

2007-07-06 Thread Fabrizio Pollastri
My code is the following: from Tkinter import * def tk_dummy_call(*args): return root = Tk() # save call address original_tk_call = root.tk.call # disable tcl command execution (this is the read-only attribute) root.tk.call = tk_dummy_call ... some code ... # restore tcl command execution

Re: Writing a read only attribute

2007-07-06 Thread Michele Simionato
On Jul 6, 8:27 am, Fabrizio Pollastri <[EMAIL PROTECTED]> wrote: > Hello, > it is possible to force in some way a write to a read-only attribute of > a python object? In which case? > Thanks for any answer. > > F. Pollastri What do you mean by read-only attribute? If you are trying to change attr

Re: converting datetime object in UTC to local time

2007-07-06 Thread i3dmaster
How about subclass datetime.tzinfo? That way you can use asttimezone to transfer utc to localtime. It requires an aware object though not naive. A bit more coding, but a lot less converting... Jim On Jul 3, 5:16 pm, Matt <[EMAIL PROTECTED]> wrote: > Hi all, > > So a lot of digging on doing this a

Re: SMTP server w/o using Twisted framework

2007-07-06 Thread Gerhard Häring
_spitFIRE wrote: > [looking up DNS MX records] > Thanks for the pointer. However, as I said currently, I can't use > anything other than the standard libraries. Sure you can. You just need to get rid of the "only standard library" requirement rule. That works best by showing the alternatives to

Re: import

2007-07-06 Thread Gary Herron
jolly wrote: > Hey guys, > > I'm rather new to python and i'm have trouble(as usual) > > I want to know if it is possible to change where 'import' looks > this will save me clogging up my python directory > > Thanks > Easily done. The value of sys.path is a list of directories that import

Re: import

2007-07-06 Thread Amit Khemka
On 7/6/07, jolly <[EMAIL PROTECTED]> wrote: > Hey guys, > > I'm rather new to python and i'm have trouble(as usual) Hope it becomes un-usual with Python ! > > I want to know if it is possible to change where 'import' looks > this will save me clogging up my python directory Yes. You can tel