Re: Anyway to designating the encoding of the "source" for compile?

2005-05-16 Thread Serge . Orlov
[EMAIL PROTECTED] wrote: > > Okay, I'll use one of the CJK codecs as the example. EUC-KR is the > > default encoding. > > > > >>> import sys;sys.getdefaultencoding() > > 'euc-kr' > > >>> 'íê' > > '\xc7\xd1\xb1\xdb' That is the problem. Non-ascii characters in byte strings are deprecated. Here is w

Re: ElemenTree and namespaces

2005-05-16 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > In theory, namespace prefixes are entirely arbitrary and only serve as > a temporary link to the namespace URI. In practice, people tend to get > emotionally attached to their favorite prefixes. XPath also breaks this > theory because it refers to prefixes rather than UR

Windows distribution suggestions?

2005-05-16 Thread Paul Rubin
As what must be penance for something or other, I'm needing to release a Python app for use under Windows XP. Please be gentle with me since I'm a Un*x weenie and the only thing I've had much practice with under Windows is rebooting it. My app contains three different programs (say alice.py, bob.

Re: Anyway to designating the encoding of the "source" for compile?

2005-05-16 Thread janeaustine50
John Machin wrote: > On 16 May 2005 16:44:30 -0700, [EMAIL PROTECTED] wrote: [snip] > > > Like I said, *ALL* you have to do (like in any other Unicode-aware > app) is decode your user input into Unicode (you *don't* need to parse > bits and pieces of it) and feed it in ... like this: > > >>> user_i

Re: Like Christ PBBUH Prayed

2005-05-16 Thread George Sakkis
"flamesrock" wrote: > I don't understand.. why is everyone talking about christ on > comp.lang.python? Isn't this not the place? > Maybe they know something we don't. -- http://mail.python.org/mailman/listinfo/python-list

Re: query progress bar

2005-05-16 Thread Timothy Smith
Harald Massa wrote: >>it's for wx, the problem isn't making the progress bar itself, it's >>knowing how long the query is going to run for. >>i'm using pypgsql >> >> > >It is quite easy: > >from timemachine import oracle > >guesser=oracle(guess="SQL") >guesser.set_hint(driver="pypgsql") >gues

Re: RotatingFileHandler in Python 2.3.5

2005-05-16 Thread Vinay Sajip
new pip gmail.com> writes: > > Is the RotatingFileHandler (from the logging module) available in > Python 2.3.5? I'm getting a "AttributeError: 'module' object has no > attribute 'RotatingFileHandler'" error message when trying to use it. The handler is in the logging.handlers module, not in th

Interaction between TclTk editor with Python code

2005-05-16 Thread ab
Hi, I have an editor(front end) that is written in Tcl/Tk. It has a menu bar, menu buttons, edit boxes, listboxes & comboboxes. I am invoking this editor from an application that is written in Python. all the necessary processing is done in Python and displaying is done by the Tcl/Tk code. Now if

Re: Python Polymorphism

2005-05-16 Thread Donn Cave
Quoth "=?iso-8859-1?q?Steffen_Gl=FCckselig?=" <[EMAIL PROTECTED]>: | |> Ah, that's not polymorphism; it's method overloading. And AFAIK it is | |> not possible in Python. | It IS polymorphism. Not the one one is usually referring to, but it is. | Overloading is an 'ad hoc'-polymorphism. Or 'bogus'

Re: query progress bar

2005-05-16 Thread Harald Massa
> it's for wx, the problem isn't making the progress bar itself, it's > knowing how long the query is going to run for. > i'm using pypgsql It is quite easy: from timemachine import oracle guesser=oracle(guess="SQL") guesser.set_hint(driver="pypgsql") guesser.set_hint(gui="wx") expected_runtim

Re: Null String Variable

2005-05-16 Thread Steve Holden
Sean McIlroy wrote: > well, somebody's already pointed out that bool(msg)==False iff msg==''. > i'm curious to know what's wrong with simply writing > > if msg=='': > ## do_something > You would write this if there was a possibility that msg could be something other than a string, whose valu

RE: Python Interest Group Query

2005-05-16 Thread Lee Cullens
Python Interest Group Query I'm aware of the Boston PIG, a smaller one in Amherst and have been told that there is possibly a PIG in Manchester, NH. Basically I'm trying to find out if there are any, or any interest in (or even any other Python users at all :~)) in a PIG in the northern NE

Re: Python on a public library computer

2005-05-16 Thread flamesrock
Panix.com seems a little on the expensive side.. 10$/mo? Roy Smith wrote: > Timothy Smith <[EMAIL PROTECTED]> wrote: > > there's a few (brave) public access unix shell providers out there. if > > you could run telnet you could use them > > If you want to go that route, I highly suggest panix.com.

Re: Applying a function to a 2-D numarray

2005-05-16 Thread Robert Kern
Matt Feinstein wrote: > On Mon, 16 May 2005 12:03:24 -0600, Steven Bethard > <[EMAIL PROTECTED]> wrote: > >>Can you give an example of what you really want to do? Probably there >>are numarray functions that you can use. In general, you'll do better >>applying a sequence of numarray functions

Re: Parsing text into dates?

2005-05-16 Thread gene . tani
The beautiful brand new cookbook2 has "Fuzzy parsing of Dates" using dateutil.parser, which you run once you have a decent guess at locale (page 127 of cookbook) John Roth wrote: > "Thomas W" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > I'm developing a web-application where t

Re: Parsing text into dates?

2005-05-16 Thread John Roth
"Thomas W" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm developing a web-application where the user sometimes has to enter > dates in plain text, allthough a format may be provided to give clues. > On the server side this piece of text has to be parsed into a datetime > python

Re: Parsing text into dates?

2005-05-16 Thread George Sakkis
"John Machin" <[EMAIL PROTECTED]> wrote: > On 16 May 2005 17:51:31 -0700, "George Sakkis" <[EMAIL PROTECTED]> > wrote: > > > >#=== > > > >def parseDateTime(string, USA=False, implyCurrentDate=False, > > yearHeuristic=_20thcentury

RotatingFileHandler in Python 2.3.5

2005-05-16 Thread new pip
Is the RotatingFileHandler (from the logging module) available in Python 2.3.5? I'm getting a "AttributeError: 'module' object has no attribute 'RotatingFileHandler'" error message when trying to use it. Thank you -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing text into dates?

2005-05-16 Thread John Machin
On 16 May 2005 17:51:31 -0700, "George Sakkis" <[EMAIL PROTECTED]> wrote: >#=== > >def parseDateTime(string, USA=False, implyCurrentDate=False, > yearHeuristic=_20thcenturyHeuristic): >'''Tries to parse a string as a valid d

Re: question about the id()

2005-05-16 Thread Giovanni Bajo
Peter Dembinski wrote: >> BTW, a typical performance optimization (not done automatically by >> python) is to hoist unchanging-value expressions out of loops, and >> obj.method is often such an expression, so you will this strategy >> when people try >> to squeeze extra performance from their prog

Re: Reg Date string conversion into timestamp function

2005-05-16 Thread George Sakkis
"praba kar" <[EMAIL PROTECTED]> wrote: > > Dear All, > > I have doubt regarding date string to time > conversion function. In Python I cannot find flexible > date string conversion function like php strtotime. I > try to use following type > function > 1) parsedate function failed if a date s

Re: Parsing text into dates?

2005-05-16 Thread George Sakkis
"Thomas W" wrote: > I'm developing a web-application where the user sometimes has to enter > dates in plain text, allthough a format may be provided to give clues. > On the server side this piece of text has to be parsed into a datetime > python-object. Does anybody have any pointers on this? > >

Re: Anyway to designating the encoding of the "source" for compile?

2005-05-16 Thread John Machin
On 16 May 2005 16:44:30 -0700, [EMAIL PROTECTED] wrote: > >[EMAIL PROTECTED] wrote: >> John Machin ??: >> > On 16 May 2005 10:15:22 -0700, [EMAIL PROTECTED] wrote: >> > >> > >[EMAIL PROTECTED] wrote: >> > >> Python's InteractiveInterpreter uses the built-in compile >> function. >> > >> >> > >> Acc

Re: query progress bar

2005-05-16 Thread Timothy Smith
[EMAIL PROTECTED] wrote: >What type of UI is this for? The Python Cookbook, 2nd Ed. has a nice >textual solution. I'm not sure if this is the same one, but here is href="http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/168639";>one >from ASPN. Here is one href="http://wxpython.org/docs/api/

Re: CGI on Windows

2005-05-16 Thread Jason Drew
Rainer Mansfeld wrote: > Jason Drew wrote: > > I believe you're experiencing a bug that I also encountered, and for > > which there is a patch. See: > > http://sourceforge.net/tracker/?group_id=5470&atid=105470&func=detail&aid=1110478 > > > > Fixing os.py as described in the patch fixed all my CGI

Re: Anyway to designating the encoding of the "source" for compile?

2005-05-16 Thread janeaustine50
[EMAIL PROTECTED] wrote: > John Machin ìì: > > On 16 May 2005 10:15:22 -0700, [EMAIL PROTECTED] wrote: > > > > >[EMAIL PROTECTED] wrote: > > >> Python's InteractiveInterpreter uses the built-in compile > function. > > >> > > >> According to the ref. manual, it doesn't seem to concern about the > >

Re: query progress bar

2005-05-16 Thread [EMAIL PROTECTED]
What type of UI is this for? The Python Cookbook, 2nd Ed. has a nice textual solution. I'm not sure if this is the same one, but here is http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/168639";>one from ASPN. Here is one http://wxpython.org/docs/api/wx.ProgressDialog-class.html";> for wxPyt

Re: Python on a public library computer

2005-05-16 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Chris Lambacher <[EMAIL PROTECTED]> wrote: > usb key and moveable python. > http://www.voidspace.org.uk/python/movpy/ That's pretty cool. Python on a stick! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python on a public library computer

2005-05-16 Thread Roy Smith
Timothy Smith <[EMAIL PROTECTED]> wrote: > there's a few (brave) public access unix shell providers out there. if > you could run telnet you could use them If you want to go that route, I highly suggest panix.com. They've been in business forever, are geek friendly, and have a technical support

Re: Python on a public library computer

2005-05-16 Thread Chris Lambacher
usb key and moveable python. http://www.voidspace.org.uk/python/movpy/ On 5/16/05, Timothy Smith <[EMAIL PROTECTED]> wrote: > John J. Lee wrote: > > >"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > > > > > > >>Here's my situation: > >> > >>I'm typing this in a public library on a computer wit

Re: Anyway to designating the encoding of the "source" for compile?

2005-05-16 Thread janeaustine50
John Machin ìì: > On 16 May 2005 10:15:22 -0700, [EMAIL PROTECTED] wrote: > > >[EMAIL PROTECTED] wrote: > >> Python's InteractiveInterpreter uses the built-in compile function. > >> > >> According to the ref. manual, it doesn't seem to concern about the > >> encoding of the source string. > >> > >>

Re: Python on a public library computer

2005-05-16 Thread Timothy Smith
John J. Lee wrote: >"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > > >>Here's my situation: >> >>I'm typing this in a public library on a computer with OS windows 2000 >>server. I can run Internet explorer, word, excel and powerpoint, that's >>it. Maybe java, but it seems to be flaky. >> >>

Re: Python on a public library computer

2005-05-16 Thread John J. Lee
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Here's my situation: > > I'm typing this in a public library on a computer with OS windows 2000 > server. I can run Internet explorer, word, excel and powerpoint, that's > it. Maybe java, but it seems to be flaky. > > I want to run python scripts

Re: Parsing text into dates?

2005-05-16 Thread Peter Hansen
John Machin wrote: > If this application is being deployed from a central server where the > users can be worldwide, you have two options: > > (a) try to work out somehow what the user's locale is, and then work > with dates in the legacy format "appropriate" to the locale. And this inevitably sc

Re: Null String Variable

2005-05-16 Thread Peter Hansen
Sean McIlroy wrote: > well, somebody's already pointed out that bool(msg)==False iff msg==''. I may not have received the message yet, but if "iff" still means "if and only if", then that statement is wrong. There are, of course, about a dozen things for which bool(msg) is False when msg != '',

Re: Quick Reference from module doc strings.

2005-05-16 Thread Ron Adam
Scott David Daniels wrote: > Ron Adam wrote: > >>Do you have any feature suggestions, additional information that could >>go in, something that would extend the content in some way and make it >>more useful? >> >>As it stands now, it could be just a module, so you could... >> > > The style is s

Re: Parsing text into dates?

2005-05-16 Thread John Machin
On 16 May 2005 13:59:31 -0700, "Thomas W" <[EMAIL PROTECTED]> wrote: >I'm developing a web-application where the user sometimes has to enter >dates in plain text, allthough a format may be provided to give clues. >On the server side this piece of text has to be parsed into a datetime >python-objec

query progress bar

2005-05-16 Thread Timothy Smith
is it possible to mke a progress bar for queries? say i have a query that will take 20 seconds, i'd like to give some feed back to users on how long this will take. -- http://mail.python.org/mailman/listinfo/python-list

Re: Null String Variable

2005-05-16 Thread Sean McIlroy
well, somebody's already pointed out that bool(msg)==False iff msg==''. i'm curious to know what's wrong with simply writing if msg=='': ## do_something -- http://mail.python.org/mailman/listinfo/python-list

Re: Markov chain with extras?

2005-05-16 Thread George Sakkis
> Hi All, > > Could someone show me how to do this? > > I want to generate a list using a Markov chain, however, as well as > using the previous two items in the list to decide the current choice I > want the decision to be also dependant on an item at the current > position in another list. > > I

Re: Recommended version of gcc for Python?

2005-05-16 Thread Dave Kuhlman
[EMAIL PROTECTED] wrote: > On Ubuntu, I have tried 3.3.4, 3.4.3 and 4.0. Compile and make > test ran successfully with all three. For my benchmark, platform, > and compiler options, 3.4.3 was the fastest by approximately 2%. > > I would normally use the default compiler for your distribution. >

Re: tkinter puzzler

2005-05-16 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: >Martin Franklin <[EMAIL PROTECTED]> writes: >> I suspect you need to look at the columnconfigure / rowconfigure methods >> of the container (toplevel or frame) > >Thanks, columnconfigure turned out to be the answer and

Re: Resizing VListBox on parent (wxPython)

2005-05-16 Thread Ivan Voras
Solved - I didn't know the importance of "proportion" parametar. -- http://mail.python.org/mailman/listinfo/python-list

Re: Extracting pickle from Python

2005-05-16 Thread "Martin v. Löwis"
Philippe C. Martin wrote: > How would one go about extracting the pickle module from Python (ex: to make > a .a or a .dll) ? Pickle relies heavily on Python, so you most likely have to take the rest of Python as well when trying to integrate pickle elsewhere? Are you looking for pickle or cPickle

Re: Newbie : checking semantics

2005-05-16 Thread Bengt Richter
On Mon, 16 May 2005 18:40:43 +0200, Stefan Nobis <[EMAIL PROTECTED]> wrote: >rbt <[EMAIL PROTECTED]> writes: > >> True beginners (no programming experience whatsoever) don't have >> to deal with unlearning stuff such as the bracket plague. > >That's true. But they also not very used to give nothin

Re: Python RPM and CentOS

2005-05-16 Thread flamesrock
I know that gentoo has support for local repositories, and emerge is built on python so...this would make sense. But there is a difference between rpms and ebuilds.. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem listing services with wmi

2005-05-16 Thread Roger Upole
The only thing I could find for the hresult is that it corresponds to wbemErrCriticalError. According to this page http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wbemerrorenum.asp it's some kind of internal error. Roger "Jean-Sébastien Guay" <[EMAIL PROTECTE

Re: optparse global

2005-05-16 Thread [EMAIL PROTECTED]
Thanks. It works. -Ashton -- http://mail.python.org/mailman/listinfo/python-list

Re: Like Christ PBBUH Prayed

2005-05-16 Thread flamesrock
I don't understand.. why is everyone talking about christ on comp.lang.python? Isn't this not the place? -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem listing services with wmi

2005-05-16 Thread Larry Bates
I guess I was wrong and it does work, but from Python Style Guide: Whitespace in Expressions and Statements Pet Peeves Guido hates whitespace in the following places: - Immediately before the open parenthesis that starts the argument list of a function call, as in "spam (1)". A

Re: Anyway to designating the encoding of the "source" for compile?

2005-05-16 Thread John Machin
On 16 May 2005 10:15:22 -0700, [EMAIL PROTECTED] wrote: >[EMAIL PROTECTED] wrote: >> Python's InteractiveInterpreter uses the built-in compile function. >> >> According to the ref. manual, it doesn't seem to concern about the >> encoding of the source string. >> >> When I hand in an unicode object

Re: Applying a function to a 2-D numarray

2005-05-16 Thread Steven Bethard
Matt Feinstein wrote: > Well, for example, suppose I want to modify the elements of the matrix > in some fashion. However, I'm not entirely sure how I want to do it. > As a strawman, I generate a function with a Boolean test in it that > multiplies by one factor if the matrix element is in an inter

Markov chain with extras?

2005-05-16 Thread temp
Hi All, Could someone show me how to do this? I want to generate a list using a Markov chain, however, as well as using the previous two items in the list to decide the current choice I want the decision to be also dependant on an item at the current position in another list. I hope this explain

Like Christ PBBUH Prayed

2005-05-16 Thread Obaid R.
THE POSTER vs. CHRIST = For those who follow this frequently re-appearing thread, and the various responses to it, I wish to remind them of the following: 1. There is a detailed response to the claims of the poster here: http://groups-beta.google.com/group/microsoft.public.wi

Re: Null String Variable

2005-05-16 Thread Klaus Alexander Seistrup
Rotary wrote: > I want to say something like that: if msg is empty ...then do > something. So how can i figure that msg is empty string (no > character, msg = ''). #v+ if not msg: print 'msg is empty' #v- -- Klaus Alexander Seistrup Magnetic Ink, Copenhagen, Denmark http://magnetic-ink

Null String Variable

2005-05-16 Thread rotary
I have a variable that store a string (i.e. a variable name msg).I want to say something like that: if msg is empty ...then do something.So how can i figure that msg is empty string (no character, msg = '').Maybe a silly question but i have no programming experiense.Thanks, Leonidas -- http:

Socket object and KeyboardInterrupt exception

2005-05-16 Thread PantherSE
Hello, Ok, here's my situation. I have a small application that listens to messages on a UDP port. When I pass None to settimeout(), and I hit Ctrl+C to interrupt the wait my exception handler catches the KeyboardInterrupt exception. However, if I pass any value to settimeout() the exception is n

Re: Newbie : checking semantics

2005-05-16 Thread Stefan Nobis
Andrew Dalke <[EMAIL PROTECTED]> writes: > See the program "pindent.py" Thanks for the hint, i didn't know about it. -- Stefan. -- http://mail.python.org/mailman/listinfo/python-list

Re: CGI on Windows

2005-05-16 Thread Rainer Mansfeld
Jason Drew wrote: > I believe you're experiencing a bug that I also encountered, and for > which there is a patch. See: > http://sourceforge.net/tracker/?group_id=5470&atid=105470&func=detail&aid=1110478 > > Fixing os.py as described in the patch fixed all my CGI-related > problems. Hope it does f

Re: ElemenTree and namespaces

2005-05-16 Thread Matthew Thorley
Thanks Andrew & Oren, that should do the trick. -- http://mail.python.org/mailman/listinfo/python-list

Parsing text into dates?

2005-05-16 Thread Thomas W
I'm developing a web-application where the user sometimes has to enter dates in plain text, allthough a format may be provided to give clues. On the server side this piece of text has to be parsed into a datetime python-object. Does anybody have any pointers on this? Besides the actual parsing, my

Re: python-dev Summary for 2005-04-16 through 2005-04-30

2005-05-16 Thread Ville Vainio
> "Steven" == Steven Bethard <[EMAIL PROTECTED]> writes: Steven> If you're interested in why Guido doesn't want blocks with Steven> arbitrary control flow, you should check out: Steven> http://mail.python.org/pipermail/python-dev/2005-May/053702.html It's convincing, but I would

deleting, but not getting, slices

2005-05-16 Thread Phil Dumont
>>> import sys >>> sys.version '2.3.4 (#1, Feb 4 2005, 12:19:08) \n[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-42)]' I'm implementing a type that supports a subset of the sequence abstraction in which I want to allow the deletion of elements/slices, but don't need/want to allow the fetching of a sl

Re: Problem listing services with wmi

2005-05-16 Thread Jean-Sébastien Guay
Hello Larry, >Might not be the problem but try without the leading >spaces before your method calls. > >for s in c.Win32_Service (): > >should be > >for s in c.Win32_Service(): > > No change. For reference, the reason I know it's the c.Win32_Service() call that's throwing the exception is that

Re: optparse global

2005-05-16 Thread Skip Montanaro
Ashton> This does not seem to work. I still get the default value Ashton> 5007... Hmmm... Works for me (Python from CVS): % python testme.py 5007 % python testme.py -p 5006 5006 % python testme.py -p5006 5006 The only change from what you posted was to add

Re: trouble with copy/deepcopy

2005-05-16 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Alexander Zatvornitskiy wrote: > class Distribution: > __gr_on_transp=dict() > __ostatok_m=dict() > and so on Those two dicts are *class variables* not *instance variables*! > And, I want to make full copy of it: > d1=Distribution() > d2=copy.deepcopy(d1) > > But, me

Re: CGI on Windows

2005-05-16 Thread Jason Drew
I believe you're experiencing a bug that I also encountered, and for which there is a patch. See: http://sourceforge.net/tracker/?group_id=5470&atid=105470&func=detail&aid=1110478 Fixing os.py as described in the patch fixed all my CGI-related problems. Hope it does for you too! Jason -- http:/

Re: Faster GUI text control

2005-05-16 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Jeremy Bowers <[EMAIL PROTECTED]> wrote: >On Fri, 13 May 2005 15:44:24 -0500, none wrote: > >> I'm trying to decide what is the best replacement for the control. I >> was originally planning on redoing the GUI with wxpython, but I've seen >> people indicate I wou

Re: Problem listing services with wmi

2005-05-16 Thread Larry Bates
Might not be the problem but try without the leading spaces before your method calls. for s in c.Win32_Service (): should be for s in c.Win32_Service(): -Larry Jean-Sébastien Guay wrote: > Hello, > > I'm pretty new to Python, though I have a fair bit of experience with > C/C++, Java, Perl, P

Re: optparse global

2005-05-16 Thread [EMAIL PROTECTED]
This does not seem to work. I still get the default value 5007 when i run $python txd.py - p5006 $python testme.py ***txd.py*** global options parser = OptionParser() parser.add_option("-p", "--port", dest="port", default=5007, type="int", help="port to

Re: ElemenTree and namespaces

2005-05-16 Thread oren . tirosh
Matthew Thorley wrote: > Does any one know if there a way to force the ElementTree module to > print out name spaces 'correctly' rather than as ns0, ns1 etc? Or is > there at least away to force it to include the correct name spaces in > the output of tostring? > > I didn't see anything in the api

Re: ElemenTree and namespaces

2005-05-16 Thread Andrew Dalke
Matthew Thorley wrote: > Does any one know if there a way to force the ElementTree module to > print out name spaces 'correctly' rather than as ns0, ns1 etc? Or is > there at least away to force it to include the correct name spaces in > the output of tostring? See http://online.effbot.org/2004_08

decorator module

2005-05-16 Thread Michele Simionato
I have written a decorator module to make easier to write good decorators (i.e. decorators preserving the signature of the functions they decorate). The documentations contains a (hopefully) nice collections of use cases (which are also test cases, sice I take doctest very seriously ;). You can f

Re: Newbie : checking semantics

2005-05-16 Thread Andrew Dalke
Stefan Nobis wrote: > From time to time I teach some programming (in an institution > called "Volkshochschule" here in Germany -- inexpensive courses > for adults). My Python course is for absolute beginners with no > previous programming experience of any kind. I also taught a beginning programmi

Re: Applying a function to a 2-D numarray

2005-05-16 Thread Matt Feinstein
On Mon, 16 May 2005 12:03:24 -0600, Steven Bethard <[EMAIL PROTECTED]> wrote: >Can you give an example of what you really want to do? Probably there >are numarray functions that you can use. In general, you'll do better >applying a sequence of numarray functions than operating element-wise on

Problem listing services with wmi

2005-05-16 Thread Jean-Sébastien Guay
Hello, I'm pretty new to Python, though I have a fair bit of experience with C/C++, Java, Perl, PHP and others. I installed Tim Golden's wmi module (http://tgolden.sc.sabren.com/python/wmi.html), in the hopes it would help me list and work with services on my Win32 machine. Now, everything se

Re: Recommended version of gcc for Python?

2005-05-16 Thread casevh
On Ubuntu, I have tried 3.3.4, 3.4.3 and 4.0. Compile and make test ran successfully with all three. For my benchmark, platform, and compiler options, 3.4.3 was the fastest by approximately 2%. I would normally use the default compiler for your distribution. casevh -- http://mail.python.org/mai

Re: abut COM using PythonCOM

2005-05-16 Thread Larry Bates
Yes code can be compiled with py2exe. I then use Inno Installer to create single setup.exe file that installs everything and registers it for use. Larry Bates flyaflya wrote: > I know using ActivePython can make a COM easily,but I wander how to > distribute the COM,normal COM can be installed b

Extracting pickle from Python

2005-05-16 Thread Philippe C. Martin
Hi, How would one go about extracting the pickle module from Python (ex: to make a .a or a .dll) ? Thanks Philippe -- http://mail.python.org/mailman/listinfo/python-list

Re: Recommended version of gcc for Python?

2005-05-16 Thread Jeff Epler
Most versions of gcc should be just fine to compile Python. Python is targeted at ANSI/ISO C compilers, but does not yet use any C99 features. I don't think there was ever such a thing as "gcc 3.5"; http://gcc.gnu.org/ lists 4.0 as the "current release series" and 3.4.3 as the "previous release s

Re: python-dev Summary for 2005-04-16 through 2005-04-30

2005-05-16 Thread Steven Bethard
Ville Vainio wrote: >>"Kay" == Kay Schluehr <[EMAIL PROTECTED]> writes: > > > Kay> but PEP 340 is already withdrawn by the BDFL. [1] > > Kay> There won't be any Ruby-like blocks because they hide control > Kay> flow. > > Bummer. I would have greatly enjoyed seeing the only real

Re: Recommended version of gcc for Python?

2005-05-16 Thread Bernd Nawothnig
On 2005-05-16, Dave Kuhlman wrote: > Is there a recommended version of gcc that I should be using to > compile Python? I've compiled Python 2.4 with gcc 3.3.4 on Ubuntu > Debian GNU/Linux. However, I notice that gcc 3.5 and gcc 4.0 are > available for installation. I am on Gentoo Linux and use

Re: mod_python and logging

2005-05-16 Thread Daniel Lichtenberger
Hi! Vinay Sajip wrote: > If you want to have multiple processes logging to the same file, the > standard Python logging module does not support interprocess > synchronisation directly. However, it is fairly easy to set up the > processes to log events to a socket, and a socket receiver can log >

Python RPM and CentOS

2005-05-16 Thread rbt
Not really a Python question, but I thought some on this list may be able to answer so here goes: I have several machines on which I must install CentOS. There are many updates to CentOS and it's very time consuming to do the updates over the network. I have a local copy of all of the updat

Re: trouble with copy/deepcopy

2005-05-16 Thread [EMAIL PROTECTED]
Alexander Zatvornitskiy wrote: > Hello! > > I have trouble with copy/deepcopy. It seems, I just don't understand something. > Please explain where things goes wrong and how to do it the right way. > > I have one class: > > class Distribution: > __gr_on_transp=dict() > __ostatok_m=dict() > and

Recommended version of gcc for Python?

2005-05-16 Thread Dave Kuhlman
Is there a recommended version of gcc that I should be using to compile Python? I've compiled Python 2.4 with gcc 3.3.4 on Ubuntu Debian GNU/Linux. However, I notice that gcc 3.5 and gcc 4.0 are available for installation. Dave -- http://www.rexx.com/~dkuhlman -- http://mail.python.org/mailm

Re: question about the id()

2005-05-16 Thread Peter Dembinski
[EMAIL PROTECTED] (Bengt Richter) writes: [snap] >>So, the interpreter creates new 'point in address space' every time >>there is object-dot-method invocation in program? [optimization] > BTW, a typical performance optimization (not done automatically by python) > is to hoist unchanging-value e

[ANN] pysqlite 2.0.0 final released!

2005-05-16 Thread Gerhard Haering
Hello everyone, After pondering about a redesign of pysqlite for years, and now after half a year of development, I am happy to finally announce the first stable release of pysqlite2. pysqlite a DB-API 2.0-compliant database interface for SQLite. SQLite is a relational database management system

Re: Jesus said, "I am the way, the truth and the life: no one can come to the Father(God)(in Heaven), but by me." (John 14:6) This means that if you die without trusting in Jesus Christ as your Lord and Saviour you will die in your sins and be forever sepa

2005-05-16 Thread Philippe C. Martin
No need to, just give the guy a glass of water and he'll fix it for you Mike Meyer wrote: > [EMAIL PROTECTED] (Mike brown) writes: > >> In article <[EMAIL PROTECTED]>, "Bubba" <[EMAIL PROTECTED]> >> wrote: >> >>> I'm so glad you've decided what everyone believes >>> >> >> >> >> Some of us

Re: Newbie : checking semantics

2005-05-16 Thread rbt
Stefan Nobis wrote: > rbt <[EMAIL PROTECTED]> writes: > > >>True beginners (no programming experience whatsoever) don't have >>to deal with unlearning stuff such as the bracket plague. > > > That's true. But they also not very used to give nothing (-> > whitespace) a meaning. I teached quite so

abut COM using PythonCOM

2005-05-16 Thread flyaflya
I know using ActivePython can make a COM easily,but I wander how to distribute the COM,normal COM can be installed by "regsvr32", but how to install this COM? and can the code be compiled by py2exe? -- http://mail.python.org/mailman/listinfo/python-list

Re: incorrect(?) shlex behaviour

2005-05-16 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "bill" <[EMAIL PROTECTED]> wrote: > Consider: > >>> import shlex > >>> shlex.split('$(which sh)') > ['$(which', 'sh)'] > > Is this behavior correct? It seems that I should > either get one token, or the list > ['$','(','which','sh',')'], > but certainly breaking

CGI on Windows

2005-05-16 Thread Rainer Mansfeld
Hi all, I'm running the following script as a minimalistic CGI server on Windows ME: httpd.py from BaseHTTPServer import HTTPServer from CGIHTTPServer import CGIHTTPRequestHandler server = HTTPServer(("", 8080), CGIHTTPRequestHandler) server.serve_forever() This works

Re: Applying a function to a 2-D numarray

2005-05-16 Thread Steven Bethard
Matt Feinstein wrote: > On Mon, 16 May 2005 11:07:06 -0600, Steven Bethard > <[EMAIL PROTECTED]> wrote: > > > >>I must be missing something, because the simplest possible thing seems >>to work for me: >> >>py> import numarray as na >>py> def plus1(arr): >>... return arr + 1 >>... >>py> def

ElemenTree and namespaces

2005-05-16 Thread Matthew Thorley
Does any one know if there a way to force the ElementTree module to print out name spaces 'correctly' rather than as ns0, ns1 etc? Or is there at least away to force it to include the correct name spaces in the output of tostring? I didn't see anything in the api docs or the list archive, but befo

Re: python-dev Summary for 2005-04-16 through 2005-04-30

2005-05-16 Thread Ville Vainio
> "Kay" == Kay Schluehr <[EMAIL PROTECTED]> writes: Kay> but PEP 340 is already withdrawn by the BDFL. [1] Kay> There won't be any Ruby-like blocks because they hide control Kay> flow. Bummer. I would have greatly enjoyed seeing the only real reason for choosing Ruby over Python

Re: optparse global

2005-05-16 Thread Skip Montanaro
Ashton> How do i make an option passed through command line, using Ashton> optparse global. I need to import this value in another file. Place the parser's output at the module scope. global options parser = OptionParser() parser.add_option("-p", "--port", dest="port", defaul

optparse global

2005-05-16 Thread [EMAIL PROTECTED]
Hello, How do i make an option passed through command line, using optparse global. I need to import this value in another file. This is what iam trying to do. $python test.py -d i should be able to store '' as global so that i could access this value in another file. If

trouble with copy/deepcopy

2005-05-16 Thread Alexander Zatvornitskiy
Hello! I have trouble with copy/deepcopy. It seems, I just don't understand something. Please explain where things goes wrong and how to do it the right way. I have one class: class Distribution: __gr_on_transp=dict() __ostatok_m=dict() and so on And, I want to make full copy of it: d1=Dist

Re: Applying a function to a 2-D numarray

2005-05-16 Thread Matt Feinstein
On Mon, 16 May 2005 11:07:06 -0600, Steven Bethard <[EMAIL PROTECTED]> wrote: > >I must be missing something, because the simplest possible thing seems >to work for me: > >py> import numarray as na >py> def plus1(arr): >... return arr + 1 >... >py> def apply_func(arr, f): >... return f(a

  1   2   >