Re: Zen of Python

2005-01-19 Thread Steve Holden
g the flat/nested dimension which is appropriate to any given situation, so nest with moderation and only when necessary". They'd probably been talking to Antoon Pardon :-) But that didn't fit in the list so they went with the shorter version... regards Steve -- Steve

Re: Zen of Python

2005-01-20 Thread Steve Holden
th the intermediate steps? Perhaps because we don't all have your psychic powers? regards Steve -- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/ Holden Web LLC +1 703 861 4237 +1 800 494 3119 -- http://mail.python.org/mailman/listinfo/python-list

Re: iteritems() and enumerate()

2005-01-20 Thread Steve Holden
Xah Lee wrote: Python has iteritems() and enumerate() to be used in for loops. can anyone tell me what these are by themselves, if anything? are they just for idiom? No, anyone can use them, not just idioms like you. regards Steve -- Steve Holden http://www.holdenweb.com/ Python Web

Re: Overloading ctor doesn't work?

2005-01-20 Thread Steve Holden
ving to use our psychic powers? ;-) In other words: what's wrong? How do you *know* you can't override it? regards Steve -- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/ Holden Web LLC +1 703 861 4237 +1 800 494 3119 --

PyCon Preliminary Program Announced!

2005-01-20 Thread Steve Holden
always, I would appreciate your help in getting the word out. Please forward this message to your favorite mailing lists and newsgroups to make sure that everyone has a chance to join in the fun! regards Steve Holden Chairman, PyCON DC 2005 -- PyCon DC 2005: The third Python Community Confe

Re: Zen of Python

2005-01-20 Thread Steve Holden
Paul Rubin wrote: Steve Holden <[EMAIL PROTECTED]> writes: [Paul proves his superior Lisp knowledge] Perhaps because we don't all have your psychic powers? You snipped out the examples I gave, like [x*x for x in range(5)] leaving unnecessary residue in the name space. Was it not obvio

Re: Does anyone want one?

2005-01-20 Thread Steve Holden
amid scams. -- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/ Holden Web LLC +1 703 861 4237 +1 800 494 3119 -- http://mail.python.org/mailman/listinfo/python-list

Re: PyCon Preliminary Program Announced!

2005-01-21 Thread Steve Holden
ively take this task and eat it for breakfast, but please don't believe it will happen as a result of a few newsgroup posts saying what a nice idea it would be. Things don't happen that way, and I have the grey hairs to prove it. Please, make this happen! regards Steve -- Steve

Re: Zen of Python

2005-01-21 Thread Steve Holden
Skip Montanaro wrote: Steve> The fact that a bright bunch like the Python developers didn't Steve> realize that it would be sensible to have a local scope for the Steve> list comprehension variable is a perfect demonstration of that Steve> point. Actually, I seem t

Re: Tuple size and memory allocation for embedded Python

2005-01-21 Thread Steve Holden
ur program still regards as allocated is garbage collected by Python and reused. Ugly :-P Python is pretty stable, so it's usually best to suspect our own code unless you're heavily into using the C API (which I'm not, so feel free to ignore me). regards Steve -- Steve Holden

Re: default value in a list

2005-01-21 Thread Steve Holden
number of colons in the line. You can access the elements of the list using a[0], a[2], and so on. For example: >>> line = "This:is:a:sample:line" >>> l = line.split(':') >>> l ['This', 'is', 'a', 'sample&

Re: What YAML engine do you use?

2005-01-22 Thread Steve Holden
d. At least the version 1.0 spec I snagged from W3C a long time ago. I see the third edition at http://www.w3.org/TR/REC-xml/ is differently styled, (I guess new style sheets) but still pretty readable (glancing at it now). Regards, Bengt Richter regards Steve -- Steve Holden

Re: embedding jython in CPython...

2005-01-22 Thread Steve Menard
ituation a bit more, we'll be better able to help you. Steve Menard Maintainer of http://jpype.sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list

Re: What YAML engine do you use?

2005-01-22 Thread Steve Holden
for saving bandwidth). What's right for developers is what requires the least amount of work. The problem is, that's what is right for end-users, too. Yet again I will interject that XML was only ever intended to be wriiten by programs. Hence its moronic stupidity and excellent uniform

JPype and classpath (Was Re: embedding jython in CPython... )

2005-01-22 Thread Steve Menard
os.path, jpype root = os.path.abspath(os.path.dirname(__file__)) jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.class.path=%s%sclasses" % (root, os.sep), "-Djava.ext.dirs=%s%slib" % (root, os.sep)) #

Re: embedding jython in CPython...

2005-01-22 Thread Steve Menard
em to CPython+Jpype. Let me know if you need any help. -- Steve Menard Maintainer of http://jpype.sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: problems mirroring python-list to c.l.py?

2005-01-23 Thread Steve Holden
Daniel Bickett wrote: John Lenton wrote: On Sun, Jan 23, 2005 at 01:53:52PM -0500, Daniel Bickett wrote: Is there a reason that Google Groups isn't mirroring python-list exactly like it used to, or is it simply a conspiracy I'm not in on? You should not ask this kind of question in a public forum,

Microsoft to Provide PyCon Opening Keynote

2005-01-23 Thread Steve Holden
http://www.python.org/moin/PyConDC2005/Schedule for the current schedule, and register at http://www.python.org/pycon/2005/ regards Steve Holden Chairman, PyCON DC 2005 -- PyCon DC 2005: The third Python Community Conference http://www.pycon.org/ http://www.python.org/pycon/ The scoop

Re: Help on project, anyone?

2005-01-23 Thread Steve Menard
uld do? I would go on Sourceforge. Try to find a project that seems interestingto you. and then contact the Maintainer see if you can help. Many project also advertise the kind of help they need. -- Steve Menard Maintainer of http://jpype.sourceforge.net -- http://mail.pyt

Re: JPype and classpath (Was Re: embedding jython in CPython... )

2005-01-23 Thread Steve Menard
4 currently cannot import classes that are in the "default" package. The fix is easy, simply put your "test" class in a package. For exmaple, if you put the class in the package "test", the code to load it would be : test = jpype.JPackage("test&qu

Re: short programming projects for kids

2005-01-24 Thread Steve Holden
then the next thing you know they're writing algorithms to compute convex hulls (well, maybe not, but you probably get the idea). regards Steve -- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/ Holden Web LLC +1 703 861 4237

Re: Right place for third party modules (here: fixedpoint)

2005-01-24 Thread Steve Holden
ile to your site-packages directory. You can then delete the empty fixedpoint directory, as it won't do anything except get in the way. Packages are implemented as directories, but modules are single Python files. "Site-packages" is a perfectly acceptable place to put

Import from database

2005-01-24 Thread Steve Holden
found a.b.c.d in db load_module: a.b.c.d a.b.c.d loaded: pkg: 0 found bsddb in db load_module: bsddb found weakref in db load_module: weakref weakref loaded: pkg: 0 Traceback (most recent call last): File "test.py", line 7, in ? import bsddb File "/c/steve/Projects/Python/dbimp

Re: Import from database

2005-01-25 Thread Steve Holden
Kartic wrote: Steve, I believe you have to put ntpath, macpath and posixpath in the module database for os.path to work. I tried it with zipimporter builtin and I got the same traceback till I added ntpath.py to my zip file. (Of course, I renamed the original ntpath to _ntpath so that the original

Re: Import from database

2005-01-25 Thread Steve Holden
Kartic wrote: Steve, Hmmm... Yes, I see what you are saying. Could you post your create table statement so that I can create a db and play around with dbimport? Thanks, --Kartic Here it is, plus also the loader program I used to suck in the standard library (in case it's that that

Re: smtplib bug with Windows XP

2005-01-25 Thread Steve Christensen
cally (on the system trying to connect to the SMTP server), try disabling the rule in the Access Control dialog that's labeled 'Prevent mass mailing worms from sending email' -Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: Open Folder in Desktop

2005-01-25 Thread Steve Holden
Kamilche wrote: Is there a command you can execute in Python that will open a window on the desktop, such as 'My Documents'? Kind of like 'system', but for folder names, not just programs. I'm running on Windows 2000. os.system("start .") works for

PyCon: Early Bird Deadline two days away [really]!

2005-01-26 Thread Steve Holden
, which is JANUARY 28 (and it's already January 26). So, don't delay: save yourself $75 and register by midnight Friday. Which time zone, you ask. Why wait and find out - it only takes a couple of minutes to register. http://www.python.org/pycon/2005/register.html regards Steve Holde

Re: import hook, overwrite import?

2005-01-27 Thread Steve Holden
to put some sort of BoF or Open Space event together for people wishing to learn about (and teach about) the import system from PEP 302 at PyCon this year. Early bird registration rates are still available today and tomorrow! regards Steve -- http://mail.python.org/mailman/listinfo/python-list

Hey, get this! [was: import from database]

2005-01-28 Thread Steve Holden
import ftplib import fileinput try: print "first import" import bsddb except: print "second import" import bsddb print "Done!" $ python -i test.py dbimporter: item: *db* args: () keywords: {} Accepted *db* dbimporter: i

Re: [PyCon] Reg: Registration

2005-01-28 Thread Steve Holden
ay morning. I look forward to joining you all to hear Guido speak on "The State of Python". regards Steve -- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/ Holden Web LLC +1 703 861 4237 +1 800 494 3119 -- http://mail.python.org/mailman/listinfo/python-list

Re: Hey, get this! [was: import from database]

2005-01-29 Thread Steve Holden
Peter Otten wrote: Steve Holden wrote: This is even stranger: it makes it if I import the module a second time: [second import seems to succeed] Maybe you are experiencing some version confusion? What you describe looks much like the normal Python 2.3 behaviour (with no import hook involved

Re: test_socket.py failure

2005-01-30 Thread Steve Holden
ppreciate it. Compiling from source requires you to indicate the features that you want compiled in. Without thread support, sockets din't work, so it looks like you need to configure threads in. IIRC you do this by editing the Modules.? file. regards Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: The next Xah-lee post contest

2005-01-31 Thread Steve Holden
[EMAIL PROTECTED] wrote: Tragi-comic. really. BTW you forgot cross-post to c.l.scheme, C, smalltalk and C++ Would there, I wonder, be any enthusiasm for a "Best Xah Lee impression" prize at PyCon? regards Steve -- Steve Holden http://www.holdenweb.com/ Python Web P

Re: variable declaration

2005-01-31 Thread Steve Holden
a language that DOES, at least until and unless your brain changes by other means. Alex I think we should all remember that Python isn't for everyone, and least of all for those with little knowledge of Python and preconceptions about what Python *should* be like. regards Stev

Want to meet any of these people? They are registered for PyCon

2005-01-31 Thread Steve Holden
python.org/pycon/2005/register.html Note that the sort order isn't perfect - I just sorted on the second "word" in each name. PyCon is a *great* place to meet people and discuss ideas. Hope to see you there. regards Steve Chris Akre Brad Allen Kevin Altis Ummesal

Re: re module - cannot make expression

2005-01-31 Thread Steve Holden
match "not beginning with" type expressions. Thanks, Laci 2.0 You can do taht with Python re's. Look in the re documentation for "negative lookahead assertion". regards Steve -- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.

Re: import directory error

2005-01-31 Thread Steve Holden
rb is a module from the mp1 package, mp1.p2 is a sub-package of mp1. You can see what's been compiled by the interpreter on import and when by looking at the .pyc files. Does this help any? regards Steve -- Steve Holden http://www.holdenweb.com/ Python Web Programming h

Re: variable declaration

2005-01-31 Thread Steve Holden
definitely in for a treat this year. regards Steve -- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/ Holden Web LLC +1 703 861 4237 +1 800 494 3119 -- http://mail.python.org/mailman/listinfo/python-list

Re: Relocatable binary installs....

2005-01-31 Thread Steve Holden
any further nouse (and no symbolic links to help it) is going to crap out badly. But I could be wrong. always-prepared-to-at-least-admit-the-possibility-ly y'rs - steve -- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/ Holden Web LLC

Re: Q: quoting string without escapes

2005-01-31 Thread Steve Holden
hon and Perl? Unusual to find arrogance and humility in such close proximity. Please stop cross-posting your ill-informed and inflammatory stuff to c.l.py and c.l.perl.m. And now I have your attention, the answer to your question is ... Use triple-quoting. followups-set'ly

Re: Relocatable binary installs....

2005-01-31 Thread Steve Holden
Fredrik Lundh wrote: Steve Holden wrote: Is there a way to make a relocateable python binary... that is... a python installation that won't care where it is on the machine... and won't care if it gets put somewhere else besides / ? the standard CPython interpreter is 100% "reloca

Re: python and gpl

2005-01-31 Thread Steve Holden
r an answer to the (apparently relatively simple) question: If a Python program imports a module licensed under the GPL, in your opinion does the Python program become a derivative work of the GPL'd software? regards Steve -- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/ Holden Web LLC +1 703 861 4237 +1 800 494 3119 -- http://mail.python.org/mailman/listinfo/python-list

Re: Want to meet any of these people? They are registered for PyCon

2005-01-31 Thread Steve Holden
Aahz wrote: In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: Note that the sort order isn't perfect - I just sorted on the second "word" in each name. PyCon is a *great* place to meet people and discuss ideas. Hope to see you there. Good thi

Re: Want to meet any of these people? They are registered for PyCon

2005-01-31 Thread Steve Holden
Stephen Thorne wrote: On Mon, 31 Jan 2005 17:49:53 -0500, Steve Holden <[EMAIL PROTECTED]> wrote: Aahz wrote: In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: Note that the sort order isn't perfect - I just sorted on the second "word" in ea

Re: Advice on OSX cocoa app with Python backend

2005-02-01 Thread Steve Holden
ue parts of OSX appear (from the outside) to be Carbon/Cocoa and the funky GUI stuff. So have at it and come back for advice when you need it. Good luck with your project. [OBPyCon: of course, if you come to PyCon DC 2005 you can discuss this stuff with experts: http://www.python.org/pycon/2

PyCon signature advertising

2005-02-01 Thread Steve Holden
ke my third (and final) year as chairman to see the biggest and (much more importantly) best PyCon ever. I hope to meet as many of you as possible in DC, March 23-25 (and during the four-day sprint preceding the main event). regards Steve -- Meet the Python developers and your c.l.py favorites Co

Re: PyCon signature advertising

2005-02-01 Thread Steve Holden
Mike C. Fletcher wrote: Steve Holden wrote: I appreciate that not everyone has control over their .sig, Take control of your sigs, my sisters and brothers! Viva la Revolution! Follow the Steve into the heat and light of PyCon. You can achieve enlightenment if only you go to the

Re: variable declaration

2005-02-01 Thread Steve Holden
cessive to me. Sample use case: for something in lst: if type(something) != type(()): something = tuple(something) regards Steve -- Meet the Python developers and your c.l.py favorites March 23-25 Come to PyCon DC 2005 http://www.python.org/pycon/2005/ Steve Holden

Re: variable declaration

2005-02-01 Thread Steve Holden
Thomas Bartkus wrote: "Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Thomas Bartkus wrote: "Carl Banks" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] How common is it for a local variable to be bound in more than one plac

Re: how do i create such a thing?

2005-02-01 Thread Steve Holden
thing to having subclassed the object's class but with closer control. regards Steve A: Top-posting Q: What puts things in the wrong order on newsgroup postings -- Meet the Python developers and your c.l.py favorites March 23-25 Come to PyCon DC 2005 http://www

Re: Next step after pychecker

2005-02-02 Thread Steve Holden
uldn't be very helpful when trying to write an optimizing compiler, but it is a valid type. Skip So reaplce the plus sign with an asterisk ... regards Steve -- Meet the Python developers and your c.l.py favorites March 23-25 Come to PyCon DC 2005 http://www.python.org/pycon/2005/ Steve Holden http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: type of simple object

2005-02-02 Thread Steve Holden
", though there wouldn't be any problems in this case except the infinite recursion. Which definitely *would* be a problem. regards Steve -- Meet the Python developers and your c.l.py favorites March 23-25 Come to PyCon DC 2005 http://www.python.org/pycon/2005/ Steve Holden

Re: Is this a contradiction in the docs ?

2005-02-02 Thread Steve Holden
t those signs there. In fact I'm walking along the tracks right now as I enter this post on my hand-held, and [message ends with sound of locomotive horn followed by an ugly squelch]." That's the kind of practice best avoided. Are you breaking the rules just for the fun of it? reg

Re: Hey, get this! [was: import from database]

2005-02-02 Thread Steve Holden
Steve Holden wrote: Peter Otten wrote: Steve Holden wrote: This is even stranger: it makes it if I import the module a second time: [second import seems to succeed] Maybe you are experiencing some version confusion? What you describe looks much like the normal Python 2.3 behaviour (with no

Re: Hey, get this!

2005-02-02 Thread Steve Holden
Bernhard Herzog wrote: Steve Holden <[EMAIL PROTECTED]> writes: What *I* would like to know is: who is allowing the import of bsddb.os, thereby somehow causing the code of the os library module to be run a second time. I would guess (without actually running the code) that this p

Re: Finding user's home dir

2005-02-02 Thread Steve Holden
else: return path3 else: return path2 else: return path1 Please, could you test it on your systems and tell me what you got? I'd like to know what it returns on different operating systems because I'm developing a multiplatform software. Thank you all. It works on Cy

Re: Generating modul classes with eval

2005-02-02 Thread Steve Holden
op so that they exist like the code was written in? Thanks, AXEL. You could try just importing the module - then, when it runs, its name won't be "__main__" but "MyModule". regards Steve -- Meet the Python developers and your c.l.py favorites March 23-25 Co

Re: Basic file operation questions

2005-02-02 Thread Steve Holden
if not os.path.exists(path2): if not os.path.exists(path3): return os.getcwd() else: return path3 else: return path2 else: return path1 print getHomeDir() >>> regards Steve -- Meet the Python developers and your c.l.py favorites March 23

Re: Getting a module's byte code, how?

2005-02-02 Thread Steve Holden
ds() to turn it back into a code object: >>> mbc = file("/lib/python2.4/re.pyc", "rb").read()[8:] >>> import marshal >>> code = marshal.loads(mbc) >>> code >>> Note that the ugly details *might* change, and that byte codes ar

Re: Getting a module's byte code, how?

2005-02-02 Thread Steve Holden
e module has been loaded from a compiled file. In that case your only option is to read in the source and compile it. I am presuming that this feature of Pyro won't allow a 2.3 system to talk to a 2.4 one, since the byte codes are incompatible. regards Steve -- Meet the Python devel

Re: Getting a module's byte code, how?

2005-02-02 Thread Steve Holden
Irmen de Jong wrote: Steve Holden wrote: Having said which, if the module was loaded from a .pyc file then the bytecode is available from that - take everything but the first eight bytes and use marshal.loads() to turn it back into a code object: Yup. As I explained in the other message, this

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

2005-02-02 Thread Steve Holden
ed to use a bytecode file from *one* version of Python with an interpreter of another version. Python actually checks the first four bytes of the .pyc file for a compatible "magic number" before accepting the file for execution. regards Steve -- Meet the Python developers and your c.l

Re: global variables

2005-02-02 Thread Steve Holden
stablishes default settings for configuration variables. Other modules that import config can access (and change) those values using config.name = value and so on. Hope this help. regards Steve -- Meet the Python developers and your c.l.py favorites March 23-25 Come to PyCon DC 2005

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

2005-02-02 Thread Steve Holden
Tim Daneliuk wrote: Steve Holden wrote: Roland Heiber wrote: Tim Daneliuk wrote: It does - thanks. One more question: Are pyc and pyo file portable across operating systems? I suspect not since I generated a pyo on a FreeBSD machine that will not run on a Win32 machine. I was under the

Re: Newbie alert

2005-02-02 Thread Steve Holden
gives me this Traceback (most recent call last): File "C:/Python24/dialog1.py", line 29, in -toplevel- d = MyDialog(root) NameError: name 'MyDialog' is not defined I have a feeling this is something very simple, but I cannot figure it out. Help! Python is case-sensi

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

2005-02-03 Thread Steve Holden
frame when you reach a breakpoint. It's a great way to find out what's going on. [But don't I remember that IDLE can do that too? ...] regards Steve -- Meet the Python developers and your c.l.py favorites March 23-25 Come to PyCon DC 2005 http://www.pyc

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

2005-02-03 Thread Steve Holden
tried something called pyCrust, but this too didn't have history To recall a line from your history in PyCrust, press Ctrl+UpArrow. Ditto regards Steve -- Meet the Python developers and your c.l.py favorites March 23-25 Come to PyCon DC 2005 http://www.pycon.org/ St

Re: Awkwardness of C API for making tuples

2005-02-03 Thread Steve Holden
tem fails, you'll leak an object. And in practice this will only happen during a period when you are relying critically on it *not* to ... regards Steve -- Meet the Python developers and your c.l.py favorites March 23-25 Come to PyCon DC 2005 http://www.pycon.org/ Stev

Re: Basic file operation questions

2005-02-03 Thread Steve Holden
ntirely clear, but newbies should not be using it as any kind of model. regards Steve -- Meet the Python developers and your c.l.py favorites March 23-25 Come to PyCon DC 2005 http://www.pycon.org/ Steve Holden http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: global variables

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

Re: ModPython: passing variables between handlers?

2005-02-03 Thread Steve Holden
es to it as a way to communicate between handlers.""". regards Steve -- Meet the Python developers and your c.l.py favorites March 23-25 Come to PyCon DC 2005 http://www.pycon.org/ Steve Holden http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Hey, get this!

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

Re: Popularizing SimpleHTTPServer and CGIHTTPServer

2005-02-03 Thread Steve Holden
ng. Does anyone know how to use SimpleHTTPServer to: 1. Support virtual hosts? 2. Support SSL? I'd like to use SimpleHTTPServer to create some simple reporting utilities, but can't get past these two points. Is there a NotSoSimpleHTTPServer? You want ExtremelyBloodyComplicatedHTTPServer

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

2005-02-03 Thread Steve Holden
th callback is the "official interface in this game". You will note that my code uses delegation to an FTP object rather than inheritance. Maybe you would find that approach more fruitful for your application. regards Steve -- Meet the Python developers and your c.l.py favo

ModPython: passing variables between handlers?

2005-02-03 Thread Steve Holden
#x27;s. I've had to deal with similar complications in my own code, but you may want to think about biting the bullet. Globals are almost always a bad idea in multi-user contexts like this. regards Steve -- Meet the Python developers and your c.l.py favorites March 23-25 Come to PyCon DC

Re: Is there a market for python developers?

2005-02-03 Thread Steve Holden
so, take a look at http://www.python.org/Jobs.html regards Steve -- Meet the Python developers and your c.l.py favorites March 23-25 Come to PyCon DC 2005 http://www.pycon.org/ Steve Holden http://www.holdenweb.com/ -- http://mail.python.org/mailma

Re: global variables

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

Re: Easy Q: dealing with object type

2005-02-03 Thread Steve Holden
As an aside, I notice a lot of other people's interpreters actually print 'True' or 'False' where my system prints 0 or 1. Is that a configuration that can easily set somewhere? Nope, it's a version thing. I believe Booleans were introduced at some odd point

Re: About standard library improvement

2005-02-03 Thread Steve Holden
ed an account to submit patches or bugs, IIRC. Once you've created your account, log in and go to http://sourceforge.net/tracker/?group_id=5470&atid=305470 and click "Submit New". regards Steve -- Meet the Python developers and your c.l.py favorites March 23-

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

2005-02-03 Thread Steve Holden
self) is superobject, effectively an instance of a class distinguishable from self.__class__ only by the fact that its mro is shorter, losing everything up to and including X. Does this help at all? This is quite a subtle point, but it will repay study with an understanding of exactly how you

Re: List mapping question

2005-02-03 Thread Steve Holden
,b,c (1, 2, 3) >>> a,b,c = [int(x) for x in (a,b,c)] >>> a,b,c (1, 2, 3) regards Steve -- Meet the Python developers and your c.l.py favorites March 23-25 Come to PyCon DC 2005 http://www.pycon.org/ Steve Holden http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

[Fwd: [gnu.org #220719] Re: python and gpl]

2005-02-03 Thread Steve Holden
Python zen would advise "refuse the temptation to guess". So I am Cc'ing [EMAIL PROTECTED] with a request for an answer to the (apparently relatively simple) question: If a Python program imports a module licensed under the GPL, in your opinion does the Python program become a deri

Re: About standard library improvement

2005-02-03 Thread Steve Holden
when you submit patches/bug reports to speed it up? BJörn: I suspect you should join the python-dev list - you may well be able to help much more effectively there. regards Steve -- Meet the Python developers and your c.l.py favorites March 23-25 Come to PyCon DC 2005 http://www.p

Re: OT: why are LAMP sites slow?

2005-02-04 Thread Steve Holden
gabytes of data (search on "apple banana" and there are hundreds of millions of pages with each word, so two lists of that size must be intersected). 100,000 was the published number of servers several years ago, and there were reasons to believe that they were purposely underst

Re: Converting a string to a function pointer

2005-02-04 Thread Steve Holden
uot;: c } ... funcString = GetFunctionAsString() try: f = funcMap(funcString) except KeyError: print "No such function" raise SomethingElse result = f(args) regards Steve -- Meet the Python developers and your c.l.py favorites March 23-25 Come to PyCon DC 2005

Re: regular expression match collection

2005-02-04 Thread Steve Holden
ult "by" print m.span() # result (5,7) How can I get the information of the other by ? Sincerely Yours, Pujo Aji You need re.findall() (or, equivalently, the findall() method of an re). regards Steve -- Meet the Python developers and your c.l.py favorites March 23-25 Come to PyCon

Re: OT: why are LAMP sites slow?

2005-02-04 Thread Steve Holden
r a relational backend to MoinMoin if it would speed up the execrably slow performance we currently see on the python.org wiki. I haven't investigated why response times went up so much, but I have a distinct feeling it's to do with a new release. regards Steve -- Meet the Python developers

Re: Thread in python

2005-02-04 Thread Steve Holden
regards Steve -- Meet the Python developers and your c.l.py favorites March 23-25 Come to PyCon DC 2005 http://www.pycon.org/ Steve Holden http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: returning True, False or None

2005-02-04 Thread Steve Holden
anyone see a simpler way of writing this? STeVe That code looks like a pretty solid implementation of the spec to me. There isn't a strict need for the last else, of course, which may be the smell you detect. If you wanted to get clever you could write something like for i in True, False: if

Re: returning True, False or None

2005-02-04 Thread Steve Juranich
> This has a light code smell for me though -- can anyone see a simpler > way of writing this? How's about: def ntf(x, y): if x is None and y is None: return None if x == True or y == True: return True return False # Then... reduce(ntf, ) You might need to make sure that you init

Re: string issue

2005-02-04 Thread Steve Holden
ption, e: print e print ips time.sleep(5) Someone tell me I'm going crazy ;) You are modifying the list as you iterate over it. Instead, iterate over a copy by using: for ip in ips[:]: ... regards Steve -- Meet the Python developers and your c.l.py favorites March

Re: string issue

2005-02-04 Thread Steve Holden
Terry Reedy wrote: "Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [ ... ] This seems much more sensible to me than building a new list with everything (a copy), including things you don't want, and then deleting the things you don't

Re: returning True, False or None

2005-02-05 Thread Steve Holden
Christos TZOTZIOY Georgiou wrote: On Fri, 04 Feb 2005 13:04:16 -0500, rumours say that Steve Holden <[EMAIL PROTECTED]> might have written: [STeVe] For a given list: * If all values are None, the function should return None. * If at least one value is True, the function should retur

Re: Error!

2005-02-05 Thread Steve Holden
amount + dealer + charge) print "Please hand over", actual_price Obviously the "..." are the bits you fill in to complete the program. Good luck! regards Steve -- Meet the Python developers and your c.l.py favorites March 23-25 Come to PyC

Re: An interesting python problem using Zope 2.7.3

2005-02-05 Thread Steve Holden
hanx Define "is run from"? When you enter an expression-statement at the interpreter's interactive prompt the interpreter computers the result and, if the result is not None, prints its repr(). How are you getting Zope to print the results? If they are coming through a web brows

Re: sos!

2005-02-05 Thread Steve Holden
27;s all too useful, take a look at http://www.uselesspython.com/ Welcome to Python! regards Steve -- Meet the Python developers and your c.l.py favorites March 23-25 Come to PyCon DC 2005 http://www.pycon.org/ Steve Holden http://www.holdenweb.com

Re: returning True, False or None

2005-02-05 Thread Steve Holden
Steve Holden wrote: Christos TZOTZIOY Georgiou wrote: On Fri, 04 Feb 2005 13:04:16 -0500, rumours say that Steve Holden <[EMAIL PROTECTED]> might have written: [STeVe] For a given list: * If all values are None, the function should return None. * If at least one value is True, the function

Re: Trouble converting hex to decimal?

2005-02-05 Thread Steve Holden
dle this? Earl Eiland You could either reconstruct the value yourself from the ord() values of the individual bytes, or look at the struct module which can help you with this kind of decoding task. regards Steve -- Meet the Python developers and your c.l.py favorites March 23

Re: Error!

2005-02-05 Thread Steve Holden
Bruno Desthuilliers wrote: Steve Holden a écrit : (snip) So, for example, your program might look like this: base_price = int(raw_input(...)) tax_rate = int(raw_input(...) tax_amount = base_price * ((100+tax_amount)/...) s/(100+tax_amount)/(100 + tax_rate)/, I guess ? Oops. Let's try tax_a

<    13   14   15   16   17   18   19   20   21   22   >