Re: Problems posting with urlencode

2005-10-02 Thread Steve Holden
If there's no chance of putting any debug statements into the processing script you might consider using a proxy or submitting to a local server to ensure that you are submitting what you think. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC

Re: Distributing programs

2005-10-02 Thread Steve Bergman
Leif K-Brooks wrote: >But remember that Python bytecode can be easily decompiled with a >publicly-available program. > > I hope it is not considered too antisocial to bring it up here, but there is always PyObfuscate: http://www.lysator.liu.se/~astrand/projects/pyobfuscate/ -S

Re: Distributing programs

2005-10-02 Thread Steve Bergman
Wouter van Ooijen (www.voti.nl) wrote: >Yes, and you must also include a blank sheet, signed by you in blood. > > I thought you only had to do that if you were submitting a patch to MySQL, Qt, OpenOffice, or OpenSolaris. ;-) -Steve Bergman -- http://mail.python.org/mailman/listin

Re: Finding the Process Path

2005-10-03 Thread Steve Holden
at this is available as sys.executable > The interpreter? That's correct. What you probably want is import os, sys print os.path.abspath(sys.argv[0]) this will give you the path to the Python script the interpreter is running. regards Steve -- Steve Holden +44 150 684 7255

Re: "no variable or argument declarations are necessary."

2005-10-03 Thread Steve Holden
> is a testing framework for them. > Hmm. Presumably introspection via getattr() is way too dangerous, then? Might as well throw the function away ... regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 20

Re: question about smtplib

2005-10-03 Thread Steve Holden
can call server.close(), i just dont know when it was > opened. > thanks > If you provide the host name the server is connected immediately. You can use that connection to send several emails, terminating the connection when you call the object's quit() method. regards

Re: Dynamical loading of modules

2005-10-03 Thread Steve Holden
;>fruit_files = [x for x in os.listdir(fruit_dir) if (x[-3:]=='.py' and >>x!='__init__.py')] >>for fruit_file in fruit_files: >> module_name = fruit_files[:-3] > > ^^^ This should be fruit_file, of course. > > >> exec "from %s import *" % module_name >> Wouldn't __import__(module_name) be better. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Debug Build

2005-10-03 Thread Steve Holden
Celine & Dave wrote: > Hi, > > What happens if I build Python with debug option > (--with-pydebug)? Do I see any changes in my program > output? What is --with-pydebug good for? > It's used for debugging the Python interpreter itself. regards Steve -- Steve Holden

Re: Reply-To header

2005-10-03 Thread Steve Holden
subscribing to the mailing list, you receive all > posts to the list, not just the replies to your own post. But that's not > a big disadvantage. On the contrary; one can easily learn something from > them. > ... if one has time to do anything but curse and delete them !

Re: Reply-To header

2005-10-04 Thread Steve Holden
mail from >>that list. Similarly, I no longer try and explain to people how long >>lines violate RFCs and are a pain to read in well-behave mail readers, > [...] Having a mailer that can vary its behaviour from one list to another is something that's way beyond 90% of In

Re: "no variable or argument declarations are necessary."

2005-10-04 Thread Steve Holden
imply add an extra run to fix up the "forgot to declare" problem. After that you get precisely one runtime error per "forgot to initialize". regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: What is executed when in a generator

2005-10-04 Thread Steve Holden
g that you can, if you want to you can call the generator's next() method to access the next in its sequence of results: >>> s1 = shg(3) >>> s2 = shg(7) >>> print [(i, s2.next()) for i in s1] [(1, 1)] >>> print [i for i in s2] [3, 5] Hope this makes things a little clearer. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamical loading of modules

2005-10-04 Thread Steve Holden
Carsten Haese wrote: > On Mon, 2005-10-03 at 17:37, Steve Holden wrote: > >>Carsten Haese wrote: >> >>>On Mon, 2005-10-03 at 16:41, Carsten Haese wrote: >>> >>> >>>>On Mon, 2005-10-03 at 15:52, Jacob Kroon wrote: >>>> >

Re: Dynamical loading of modules

2005-10-04 Thread Steve Holden
Carsten Haese wrote: > On Tue, 2005-10-04 at 08:32, Steve Holden wrote: > >>Carsten Haese wrote: >> >>>On Mon, 2005-10-03 at 17:37, Steve Holden wrote: >>> >>> >>>>Carsten Haese wrote: >>>> >>>> >>>>>

Re: cgi relay for python cgi script

2005-10-04 Thread Steve Holden
> > Amir > You are hardly likely to improve performance by substituting a fairly high-level application like CGI or MySQL for NFS. But later you suggest that security is the issue rather than performance. I'm confused. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Swig and Python

2005-10-04 Thread Steve Juranich
WIG list. There are lots of Python hackers on the list, too. So don't be afraid to ask fairly Python-centric questions either. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception raising, and performance implications.

2005-10-04 Thread Steve Holden
an exception in Python itself. That said, exceptions are probably rather more "lightweight" than you might imagine, so benchmarking (the profiler may not be best - have you come across "timeit.py"?) is the best way to go. regards Steve -- Steve Holden +44 150

Re: Which SQL module to use?

2005-10-04 Thread Steve Bergman
insert this or update this and its done. With selects, its easy to get your results as a dictionary. -Steve Bergman -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie regular expression ?

2005-10-04 Thread Steve Holden
't need regular expressions. You want list1 = glob.glob("[Uu][Nn][Qq]*.dat") regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get any available port

2005-10-05 Thread Steve Holden
avior for sockets, or > whether > it's a special behavior of linux. > It's been standard behaviour ever since the Berkeley socket interface was defined, as far as I know. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionary interface

2005-10-05 Thread Steve Holden
otherwise defined. > > This seems to imply that the specific method to sort the dictionaries > is unimported (as long as it is a total ordering). So I can use whatever > method I want as long as it is achieves this. > > But that is contradicted by the unittest. If you have a unittest

Re: Confused with module and .py files

2005-10-05 Thread Steve Holden
thout getting any naming conflicts. In general the "from module import *" form should only be used under specific conditions, which we needn't discuss here now. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenwe

Re: "no variable or argument declarations are necessary."

2005-10-05 Thread Steve Holden
t actually executable, and simply conditions the code generated during compilation (to bytecode). Hard to see why someone would want to use a global declaration unless they were intending to assign to it, given the sematnics of access. > [...] regards Steve -- Steve Holden +4

Re: dictionary interface

2005-10-05 Thread Steve Holden
Antoon Pardon wrote: > Op 2005-10-05, Steve Holden schreef <[EMAIL PROTECTED]>: [...] > > Anyway, I have searched the source of the test for all testing > with regards to < and after some browsing back and fore it seems > it all boils down to the following two tests.

Re: bug or feature?

2005-10-05 Thread Steve Holden
he default argument is (a reference to) a mutable object (such as a list instance) then if one call to the function modifies that mutable object, subsequent calls see the mutated instance as the default value. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC

Re: Python, Mysql, insert NULL

2005-10-05 Thread Steve Holden
t all this? mysql> select * from t1; +--+--+ | f1 | f2 | +--+--+ | row1 | NULL | | row2 | NULL | | row3 | None | +--+--+ 3 rows in set (0.00 sec) And the moral of the story is to believe someone is actually trying to help you unless you have definite evidence

Re: bug or feature?

2005-10-05 Thread Steve Holden
utput: ["hallo"] > > The point seems to be, that lst=[] creates a class attribute (correct > name?), which is shared by all instances of A. So a.lst ist the same > object as b.lst, despite the fact, that object a is different to object > b. > Fredrik Lundh wrote: >

Re: bug or feature?

2005-10-05 Thread Steve Holden
does the compiler know which objects are mutable? This would not be a good change. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: change a value to NULL?

2005-10-05 Thread Steve Holden
ike "INSERT INTO ROW VALUE NULL()", > kind of like the SQL DATE(), etc. I'm really rusty on my syntax etc > right now btw so don't copy and paste that. :P > And besides that, Excel is a spreadsheet not a database :-) regards Steve -- Steve Holden

Re: updating local()

2005-10-05 Thread Steve Holden
rgs): > > print 'locals:',locals() > locals().update(args) > print locals() > > e = {'s':3,'e':4} > fun(k=10,v=32,**e) > Because it depends on the current implementation and isn't guaranteeed to work in th

Re: MS Word mail merge automation

2005-10-05 Thread Steve M
I was finally able to get things working right, so I thought I'd stick an example here for posterity. """An example of a MS Word mail merge using the COM interface. In order for this script to work you must first run the COM Makepy utility and select "Microsoft Word 10.0 Object Library (8.2)" or w

Re: Replacing utf-8 characters

2005-10-05 Thread Steve Holden
is in the page source to start >>with (which is as it ought to be). What are you using to parse the HTML? >> >> You must be doing *something* wrong: >>> link = "/news/newsArticle.aspx?type=businessNews&amp;storyID=2005-10-05T151245Z_01_HO548006_RTRUKOC_0_U

Re: Class methods

2005-10-06 Thread Steve Holden
sh. > > > Of course, those posts do keep the Google count for the famous > four-letter-abbreviation down (-; > > Gerrit. > I'd been thinking it was about time the mucking fanual was updated. regards Steve -- Steve Holden +44 150 684

Re: Python, Mysql, insert NULL

2005-10-06 Thread Steve Holden
g will > accept a Null value. > Thomas Bartkus > > If you don't understand parameterized SQL queries you would do well to refrain from offering database advice :-) Presumably you always check whether StrToConcatenateIntoSqlStatement contains no apostrophes before you actually constr

Re: updating local()

2005-10-06 Thread Steve Holden
tion header? > > > I'd lie down until I felt better. > > Or alternatively put them in a 1,000-element list. Just as a matter of interest, what on *earth* is the use case for a function with a thousand arguments? regards Steve -- Steve Holden +44 150 684 7255 +1

Re: Help with chaos math extensions.

2005-10-06 Thread Steve Holden
compile extensions for Python 2.4 on Windows, having done that myself. See http://www.vrplumber.com/programming/mstoolkit/ regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Lambda evaluation

2005-10-06 Thread Steve M
Here's another one: >>> d = {} >>> for x in [1,2,3]: ... d[x] = (lambda z: lambda y: y * z) (x) ... >>> d[1](3) 3 >>> d[2](3) 6 -- http://mail.python.org/mailman/listinfo/python-list

Re: "no variable or argument declarations are necessary."

2005-10-06 Thread Steve Holden
ed it would need to be. > > def nulldecorator(f): > return f > > if not __debug__: >debugdecorator = nulldecorator > It would be easier to write if not __debug__: def debugdecorator(f): return f regards Steve -- Steve Holden

Bug in COM Makepy utility? (ActivePython 2.4)

2005-10-06 Thread Steve M
When I use the COM Makepy utility on one computer with WindowsXP, ActivePython 2.3 and I select the library Microsoft Word 10.0 Object Library (8.2), things work fine. When I have WindowsXP, ActivePython 2.4 (build 247) and Microsoft Word 11.0 Object Library (8.3), then I get the following SyntaxEr

Re: where to find information about errors/exceptions in socket.py

2005-10-07 Thread Steve Holden
t I didn't > observe much with regard to error/exception handling. > I'd suggest reading the documentation myself: http://docs.python.org/lib/module-socket.html regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holde

Re: non descriptive error

2005-10-07 Thread Steve Holden
necessarily run all the logic that gets run by your command. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Steve Holden
ur answer tells more about you then about my suggestion. > Damn, I've been keeping away from this thread lest my exasperation lead me to inappropriate behaviour. Is there any statement that you *won't* argue about? leaving-the-(hopefully)-last-word-to-you-ly y'rs - steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-10-07 Thread Steve Holden
, what can you expect from a country whose leader pronounces "nuclear" as though it were spelled "nucular"? I suppose it's only a matter of time before they change the spelling just like they did with "aluminium". tongue-in-cheek-ly y'rs - steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Steve Holden
Paul Rubin wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > >>In other words, you want Python to be strongly-typed, but sometimes >>you want to allow a reference to be to any object whatsoever. In which >>case you can't possibly do any sensible type-check

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-10-07 Thread Steve Holden
Richie Hindle wrote: > [Steve] > >>and yes, I split that infinitive just to >>annoy any pedants who may be reading > > > [Steven] > >>*Real* pedants will know that English is not Latin, does not follow the >>grammatical rules of Latin, and that just

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Steve Holden
be perfect but it doesn't need to be. It > doesn't need to constrain us in any way but if it can detect some errors > early, then it is worth it. While this is a perfectly acceptable feature request, we should remember that Python is developed and maintained by a

Re: Python interpreter bug

2005-10-07 Thread Steve Holden
e snippet will trigger the assert. The culprit seems to > be the __cmp__ method which sorts on a key with constant value. Well indeed. As far as I can see your objects will all test equal. Did you mean the __cmp__ method to return cmp(other.id, self.id)? regards Steve -- Steve Holde

Re: Python interpreter bug

2005-10-07 Thread Steve Holden
test obj in excluded is succeeding for all your objects because all instances of the OBJ class compare equal, and so the assert is failing for the ones that don;t actually appear in the "excluded" list. regards Steve -- Steve Holden +44 150

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-10-07 Thread Steve Holden
Grant Edwards wrote: > On 2005-10-07, Steve Holden <[EMAIL PROTECTED]> wrote: [...] >>Then again, what can you expect from a country whose leader >>pronounces "nuclear" as though it were spelled "nucular"? > > > Don't get me started on _that

Re: Python interpreter bug

2005-10-07 Thread Steve Holden
[EMAIL PROTECTED] wrote: > I understand this, Steve. > I thought the _cmp_ method was a helper for sorting purposes. Why is it > that a membership test needs to call the __cmp__ method? Can you suggest another way to test for set membership, given that instances aren't singletons

Re: Bug in COM Makepy utility? (ActivePython 2.4)

2005-10-07 Thread Steve M
After exploring the bug database I discovered that this bug has been reported since March, and appears to derive from a bug in Python itself. http://bugs.activestate.com/show_bug.cgi?id=38052 It apparently only happens when the code generated by Makepy is really big (which it is for Word or Excel

Re: Python interpreter bug

2005-10-07 Thread Steve Holden
[EMAIL PROTECTED] wrote: >>Steve Holden wrote: >>Consider: > > > >>> a = {1:'one'} > >>> b = {2:'two'} > >>> c = {1:'one'} > >>> a is c > False > >>> a in [b, c] > True > &

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-10-07 Thread Steve Holden
Terry Hancock wrote: > On Friday 07 October 2005 03:01 am, Steve Holden wrote: > >>OK, so how do you account for the execresence "That will give you a >>savings of 20%", which usage is common in America? > > > In America, anyway, "savings" is a

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-10-08 Thread Steve Holden
Terry Hancock wrote: > On Friday 07 October 2005 03:44 pm, Steve Holden wrote: > >>Precisely because there *is* such a thing as a saving. If I buy a $100 >>gumball for $80 I have achieved a saving of 20%. > > > Nope, that's incorrect American. ;-) > > Yo

Re: When someone from Britain speaks, Americans hear a "Britishaccent"...

2005-10-08 Thread Steve Holden
houted "The Queen", to which he replied "The Queen, sir, is not a subject". regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-10-08 Thread Steve Horsley
Steve Holden wrote: > Then again, there's room for infinite disagreement about these topics. I > mentioned a while ago that I disliked the English on a bumper sticker I > liked, which read > > "Some village in Texas is missing their idiot". > > Several

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-10-08 Thread Steve Holden
Steve Horsley wrote: [...] > > The one that always makes me grit my teeth is "You have got to, > don't you?". Well no, I do NOT got to, actually. Shudder! > Shouldn't that be "I don't have to got to"? regards Steve -- Steve Holden +

Re: What about letting x.( ... ? ... ) be equivalent to ( ... x ... )

2005-10-09 Thread Steve Holden
fraid you would have to work rather harder to persuade me that there is a problem, let alone that you have found the solution to it. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about StringIO

2005-10-09 Thread Steve Holden
> more info if necessary. > Unfortunately the StringIO module only creates instances inside the process they are called: these objects have no existence to the operating system or to other processes, and so can't be used for inter-process communication. regards Steve -- Steve Hold

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-10-09 Thread Steve Horsley
Steve Holden wrote: > Steve Horsley wrote: > [...] >> >> The one that always makes me grit my teeth is "You have got to, don't >> you?". Well no, I do NOT got to, actually. Shudder! >> > Shouldn't that be "I don't have to got to&quo

Re: Python on the Power PC

2005-10-10 Thread Steve Holden
tle('Hello World?') > > root.mainloop() > > Are you sure it didn't say "_tkinter" was what it couldn't find? On my Windows system the Tkinter.py file tries to import an extension (compiled C) module called _tkinter (provided as _tkinter.dll) th

Re: One last thing about SocketServer

2005-10-10 Thread Steve Holden
ltiple clients concurrently, but it's very convenient when you are just getting started. Later you might want to consider an asyncore-based approach, or perhaps using the Twisted package. Both of these solutions are a little more robust for production code. regards Steve -- Steve Holden

Re: Default argument to __init__

2005-10-10 Thread Steve Holden
me. The idiom usually used to avoid this gotcha is: def __init__(self, myarr=None): if myarr is None: myarr = [] This ensures each call with the default myarr gets its own list. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC

Re: Comparing lists

2005-10-10 Thread Steve Holden
. identify worst-case scenarios and then estimate order-of-magnitude behaviour for them). Test results with known test data are relatively easy to extrapolate from, and if your test data are reasonably representative of live data then so will your performance estimates. Anyway, aren't you

Re: Send password over TCP connection

2005-10-10 Thread Steve Holden
secure the authentication exchange: they do nothing to protect application data. regards Steve > dcrespo wrote: > >>Hi all, >> >>I have a program that serves client programs. The server has a login >>password, which has to be used by each client for loggin

Changing console text color

2005-10-10 Thread Steve M
Hello, I've been trying to change the text color on a windows console program I've been working on with no luck. I should mention that I'm a novice so please dummy up your replies. Thanks-in-Advance Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: Changing console text color

2005-10-10 Thread Steve M
Thank you. I appreciate the help. Steve Larry Bates wrote: > You can use this module to control console windows background and > text colors. > > http://www.effbot.org/zone/console-index.htm > > -Larry Bates > > Steve M wrote: >> Hello, >> >>

Re: Python's Performance

2005-10-10 Thread Steve Holden
7;'' > > I've seen at least the first two debated endlessly here. > > -Peter And we definitely need "agile" in there. Bugger, I'll go out and come in again ... regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python name lookups

2005-10-10 Thread Steve Holden
u have determined what you are really asking. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python, COM Servers, and Multi-Threading

2005-10-10 Thread Steve Holden
terpreter. You also need to be aware that if you trigger this stuff with IIS then the web server itself performs thread pooling and (I believe) allocates only one process per "application", so this may defeat your desire to use all four processors concurrently. rega

Re: strange import error with Python-2.4.1

2005-10-11 Thread Steve Holden
xlrd's attempted psyco use > shouldn't be an issue. Thanks for 2.4.2, but is this one of the fixed bugs or > has it just got harder to induce? Robin: Can I ask if you are specifying a source encoding in your file with a pragma (?) like # -*- coding: iso-8859-15 -*- I've notic

Re: strange import error with Python-2.4.1

2005-10-11 Thread Steve Holden
Fredrik Lundh wrote: > Steve Holden wrote: > > >>Can I ask if you are specifying a source encoding in your file with a >>pragma (?) like >> >># -*- coding: iso-8859-15 -*- >> >>I've noticed what appear to be spurious syntax errors from time to

Re: Can module access global from __main__?

2005-10-11 Thread Steve Holden
implies that you really need to think a little harder about the structure of your program. If you tell us the *real* problem (back to my "why do you want to do that" question ...) perhaps we can suggest a better-structured solution. regards Steve PS: If A is the main program (the mod

Re: Can module access global from __main__?

2005-10-11 Thread Steve Holden
t import. Even then (on the first import) I am not sure how you could introspect to find the answer you want. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionnaries and lookup tables

2005-10-11 Thread Steve Holden
> > dictcomp(1000) > #end of listing > > I get 1000 True's on the output, which suggests that key-wise ordering > is implemented in some guise. The question is: how do I access that? > You don't. There is no ordering of the keys, so there is no way that you can

Re: A problem while using urllib

2005-10-12 Thread Steve Holden
x27;m using 2.4.1 on cygwin of WinXP. > If you want to reproduce the problem, I can send the source to you. > > This morning I found that this is caused by urllib2. When I use urllib > instead of urllib2, it won't crash any more. But the matters is that I > want to catch the

Re: can we save print msg into a file when script running ?

2005-10-12 Thread Steve Holden
.txt which will show you the last part of the file and further additions as long as you let the tail command run. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/

Re: Adding a __filename__ predefined attribute to 2.5?

2005-10-12 Thread Steve Holden
system. Here's a clue as to how you might do without __file__ altogether: [EMAIL PROTECTED] ~/Projects/Python $ cat test78.py import sys print sys.argv [EMAIL PROTECTED] ~/Projects/Python $ python test78.py can we say live with it? ['test78.py', 'can', 'we', 's

Re: A problem while using urllib

2005-10-12 Thread Steve Holden
Johnny Lee wrote: > Steve Holden wrote: > >>Johnny Lee wrote: >> >>>Alex Martelli wrote: >>> >>> >>>>Johnny Lee <[EMAIL PROTECTED]> wrote: >>>> ... >>>> >>>> >>>>> try: >

Re: A problem while using urllib

2005-10-12 Thread Steve Holden
Steve Holden wrote: > Johnny Lee wrote: > [...] > >>I've sent the source, thanks for your help. >> > > [...] > Preliminary result, in case this rings bells with people who use urllib2 > quite a lot. I modified the error case to report the actual message

Re: A problem while using urllib

2005-10-12 Thread Steve Holden
Johnny Lee wrote: > Steve Holden wrote: > >>Steve Holden wrote: >> >>>Johnny Lee wrote: [...] >> >>So my conclusion is that there's something in the Cygwin socket module >>that causes problems not seen under other platforms. >> >>

Re: A Tree class, my $0.02 contribution to the python community.

2005-10-12 Thread Steve Holden
t;cdict" might be a better name ... regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: can we save print msg into a file when script running ?

2005-10-12 Thread Steve Holden
black wrote: > quote: > === > script.py >> script.log 2>&1 > === > > what does 2>&1 mean pls ? > It's Unix shell-speak for "send the standard error stream to the same place as the standard output".

Re: Threads and socket.setdefaulttimeout

2005-10-12 Thread Steve Holden
ht: (10061, 'Connection refused') > #Exception caught: timed out > Here (unless I'm missing something obvious) it seems that your worker thread terminates immediately after setting the default timeout, and both of the proxy calls are made from the main thread, so I'm not particularly surprised at the results, given the global nature of the default socket timeout. Maybe someone else can think of something that will help. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Advice on this code

2005-10-12 Thread Steve M
output.write(wrkmisc(ifile,2582)) output.write(wrkviol(ifile,2774,16)) output.write(wrkaccid(ifile,3270,16)) output.write(wrkmisc2(ifile,3638)) output.write(wrkcov(ifile,3666,6))

Re: Adding a __filename__ predefined attribute to 2.5?

2005-10-13 Thread Steve Holden
Rune Strand wrote: > Ok, Alex. I know a good explanation when I see one. Thanks! > Make that "...when someone beats me over the head with it" ;-) Glad you have the explanation you needed, anyway. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 311

Re: Python's garbage collection was Re: Python reliability

2005-10-13 Thread Steve Holden
foresee that there'd be problems at the outer edges of the language: for example, sys.maxint would have to be reduced, and this in turn would lead to reduction in, for example, the theoretical maximum length of sequences. Even if it reduced the average execution time of the "aver

Re: Well written open source Python apps

2005-10-13 Thread Steve M
Here is an article discussing the coding style of BitTorrent. http://www.onlamp.com/pub/a/python/2003/7/17/pythonnews.html Maybe that code is worth looking at. -- http://mail.python.org/mailman/listinfo/python-list

Re: installer for amd64 build of python?

2005-10-13 Thread Steve Holden
http://www.vrplumber.com/programming/mstoolkit/ to install the MS Toolkit, but I haven't tried compiling 64-bit code myself, not having any 64-bit hardware. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.co

Re: A problem while using urllib

2005-10-13 Thread Steve Holden
John J. Lee wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > [...] > >> File "/usr/lib/python2.4/urllib2.py", line 996, in do_open >> raise URLError(err) >>urllib2.URLError: >> >>Looking at that part of the course of urrlli

Re: Python's garbage collection was Re: Python reliability

2005-10-13 Thread Steve Holden
nvolved in endless. Sorry for the ad hominem remarks, which I normally try and avoid, but this (ab)uses newsgroup bandwidth unnecessarily. Unwillingness to admit any mistake can be rather unattractive. Can't you, just once, say "I was wrong"? Or are you perchance related to President Bush? B

Re: FORM data in cgi

2005-10-13 Thread Steve Holden
Mike Meyer wrote: > "jponiato" <[EMAIL PROTECTED]> writes: > > >>Greetings. >>An HTML form submits it's data to a python cgi script on my server. This >>script accepts this POST data, and uses urllib.urlopen() to call a different >>cgi script (on an external server), passing this same data. I'm

Re: wxPython & Cygwin

2005-10-13 Thread Steve Holden
an extension module. > But maybe you _can_ compile it yourself - I didn't try, though. > > Diez Probably a daunting task. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006

Re: Hidden string formatting bug

2005-10-13 Thread Steve Holden
> errors (for example, your original mistake would have been impossible > to make this way). Use parens instead of backslashes. Don't use "+" > to catenate string literals: the Python compiler automatically > catenates adjacent string literals for you, and at compile-time (

Re: UI toolkits for Python

2005-10-14 Thread Steve Holden
er is a modestly-priced commercial product that represents very good value for money). While wxDesigner doesn't do everything you might want it seems to be better than anything else I've come across for building resizable dialogues and panels, which are readily used as components in ot

Re: Help with creating a dict from list and range

2005-10-14 Thread Steve Holden
iption = ["first", "second", "third"] >>> for x in enumerate(description): ... print x ... (0, 'first') (1, 'second') (2, 'third') >>> dct = dict((x[1], x[0]) for x in enumerate(description)) >&

Re: Queue question

2005-10-15 Thread Steve M
According to my "Python in a Nutshell": q.get(block=True) is the signature, so, as you use it above, the call will hang until something is on the queue. If block is false and the queue is empty, q.get() will raise the exception Empty. q.get_nowait is apparently synonymous with q.get(block=False)

Re: Microsoft Hatred FAQ

2005-10-15 Thread Steve Sobol
re Holocaust survivors, and I still think you're a complete asshole for even attempting to compare anything Microsoft does to what Hitler did. It trivializes the Holocaust. Fuck off. Please. (There, I said "please.") -- Steve Sobol, Professional Geek 888-480-4638

Re: Microsoft Hatred FAQ

2005-10-15 Thread Steve Sobol
t Bill Gates may have dabbled in programming, but his background is in business. He dropped out of Harvard Business School, not MIT. :) -- Steve Sobol, Professional Geek 888-480-4638 PGP: 0xE3AE35ED Company website: http://JustThe.net/ Personal blog, resume, portfolio: http://SteveSobol.co

Re: UI toolkits for Python

2005-10-16 Thread Steve Holden
ch graphical interface, it can be quite difficult to manage state maintenance between the two components (web server, web client) in the system. A "proper" GUI runs all functionality inside a single process, and allows much easier control over complex interactions, creation of dynamic

<    8   9   10   11   12   13   14   15   16   17   >