Making pygopherd working with Mac OS X

2004-12-27 Thread mattabat
Hello, I attempted to use pygopherd 2.0.9 work with MacPython 2.3 under Mac OS X 10.3.7 but I'm afraid I hit a brick wall trying to make it run. Does anyone know how to make this work? I obtained pygopherd from gopher://gopher.quux.org/1/devel/gopher/pygopherd - or for the gopher client deprived, f

Re: argument type

2004-12-27 Thread Steven Bethard
It's me wrote: "It's me" <[EMAIL PROTECTED]> wrote in message news:EO6Ad.3296> I need to look up and see what: if not isinstance(arg2, basestring): does. Okay, I got the idea there. Now, what if arg2 is not a string but either a number or a bunch of numbers? Using your method, can I say so

Re: argument type

2004-12-27 Thread It's me
"It's me" <[EMAIL PROTECTED]> wrote in message news:EO6Ad.3296> > I need to look up and see what: > > if not isinstance(arg2, basestring): > > does. > Okay, I got the idea there. Now, what if arg2 is not a string but either a number or a bunch of numbers? Using your method, can I say s

Re: deriving from str

2004-12-27 Thread Terry Reedy
"dataangel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Paolo Veronelli wrote: > >> I want to add some methods to str class ,but when I change the __init__ >> methods I break into problems Immutable types cannot be changed in __init__. They are initialized in __new__, which

Re: argument type

2004-12-27 Thread It's me
"Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Yeah, given those constraints, you basically have two options -- check > for list/tuple (as you have above) or check for str/unicode (as I do > below). I personally prefer the latter because it seems much more > l

Re: deriving from str

2004-12-27 Thread dataangel
Paolo Veronelli wrote: I want to add some methods to str class ,but when I change the __init__ methods I break into problems class Uri(str): def __init__(self,*inputs): print inputs if len(inputs)>1: str.__init__(self,'<%s:%s>'%inputs[:2]) else:

Re: Confusion About Classes

2004-12-27 Thread M.E.Farmer
flamesrock wrote: [snip] > 3) Can I create a configParser object and just call self.parser.set() > inside the function without passing it as a parameter, or do I pass it > as a parameter and call it as parser.set (without the 'self' > statement.) > > Basically..I'm confused on the proper use of 'se

Re: argument type

2004-12-27 Thread Steven Bethard
It's me wrote: Steve, The argument I wish to pass is either one string, or a list of strings, or a tuple of strings. For instance, I have: def abc(arg1, arg2, arg3) Let say that I expect arg1 and arg3 to be a number, and arg2 can be either one string, or a bunch of strings and I need to do some

Re: argument type

2004-12-27 Thread It's me
> > def abc(arg1, arg2, arg3) > if isinstance(arg2,(list,tuple)): > for item in arg2: > abc(arg1, item) Typo: abc(arg1, item, arg3) > and likewise, I can do: > > abc(1,["String 1","String 2"],5) > > Am I on the right track? > L

Re: argument type

2004-12-27 Thread It's me
Steve, The argument I wish to pass is either one string, or a list of strings, or a tuple of strings. For instance, I have: def abc(arg1, arg2, arg3) Let say that I expect arg1 and arg3 to be a number, and arg2 can be either one string, or a bunch of strings and I need to do something on ea

Re: argument type

2004-12-27 Thread Steven Bethard
It's me wrote: A newbie question. How can I tell from within a function whether a particular argument is a sigular type, or a complex type? For instance, in: def abc(arg1) How do I know if arg1 is a single type (like a number), or a list? In C++, you would do it with function overloading. If a

Re: argument type

2004-12-27 Thread It's me
Donn, That would lead to program error easily because when one forgets to include the needed [], you get unintended result from the program. I am going to try the "isinstance" approach mentioned by Brian. Thanks, "Donn Cave" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Quoth "I

Re: FutureWarning

2004-12-27 Thread Bengt Richter
On Fri, 24 Dec 2004 10:10:38 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: >Egor Bolonev wrote: >> = >> C:\Documents and Settings\ŠÕÀ³\My >> Documents\Scripts\octopus_eye\1\oct_eye_db.py: >> 213: FutureWarning: hex()/oct() of negative int will return a signed >> string in P >>

Re: argument type

2004-12-27 Thread Donn Cave
Quoth "It's me" <[EMAIL PROTECTED]>: | A newbie question. | | How can I tell from within a function whether a particular argument is a | sigular type, or a complex type? | | For instance, in: | | def abc(arg1) | | How do I know if arg1 is a single type (like a number), or a list? | | In C++, yo

Re: WxListBox

2004-12-27 Thread LutherRevisited
This was the aforementioned doublepost guys, thanks for all the help though. At that point I was using WxGlade if you were wondering, that's why my controls have such funny names, glade did it!..lol I've since then got my gui to a point where I can live with it, other than the sizing problem when

Re: argument type

2004-12-27 Thread Brian Beck
It's me wrote: How do I know if arg1 is a single type (like a number), or a list? isinstance is probably good enough for your needs. if isinstance(arg1, (list, tuple, dict)): print "arg1 is a container" else: print "arg1 is (probably) not a container" -- Brian Beck Adventurer of the First O

argument type

2004-12-27 Thread It's me
A newbie question. How can I tell from within a function whether a particular argument is a sigular type, or a complex type? For instance, in: def abc(arg1) How do I know if arg1 is a single type (like a number), or a list? In C++, you would do it with function overloading. If arg1 is alw

Re: Is it possible to open a dbf

2004-12-27 Thread John Fabiani
Paul Rubin wrote: > John Fabiani <[EMAIL PROTECTED]> writes: >> I'm wondering if there is a module available that will open a dbf >> (actually >> sco foxpro 2.6) file under linux. Hopefully it will be DAPI 2.0 but I'll >> accept anything at this point. > > Yes, there is, I found such a thing wit

Re: Is it possible to open a dbf

2004-12-27 Thread Paul Rubin
John Fabiani <[EMAIL PROTECTED]> writes: > I'm wondering if there is a module available that will open a dbf (actually > sco foxpro 2.6) file under linux. Hopefully it will be DAPI 2.0 but I'll > accept anything at this point. Yes, there is, I found such a thing with a minute or so of Google se

Mixing metaclasses and exceptions

2004-12-27 Thread Steve Menard
In writing the next version of Jpype (Python to Java bridge), I have hot a rather unpleasant wall ... Hopefully it is I who is doing something wrong and i can be fixed ... Since I am bridging Java classes and presenting them as Python classes, I decided to try to create a corresponding python c

Is it possible to open a dbf

2004-12-27 Thread John Fabiani
Hi, I'm wondering if there is a module available that will open a dbf (actually sco foxpro 2.6) file under linux. Hopefully it will be DAPI 2.0 but I'll accept anything at this point. John -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter vs wxPython

2004-12-27 Thread flaxeater
Esmail Bonakdarian wrote: > Greetings all. > > I will have about 2 weeks to pursue some Python related activities and > would like to learn more about the graphical end of things. In that > vein I would like some opinions regarding Tkinter and wxPython. > (The previously recommended PyGame is appr

Re: Tkinter vs wxPython

2004-12-27 Thread Michael McGarry
Esmail Bonakdarian wrote: My post wasn't complete, sorry for the additional post: ps: this is basically the same query as posted December 10 “Re: GUIs: wxPython vs. Tkinter (and others)” by Erik Johnson which really seemed to end up comparing PyQt (?) I recommend PyQt because of the easy to use d

Re: Tkinter vs wxPython

2004-12-27 Thread Esmail Bonakdarian
My post wasn't complete, sorry for the additional post: ps: this is basically the same query as posted December 10 “Re: GUIs: wxPython vs. Tkinter (and others)” by Erik Johnson which really seemed to end up comparing PyQt (?) -- http://mail.python.org/mailman/listinfo/python-list

Tkinter vs wxPython

2004-12-27 Thread Esmail Bonakdarian
Greetings all. I will have about 2 weeks to pursue some Python related activities and would like to learn more about the graphical end of things. In that vein I would like some opinions regarding Tkinter and wxPython. (The previously recommended PyGame is appropriate for me for now, but I am lookin

Re: Python Interactive Shell - outputting to stdout?

2004-12-27 Thread Avi Berkovich
Avi Berkovich wrote: Hey, I can't make it work, I don't get any data from either stdout nor stderr. If I send lines and then close the stdin pipe, I may get an exception message from several lines up. I tried manually reading from the stdout pipe, but it just blocks and hangs no matter what I se

Re: WxListBox

2004-12-27 Thread John Machin
M.E.Farmer wrote: > I think he is using an GUI editor wxGlade or BOA. > He has two problems he is trying to figure out wxPython > and he is trying to figure out his drag and drop editor. > On top of that he seems to be having a design problem. > I am gonna let him stew in it, it will be good for

Re: built-in 'property'

2004-12-27 Thread Shalabh Chaturvedi
[EMAIL PROTECTED] wrote: Hi Can any one explain how property works. It seems to be fine if executed on import i.e. if the property statement is at class scope. Properties are meant to be used at the class scope. A property is a kind of descriptor. See http://users.rcn.com/python/download/Descr

Re: Confusion About Classes

2004-12-27 Thread Steven Bethard
flamesrock wrote: Hi, I've been playing like mad with all sorts of python modules..but I still can't seem to get my head around the proper use of a class and self. The question stems from this code I made(snippet): [snip misaligned code] When posting to c.l.py it's greatly appreciated if you use sp

Confusion About Classes

2004-12-27 Thread flamesrock
Hi, I've been playing like mad with all sorts of python modules..but I still can't seem to get my head around the proper use of a class and self. The question stems from this code I made(snippet): -- import httplib

Re: logging from severl classes

2004-12-27 Thread Vinay Sajip
It works for me: #file3.py import file1 import file2 a = file1.A() b = file2.B() b.otherfunction() gives 2004-12-28 00:18:34,805 DEBUG file2 6 creating class B 2004-12-28 00:18:34,805 DEBUG file2 9 in otherfunction -- http://mail.python.org/mailman/listinfo/python-list

Re: WxListBox

2004-12-27 Thread M.E.Farmer
I think he is using an GUI editor wxGlade or BOA. He has two problems he is trying to figure out wxPython and he is trying to figure out his drag and drop editor. On top of that he seems to be having a design problem. I am gonna let him stew in it, it will be good for him ;) He will get more out o

Re: More elegant way to cwd?

2004-12-27 Thread M.E.Farmer
Peter Hansen wrote: [snip] > Other than using os.pardir instead of '..', and possibly adding > an "os.path.abspath()" call to the last bit (or does realpath > already do that? It's unclear from the docs) [snip] I believe os.path.abspath and os.path.realpath are the same. realpath is just an alias

Re: objects as mutable dictionary keys

2004-12-27 Thread Steven Bethard
Peter Maas wrote: Steven Bethard schrieb: If lists were hashable, new programmers to Python would almost certainly make mistakes like: py> d = {[1, 2, 3]: 'abc'} > The coder here almost certainly *doesn't* want that list to be compared > by id. The only way to get a binding for that list woul

Re: Are tuple really immutable?

2004-12-27 Thread Brian Beck
Terry Reedy wrote: No, not in the way intended by the word 'mutable'. A tuple is like an ordered club roster written in indelible ink before the time of whiteout. The members of the club may change (change jobs, residence, relationships, etc) but the roster remains the same: same members, same

wxTreeCtrl checking for valid IDs

2004-12-27 Thread Martin Drautzburg
I have run across a weired problem: I am using a wxTreeCtrl with a model for each tree node. The tree expands "lazily" and each time a node is expanded, its children (Views) are completely rebuilt, creating new IDs. The children register their respecive models using two self written classes "Model"

Re: Complementary language?

2004-12-27 Thread Martin Drautzburg
HackingYodel <[EMAIL PROTECTED]> writes: > Does any single language do a better job in > Python's weaker areas? Would anyone care to suggest one to supplement > Python. My first real OO language was Smalltalk. But the existing Smalltalk implementations all have some severe shortcomings. Either

Re: objects as mutable dictionary keys

2004-12-27 Thread Andrew Koenig
"Peter Maas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > This leads to the question: > > Why does (t1 == t2 => d[t1] identical to d[t2]) hold for user defined > objects and not for lists? My answer: because the cmp function looks at > id() for user defined objects and at list co

Re: objects as mutable dictionary keys

2004-12-27 Thread John Roth
"Peter Maas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] There was a huge and sometimes heated debate about tuples, lists and dictionaries recently, and the mainstream opinion was that dictionary keys must not be mutable, so lists are not allowed as dictionary keys. BUT: objects ar

Re: objects as mutable dictionary keys

2004-12-27 Thread Peter Maas
Steven Bethard schrieb: If lists were hashable, new programmers to Python would almost certainly make mistakes like: py> d = {[1, 2, 3]: 'abc'} > The coder here almost certainly *doesn't* want that list to be compared > by id. The only way to get a binding for that list would be using the > dict

Re: Optional Static Typing

2004-12-27 Thread Ryan Paul
On Thu, 23 Dec 2004 01:49:35 -0800, bearophileHUGS wrote: > Adding Optional Static Typing to Python looks like a quite complex > thing, but useful too: > http://www.artima.com/weblogs/viewpost.jsp?thread=85551 I wrote a blog post this morning in which I briefly argue using DbC and predicate based

Re: objects as mutable dictionary keys

2004-12-27 Thread Andrew Dalke
Andrew Koenig: > If d is a dict and t1 and t2 are tuples, and t1 == t2, then d[t1] and d[t2] > are the same element. So long as the elements of t1 and t2 are well-behaved. >>> class Spam: ... def __hash__(self): ... return id(self) ... def __eq__(self, other): ... return True ... >>

Re: objects as mutable dictionary keys

2004-12-27 Thread Peter Maas
Andrew Koenig schrieb: This strikes me because if one can do this with instances of user defined classes why not with lists? Trying to use lists as dict keys yields "TypeError: list objects are unhashable". So why are list objects unhashable and user defined objects hashable? For user defined objec

Re: PHP vs. Python (speed-wise comparison)

2004-12-27 Thread JZ
Dnia Tue, 28 Dec 2004 02:54:13 +0800, Jon Perez napisał(a): > If you're talking about usage as a server side scripting > language, then PHP will likely give better page serving > throughput for the same hardware configuration versus > even something that is mod_python based (but I believe > the sp

Re: objects as mutable dictionary keys

2004-12-27 Thread Steven Bethard
Peter Maas wrote: This strikes me because if one can do this with instances of user defined classes why not with lists? Trying to use lists as dict keys yields "TypeError: list objects are unhashable". So why are list objects unhashable and user defined objects hashable? For user defined objects ha

Re: objects as mutable dictionary keys

2004-12-27 Thread Andrew Koenig
"Peter Maas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > This strikes me because if one can do this with instances of user > defined classes why not with lists? Trying to use lists as dict > keys yields "TypeError: list objects are unhashable". So why are > list objects unhashab

Re: Best GUI for small-scale accounting app?

2004-12-27 Thread JanC
McBooCzech schreef: > IMHO this is the worst think for the Python community: you can find > one Python only with an excellent support. Great But on the other > hand it is possible to find plenty of GUI tools and for the beginner > (and may be not just for the beginner) it is so hard to choose

objects as mutable dictionary keys

2004-12-27 Thread Peter Maas
There was a huge and sometimes heated debate about tuples, lists and dictionaries recently, and the mainstream opinion was that dictionary keys must not be mutable, so lists are not allowed as dictionary keys. BUT: objects are allowed as dictionary keys, aren't they? See the interpreter session bel

Re: A Revised Rational Proposal

2004-12-27 Thread John Roth
"Mike Meyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Nick Coghlan <[EMAIL PROTECTED]> writes: Mike Meyer wrote: Yup. Thank you. This now reads: Regarding str() and repr() behaviour, repr() will be either ''rational(num)'' if the denominator is one, or ''rational(num, denom)'' i

Re: Optional Static Typing - Haskell?

2004-12-27 Thread Robin Becker
Scott David Daniels wrote: Then you need "Scott and Dave's Programming Language" -- SAD/PL. By providing separate data types for even and odd numbers, you can avoid off-by-one errors ;-) mmmhhh off by two-licious -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: Optional Static Typing

2004-12-27 Thread Ville Vainio
> "Alex" == Alex Martelli <[EMAIL PROTECTED]> writes: Alex> I've always liked the (theoretical) idea that assertions Alex> (including of course contracts) could be used as axioms used Alex> to optimize generated code, rather than (necessarily) as a Alex> runtime burden. E.g. (

RFC 2965 cookies, cookielib, and mailman.

2004-12-27 Thread C. Titus Brown
Hi all, just spent some time playing with cookielib in Python 2.4, trying to get the cookielib example [0] to work with my mailman admindb page. The problem was that cookies weren't getting saved. The issue turned out to be that mailman sends out RFC 2965 [1] cookies, which are by default rejected

Re: need some help with threading module...

2004-12-27 Thread M.E.Farmer
chahnaz.ourzikene wrote: > "M.E.Farmer" <[EMAIL PROTECTED]> a écrit dans le message de news: > [EMAIL PROTECTED] > > > Just a warning! > > Threads and newbies don't mix well, > > many pitfalls and hard to find bugs await you. > > I would avoid using threads if at all possible. > > Indeed :). But ho

Reading a HP Printer Web Interface

2004-12-27 Thread rbt
Hello there, Depending on the firmware version of the HP printer and the model type, one will encounter a myriad of combinations of the following strings while reading the index page: hp HP color Color Printer Printer Status Status: Device: Device Status laserjet LaserJet How can I go about dete

Re: Optional Static Typing

2004-12-27 Thread Robert Kern
Luis M. Gonzalez wrote: Robert Kern wrote: Starkiller, at least, can deal with cases where a variable might be one of a set of types and generates code for each of this set. Explicit type declarations can help keep these sets small and reduces the number of times that Starkiller needs to fall ba

Re: Optional Static Typing - Haskell?

2004-12-27 Thread Scott David Daniels
Michael Hobbs wrote: I've always found that with Haskell, if I can get my program to compile without error, it usually runs flawlessly. (Except for the occasional off-by-one error. :-) Then you need "Scott and Dave's Programming Language" -- SAD/PL. By providing separate data types for even and odd

Re: PyHeartBeat Client in PERL?

2004-12-27 Thread Skip Montanaro
Dave> While reading the Python Cookbook as a means of learning Python, I Dave> came across the script by Dave Larosa. Not knowing anything about Dave> PERL, I was wondering if there were a translation in PERL so I Dave> could have my Netware servers send heartbeats to the heartbea

Re: Python 3000, zip, *args and iterators

2004-12-27 Thread Steven Bethard
Raymond Hettinger wrote: [Steven Bethard] What I would prefer is something like: >>> zip(*g(4)) >>> x, y, z = zip(*g(4)) >>> x, y, z (, at ...) 2. It is instructive to look at Guido's reactions to other *args proposals. His receptivity to a,b,*c=it wanes whenever someone then requests support fo

Re: where is ctypes.py?

2004-12-27 Thread Terry Reedy
"Peter Hansen" > I see others have pointed you to the module, but nobody has > yet told you how you could have found it yourself. > > "ctypes" and many other such modules are third-party packages > which do not come with Python itself. In almost all cases, > you should be able to use Google quit

Re: Problem with os.listdir and delay with unreachable network drives on Windows

2004-12-27 Thread Read Roberts
Thank you for your response - this was very helpful. I find that 'win32net.NetGetUseInfo()' does not deal with UNC names - it seems to require a drive specification in the form of a single letter. The following sequence worked well for me, resulting in a much shorter 'hang time' for unreachab

PyHeartBeat Client in PERL?

2004-12-27 Thread GMane Python
Hello Everyone. Whil e reading the Python Cookbook as a means of learning Python, I came across the script by Nicola Larosa. Not knowing anything about PERL, I was wondering if there were a translation in PERL so I could have my Netware servers send heartbeats to the heartbeat serve

Re: Are tuple really immutable?

2004-12-27 Thread Terry Reedy
> Chris <[EMAIL PROTECTED]> wrote: > ... >> 3) In this example, is t considered mutable or not? >> "Tuple are immutable" says the doc, but: >> >>> t[0].append(0) >> >>> t >> ([1, 0], [2]) >> >> The tuple is immutable but its elements can be mutable: I tend to think >> that it means that the tupl

Re: Python 3000, zip, *args and iterators

2004-12-27 Thread Steve Holden
Raymond Hettinger wrote: [...] "Not everything that can be done, should be done." ... and not everything that should be done, can be done. regards Steve -- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/ Holden Web LLC +1 703 861 4237

Re: Python 3000, zip, *args and iterators

2004-12-27 Thread Alex Martelli
Raymond Hettinger <[EMAIL PROTECTED]> wrote: ... > "Not everything that can be done, should be done." Or, to quote Scripture...: "'Everything is permissible for me' -- but not everything is beneficial" (1 Cor 6:12)... Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: PHP vs. Python (speed-wise comparison)

2004-12-27 Thread Jon Perez
[EMAIL PROTECTED] wrote: Anyone know which is faster? I'm a PHP programmer but considering getting into Python ... did searches on Google but didn't turn much up on this. Thanks! Stephen If you're talking about usage as a server side scripting language, then PHP will likely give better page servin

Re: Optional Static Typing

2004-12-27 Thread Alex Martelli
Michael Hobbs <[EMAIL PROTECTED]> wrote: > Your proposition reminds me very much of Design by Contract, which is > a prominent feature of the Eiffel programming language. Considering > that Python is an interpreted language where type checking would > naturally occur at runtime, I think Design by

Re: python metrics program/script sample

2004-12-27 Thread Peter Hansen
Philippe C. Martin wrote: "true" lines of code meant no blanks or comment - pycount calls those "normal source code": Pycount does not treat a blank line as "normal source code", at least in the version I'm using. It quite clearly differentiates between various types of lines, including a header

Re: Optional Static Typing

2004-12-27 Thread Alex Martelli
Donn Cave <[EMAIL PROTECTED]> wrote: ... > > > Most of the kinds of error that static typing is supposed > > > to catch simply don't persist for more than a minute when > > > you do test driven development. > > > > ...which is exactly the point of the famous post by Robert ("Uncle Bob") > > Mar

Re: Complementary language?

2004-12-27 Thread Donn Cave
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Alex Martelli) wrote: > Robin Becker <[EMAIL PROTECTED]> wrote: > > Alex Martelli wrote: > > . > > > > > > If you're looking for SERIOUS multiparadigmaticity, I think Oz may be > > > best -- (t

Re: test

2004-12-27 Thread flippetygibbet
Tim Peters wrote: > try: > sdfdsafasd > except NameError: > pass > else: > True = None is None and 1 != 2 > False = None is not None or 1 == 2 A simple Google search reveals that sdfdsafasd is misspelled, and helpfully gives the correct spelling: Did you mean: sdfasdfasd http://www

Re: python metrics program/script sample

2004-12-27 Thread Philippe C. Martin
pylint looks good! thanks Philippe -- http://mail.python.org/mailman/listinfo/python-list

help - problem installing pywin32

2004-12-27 Thread [EMAIL PROTECTED]
Hello, I was trying to install pywin32 on one computer which has Python 2.4 installed and it failed. The error message I got was "Can't load Python for pre-install script". I tried unintalling & reinstalling python and that didn't fix the problem. What might be the problem? Thank you very much

Re: need some help with threading module...

2004-12-27 Thread chahnaz.ourzikene
"M.E.Farmer" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > Just a warning! > Threads and newbies don't mix well, > many pitfalls and hard to find bugs await you. > I would avoid using threads if at all possible. Indeed :). But how will i learn using threads if i avoid

Re: need some help with threading module...

2004-12-27 Thread chahnaz.ourzikene
Hi everybody, "Daniel Bickett" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > Instead of having the Controller query the Subject (not exactly > plausible), I had it wait for a signal (threading.Event) as set by the > Subject. You could also have it query a queue, as that

Re: Python 3000, zip, *args and iterators

2004-12-27 Thread Raymond Hettinger
[Steven Bethard] > What I would prefer is something like: > > >>> zip(*g(4)) > > >>> x, y, z = zip(*g(4)) > >>> x, y, z > (, So I guess my real question is, should I expect Python 3000 to play > nicely with *args and iterators? Are there reasons (besides backwards > incompatibility) that pars

Re: python metrics program/script sample

2004-12-27 Thread F. Petitjean
On Mon, 27 Dec 2004 12:09:16 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: > Philippe C. Martin wrote: >> I am looking for an eric3/linux compatible alternative to checking code >> metrics (ex: true lines of code count) > > I don't know what "eric3/linux compatible" might be, I'm not sure > what

Re: list addition methods compared.

2004-12-27 Thread François Granger
Le 27/12/04 1:03, « Ishwor » <[EMAIL PROTECTED]> a écrit : > so indeed method 2 (l2.extend() ) is the fastest ?? In 2/3 times, > method 3 (l3 += [x] seems faster than method 1/2 in my P2.4GHZ machine > with 512mb??? :-( > Could u run the code in your machine and perhaps and let me know what > the

Re: where is ctypes.py?

2004-12-27 Thread [EMAIL PROTECTED]
Peter, Thank you very much. I'll keep that in mind. - wcc -- http://mail.python.org/mailman/listinfo/python-list

Re: python metrics program/script sample

2004-12-27 Thread Philippe C. Martin
>>I don't know what "eric3/linux compatible" might be, I'm not sure >>what this would be an alternative _to_, and I don't know what you >>mean by "true" lines of code count, but the only thing I've >>noticed lately that counts lines of Python code, and I'm fairly >>sure it would run fine on Linux,

Re: More elegant way to cwd?

2004-12-27 Thread F. Petitjean
On Mon, 27 Dec 2004 11:53:57 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: > Kamilche wrote: >> Is there a more elegant way to change the working directory of Python > > That depends on how you define "elegant", I guess. > >> to the directory of the currently executing script, and add a folder >

Re: Optional Static Typing

2004-12-27 Thread Donn Cave
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Alex Martelli) wrote: > John Roth <[EMAIL PROTECTED]> wrote: >... > > question: static typing is an answer. What's the question? > > (That's a paraphrase.) > > > > The answer that everyone seems to give is that it > > prevents errors and cla

Re: embedding: forcing an interpreter to end

2004-12-27 Thread Peter Hansen
dan charnitsky wrote: I wish (hope) Python will move in that direction along with scaling down more easily for embedded use. That won't happen if you just wait for the existing development team to do it (nor even if you ask them, I suspect), as this is likely of little interest to any of them. Onl

Re: Tutorial problem

2004-12-27 Thread Steve Holden
Rÿe9veillÿe9 wrote: Hello, I have just started doing the python tutorials and i tried to modify one of the exercises, it has to to with defining functions. I wanted the user to be able to enter an option and then get a print of the selected option. I also wanted to have an exit for the us

Re: SimpleHTTPServer, queries unhandled?

2004-12-27 Thread Kartic
Try this in IDLE: import CGIHTTPServer CGIHTTPServer.test() This starts serving right away. You can also look at CGIHTTPServer.py in your Python/Lib to see how test() has been implemented. test() starts serving from the current directory (of running python). If you create a folder called cgi-bin

Re: Optional Static Typing - Haskell?

2004-12-27 Thread Michael Hobbs
Neal D. Becker <[EMAIL PROTECTED]> wrote: > I've just started learning about Haskell. I suggest looking at this for an > example. > > A good intro: http://www.haskell.org/tutorial > I've always found that with Haskell, if I can get my program to compile without error, it usually runs flawlessly

Re: python metrics program/script sample

2004-12-27 Thread Peter Hansen
Philippe C. Martin wrote: I am looking for an eric3/linux compatible alternative to checking code metrics (ex: true lines of code count) I don't know what "eric3/linux compatible" might be, I'm not sure what this would be an alternative _to_, and I don't know what you mean by "true" lines of code

Re: where is ctypes.py?

2004-12-27 Thread Peter Hansen
[EMAIL PROTECTED] wrote: I'm a complete newbie in learning python. I was testing some sample codes I found in this newsgroup and seems it could not locate the module ctypes.py. I installed python 2.4, wxPython and pywin32. Just could not find this file. I thought it should be in Lib/site-packages/

Re: Optional Static Typing

2004-12-27 Thread Michael Hobbs
Rahul <[EMAIL PROTECTED]> wrote: > I am assuming that optional type checking is being added for easier > debugging only. So if 'expects' are turned on , python raises > warnings(which do not halt the system) but not when they are turned > off. These will enable easier debugging for new people while

Re: More elegant way to cwd?

2004-12-27 Thread Peter Hansen
Kamilche wrote: Is there a more elegant way to change the working directory of Python That depends on how you define "elegant", I guess. to the directory of the currently executing script, and add a folder called 'Shared' to the Python search path? This is what I have. It seems like it could be sho

Re: Tutorial problem

2004-12-27 Thread Steven Bethard
Rÿe9veillÿe9 wrote: Hello, I have just started doing the python tutorials and i tried to modify one of the exercises, it has to to with defining functions. I wanted the user to be able to enter an option and then get a print of the selected option. I also wanted to have an exit for the us

Re: Unicode entries on sys.path

2004-12-27 Thread "Martin v. Löwis"
Thomas Heller wrote: How should these patches be approached? Please have a look as to how posixmodule.c and fileobject.c deal with this issue. On windows, it would probably be easiest to use the MS generic text routines: _tcslen instead of strlen, for example, and to rely on the _UNICODE preproce

Re: Tutorial problem

2004-12-27 Thread Paul Robson
On Mon, 27 Dec 2004 08:15:51 -0800, Rÿe9veillÿe9 wrote: > The problem is that it doesnt print the > > [ choice = input ('Pick a number:') ] > > command. It just runs thru the whole thing without > allowing the user a selection. Are you running it from the command line ? Some editors do

RE: Tutorial problem

2004-12-27 Thread Batista, Facundo
Title: RE: Tutorial problem [Rÿe9veillÿe9] #- The problem is that it doesnt print the #- #- [ choice = input ('Pick a number:') ] #- #- command. It just runs thru the whole thing without #- allowing the user a selection. Are you sure? It should raise a NameErrorin the while, bec

Re: Unicode entries on sys.path

2004-12-27 Thread "Martin v. Löwis"
Bengt Richter wrote: The real question here is: why does Python not support arbitrary Unicode strings on sys.path? It could, in principle, atleast on Windows NT+ (and also on OSX). Patches are welcome. What about removable drives? And mountable multiple file system types? I'm not sure I understand

Tutorial problem

2004-12-27 Thread Rÿffffe9veillÿffffe9
Hello, I have just started doing the python tutorials and i tried to modify one of the exercises, it has to to with defining functions. I wanted the user to be able to enter an option and then get a print of the selected option. I also wanted to have an exit for the user. This is the code

python metrics program/script sample

2004-12-27 Thread Philippe C. Martin
Hi, I am looking for an eric3/linux compatible alternative to checking code metrics (ex: true lines of code count) Regards, Philippe -- http://mail.python.org/mailman/listinfo/python-list

RE: A Revised Rational Proposal

2004-12-27 Thread Batista, Facundo
Title: RE: A Revised Rational Proposal [Mike Meyer] #- I don't think so, as I don't see it coming up often enough to warrant #- implementing. However, Rational("x" / "y") will be an acceptable #- string format as fallout from accepting floating point string #- representations. Remember tha

Re: Optional Static Typing - Haskell?

2004-12-27 Thread Mike Meyer
"Donn Cave" <[EMAIL PROTECTED]> writes: > Quoth Mike Meyer <[EMAIL PROTECTED]>: > | [EMAIL PROTECTED] (Alex Martelli) writes: > ... > |> But then, the above criticism applies: if interface and implementation > |> of a module are tightly coupled, you can't really do fully modular > |> programming A

Re: program in interactive mode

2004-12-27 Thread Mike Meyer
"John Machin" <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> >> I've discovered a truly elegant trick with python programs that >> interpret other data. > Q0. Other than what? Other than Python code. >> You make them ignore lines that start with # at >> the beginning of the line, > Q1. After

Re: Unicode entries on sys.path

2004-12-27 Thread Thomas Heller
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: > Thomas Heller wrote: >> It seems that Python itself converts unicode entries in sys.path to >> normal strings using windows default conversion rules - is this a >> problem that I can fix by changing some regional setting on my machine? > > You can se

  1   2   >