Re: variable hell

2005-08-25 Thread Robert Kern
Nx wrote: Why unpack inputvalues if your next step is to pack'em back again ? Or what did I miss ? The original values in this case are being read from a text file with one value including a linefeed per line and the original idea was, that having them read into a list was the best way to

Re: Experience regarding Python tutorials?

2005-08-25 Thread [EMAIL PROTECTED]
I'd say, start with Python and work yourself into more complex languages. Python teaches you to indent properly, and it is good with being simple, yet powerful at the same time. I'd be happy to teach you the basics with Python. I've taught a few people how to program, and they learn Python pretty

Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Mark Dickinson
I have a simple 192-line Python script that begins with the line: dummy0 = 47 The script runs in less than 2.5 seconds. The variable dummy0 is never referenced again, directly or indirectly, by the rest of the script. Here's the surprise: if I remove or comment out this first line, the script

Re: variable hell

2005-08-25 Thread Steve Holden
Carsten Haese wrote: On Thu, 2005-08-25 at 11:04, I hastily wrote: On Thu, 2005-08-25 at 10:43, Nx wrote: Thanks for the many replies here is an example for what it will be used for , in this case fixed at 31 fieldvalues:

Re: Jargons of Info Tech industry

2005-08-25 Thread Mike Schilling
Rich Teer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Thu, 25 Aug 2005, Mike Schilling wrote: Another advantage is that evewry internet-enabled computer today already comes with an HTML renderer (AKA browser), so that a message saved to a file can be read very easily. I

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Jack Diederich
On Thu, Aug 25, 2005 at 04:44:24PM +, Mark Dickinson wrote: I have a simple 192-line Python script that begins with the line: dummy0 = 47 The script runs in less than 2.5 seconds. The variable dummy0 is never referenced again, directly or indirectly, by the rest of the script.

Re: Fighting Spam with Python

2005-08-25 Thread François Pinard
[David MacQuigg] The key new features needed in a spam filter are the ability to extract the sender's identity (not that of the latest forwarder), and to factor into the spam score the reputation of that identity. This will only work if your system is immune to forgeries, while being largely

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Erik Max Francis
Mark Dickinson wrote: Questions: (1) Can anyone else reproduce this behaviour, or is it just some quirk of my setup? (2) Any possible explanations? Is there some optimization that kicks in at a certain number of lines, or at a certain length of bytecode? (3) If (2), is there

Re: Jargons of Info Tech industry

2005-08-25 Thread T Beck
Mike Schilling wrote: Rich Teer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Thu, 25 Aug 2005, Mike Schilling wrote: Another advantage is that evewry internet-enabled computer today already comes with an HTML renderer (AKA browser), so that a message saved to a file

Re: Jargons of Info Tech industry

2005-08-25 Thread joe
Mike Schilling [EMAIL PROTECTED] writes: Rich Teer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Thu, 25 Aug 2005, Mike Schilling wrote: Another advantage is that evewry internet-enabled computer today already comes with an HTML renderer (AKA browser), so that a

Re: Newbie question: Sub-interpreters for CAD program

2005-08-25 Thread Terry Hancock
On Thursday 25 August 2005 09:13 am, Peter Hansen wrote: Terry Hancock wrote: On Wednesday 24 August 2005 09:12 pm, Peter Hansen wrote: Or even http://www.pythoncad.org/ which, although probably for mechanical CAD work (I haven't looked at it, don't really know), is surely a good place to

algorithm for non-dimensionalization

2005-08-25 Thread gyromagnetic
Hi, I am trying to non-dimensionalize some data I have obtained. There are no 'standard' dimensionless groups for my application, so I would like to obtain the 'best' non-dimensional groups based on some statistical measures of the resulting transformed data. At this point, I am looking for a way

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Bill Mill
On 8/25/05, Mark Dickinson [EMAIL PROTECTED] wrote: I have a simple 192-line Python script that begins with the line: dummy0 = 47 The script runs in less than 2.5 seconds. The variable dummy0 is never referenced again, directly or indirectly, by the rest of the script. Here's the

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Bill Mill
On 8/25/05, Erik Max Francis [EMAIL PROTECTED] wrote: Mark Dickinson wrote: Questions: (1) Can anyone else reproduce this behaviour, or is it just some quirk of my setup? (2) Any possible explanations? Is there some optimization that kicks in at a certain number of lines,

Re: Jargons of Info Tech industry

2005-08-25 Thread John Bokma
T Beck [EMAIL PROTECTED] wrote: If we argue that people are evolving the way e-mail is handled, and adding entire new feature sets to something which has been around since the earliest days of the internet, then that's perfectly feasable. HTML itself has grown. We've also added Javascript

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Erik Max Francis
Bill Mill wrote: Unlikely; 2 people have confirmed these results already. I did find, though, that if I remove all print statements from the program, the dummy and non-dummy variable versions take indentical time. Can others reproduce this? Yes, it's obviously a real effect given the other

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Bill Mill
Bill Mill wrote: Pentium M 1.8 GHz Windows 2k. Here's the top of the profile results for fast and slow on my machine (these won't look decent except in a fixed-width font): snip profiles Interestingly, the test.py:36 line, which takes 45 seconds (!!) in the slow version, does not appear

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Jack Diederich
On Thu, Aug 25, 2005 at 01:35:04PM -0400, Bill Mill wrote: On 8/25/05, Erik Max Francis [EMAIL PROTECTED] wrote: Mark Dickinson wrote: Questions: (1) Can anyone else reproduce this behaviour, or is it just some quirk of my setup? (2) Any possible explanations? Is there

Re: Jargons of Info Tech industry

2005-08-25 Thread joe
T Beck [EMAIL PROTECTED] writes: Mike Schilling wrote: Rich Teer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Thu, 25 Aug 2005, Mike Schilling wrote: Another advantage is that evewry internet-enabled computer today already comes with an HTML renderer (AKA

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Mark Dickinson
In article [EMAIL PROTECTED], Bill Mill [EMAIL PROTECTED] wrote: One of my own: what in the world made you think maybe I'll add 29 dummy global variables to speed things up? You mean this isn't a well-known optimization technique? :) I was refactoring the code, and after making a particular

Re: Jargons of Info Tech industry

2005-08-25 Thread John Bokma
Rich Teer [EMAIL PROTECTED] wrote: On Thu, 25 Aug 2005, Mike Schilling wrote: Another advantage is that evewry internet-enabled computer today already comes with an HTML renderer (AKA browser), so that a message saved to a file can be read very easily. I think you're missing the point:

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread jay graves
Mark Dickinson wrote: Questions: (1) Can anyone else reproduce this behaviour, or is it just some quirk of my setup? yes. I get 7 sec vs 1 sec on my laptop. (2) Any possible explanations? Is there some optimization that kicks in at a certain number of lines, or at a certain length

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Jack Diederich
On Thu, Aug 25, 2005 at 01:55:48PM -0400, Bill Mill wrote: Bill Mill wrote: Pentium M 1.8 GHz Windows 2k. Here's the top of the profile results for fast and slow on my machine (these won't look decent except in a fixed-width font): snip profiles Interestingly, the test.py:36

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Bill Mill
On 8/25/05, Jack Diederich [EMAIL PROTECTED] wrote: On Thu, Aug 25, 2005 at 01:35:04PM -0400, Bill Mill wrote: On 8/25/05, Erik Max Francis [EMAIL PROTECTED] wrote: Mark Dickinson wrote: Questions: (1) Can anyone else reproduce this behaviour, or is it just some quirk

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Stelios Xanthakis
Mark Dickinson wrote: I have a simple 192-line Python script that begins with the line: dummy0 = 47 The script runs in less than 2.5 seconds. The variable dummy0 is never referenced again, directly or indirectly, by the rest of the script. Here's the surprise: if I remove or comment

Re: Jargons of Info Tech industry

2005-08-25 Thread Alan J. Flavell
On Thu, 25 Aug 2005, Mike Schilling wrote: [Off Topic discussion of netiquette, seen on comp.lang.perl.misc:] Gosh, if you say they should be, there's no point trying to have an intelligent discussion, is there? Discussion about netiquette on any of these cross-posted groups cannot by

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing, was Re: Bug in slice type

2005-08-25 Thread Paul Rubin
Steve Holden [EMAIL PROTECTED] writes: As far as position reporting goes, it seems pretty clear that find() will always report positive index values. In a five-character string then -1 and 4 are effectively equivalent. What on earth makes you call this a bug? And what are you proposing that

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Bill Mill
On 8/25/05, Erik Max Francis [EMAIL PROTECTED] wrote: Bill Mill wrote: Unlikely; 2 people have confirmed these results already. I did find, though, that if I remove all print statements from the program, the dummy and non-dummy variable versions take indentical time. Can others

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Jack Diederich
On Thu, Aug 25, 2005 at 09:23:09PM +0300, Stelios Xanthakis wrote: The explanation is this: hash and comparison of objects depends on the state of the memory allocator. A sample case is this: class A: pass dummy0=47 # comment this to get a different result for min a=A()

Superclass files and order - oh my!! Questioning the experts!!

2005-08-25 Thread rh0dium
Hi all, Still a newbie but making some headway. So I have a file structure like this.. top/ --modules/ metrics.py --metrix/ uptime.py Now metrics.py is my superclass, and uptime.py inherits the superclass metrics.py. So for arguments sake metrics.py class metrics():

Re: Jargons of Info Tech industry

2005-08-25 Thread Mike Schilling
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Mike Schilling [EMAIL PROTECTED] writes: Rich Teer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Thu, 25 Aug 2005, Mike Schilling wrote: Another advantage is that evewry internet-enabled computer today already

Re: Command Line arguments

2005-08-25 Thread Trent Mick
[michael wrote] SOLVED! Thank you. I wonder why this was needed for 2.4 and not 2.2? I don't think it was lingering things from old installs because it happened on a persons computer that had never had any python installed before 2.4. It might be due to a bug in the Python 2.4 installer not

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Bill Mill
On 8/25/05, Jack Diederich [EMAIL PROTECTED] wrote: On Thu, Aug 25, 2005 at 09:23:09PM +0300, Stelios Xanthakis wrote: The explanation is this: hash and comparison of objects depends on the state of the memory allocator. A sample case is this: class A: pass dummy0=47 #

Re: Jargons of Info Tech industry

2005-08-25 Thread Rich Teer
On Thu, 25 Aug 2005, John Bokma wrote: Just have a look at some web based message boards, and you might see why it would be another disaster on Usenet. Moreoever, why keep people insisting on making Usenet better? If you want HTML and fancy mark up, start a message board. You probably can get

Re: Superclass files and order - oh my!! Questioning the experts!!

2005-08-25 Thread rh0dium
Slight correction.. rh0dium wrote: Hi all, Still a newbie but making some headway. So I have a file structure like this.. top/ --modules/ metrics.py --metrix/ uptime.py Now metrics.py is my superclass, and uptime.py inherits the superclass metrics.py. So for arguments sake

Re: variable hell

2005-08-25 Thread bruno modulix
[EMAIL PROTECTED] wrote: Hey, if the man wants to write it that way, let the man write it that way. If it works for him, great... he's sure confused the heck out of all of us, and that translates into job security for him! As you can see, the name of the post is 'variable hell' and that is

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Mark Dickinson
In article [EMAIL PROTECTED], Stelios Xanthakis [EMAIL PROTECTED] wrote: In the sudoku solver, there is a min (number, object) which is probably what's affected by the extistance of the dummy variable. Now, in sudoku puzzles some times the algorithm has to suppose that in a box the right

Suppressing checking of modules with pychecker

2005-08-25 Thread Qopit
Does anyone know how to stop the command line pychecker from analyzing particular modules? It really gets slowed down on some big ones. In particular having 'import wx' takes a long while (30 - 60s). If you try pycheck'ing the program below it takes a while and prints a zillion warnings. #---

Re: loop in python

2005-08-25 Thread James
I don't want to offend you or anything, but doesn't the second sentence mean that someone DID do a speed comparison? I did provide Language Shootout link in the next paragraph of the post you referred to along with an obligatory caution about interpreting benchmarks. The Language Shootout is a

Re: Unix diff command under Window.

2005-08-25 Thread Max M
TonyHa wrote: Hello, Does any one have using Python to write a Unix diff command for Window? I generally just us the diff built into tortoiseSVN. That way it's only a rightclick away. -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science --

Re: Unix diff command under Window.

2005-08-25 Thread Thomas Heller
Trent Mick [EMAIL PROTECTED] writes: [Neil Hodgson wrote] Thomas Heller: Yes. There's a script in your Python distribution: Tools/scripts/diff.py See also the docs for the 'difflib' standard library module. Is the opposite code, a Python equivalent to 'patch' available? I

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Mark Dickinson
In article [EMAIL PROTECTED], Bill Mill [EMAIL PROTECTED] wrote: I'm also pretty sure I've caught a bug in his code, though I'm not sure how it works exactly. I replaced the 'min' built-in with my own min, and he's going to get nondeterministic results from this line: mm =

Re: variable hell

2005-08-25 Thread Ron Garret
In article [EMAIL PROTECTED], Robert Kern [EMAIL PROTECTED] wrote: In the bowels of my modules, I may not know what the contents are at code-time, Then how do you write your code? rg -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-08-25 Thread usenet
In comp.lang.perl.misc John Bokma [EMAIL PROTECTED] wrote: the argument that usenet should never change seems a little heavy-handed and anachronistic. No, simple since there *are* alternatives: web based message boards. Those alternatives *do* support HTML formatting (often the subset

Re: New Arrival to Python

2005-08-25 Thread calfdog
I have been using Eclispe IDE with the PyDev plugin for Python Development. it allow you to set up projects. you can use PyAnt to build them. It works great for me. It's free an easy to use. Eclipse is at http://www.eclipse.org There is also Emacs with the python plugin Rob M. python project

Re: Jargons of Info Tech industry

2005-08-25 Thread Ulrich Hobelmann
[EMAIL PROTECTED] wrote: In comp.lang.perl.misc John Bokma [EMAIL PROTECTED] wrote: the argument that usenet should never change seems a little heavy-handed and anachronistic. No, simple since there *are* alternatives: web based message boards. Those alternatives *do* support HTML formatting

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Raymond Hettinger
Mark Dickinson wrote: I have a simple 192-line Python script that begins with the line: dummy0 = 47 The script runs in less than 2.5 seconds. The variable dummy0 is never referenced again, directly or indirectly, by the rest of the script. Here's the surprise: if I remove or comment out

Re: variable hell

2005-08-25 Thread Reinhold Birkenfeld
rafi wrote: Adriaan Renting wrote: You might be able to do something along the lines of for count in range(0,maxcount): value = values[count] exec(eval('a%s=%s' % (count, value))) why using the eval? exec ('a%s=%s' % (count, value)) should be fine And this demonstrates why

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread rafi
Stelios Xanthakis wrote: Mark Dickinson wrote: I have a simple 192-line Python script that begins with the line: dummy0 = 47 The script runs in less than 2.5 seconds. The variable dummy0 is never referenced again, directly or indirectly, by the rest of the script. Here's the surprise:

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread MrJean1
Two observations: 1 - The difference in run time with and without the dummy* globals is due to a difference in the number of invokations of the search() function: 1,140 resp. 27,530 in my environment. To verify, just change the line def search(): to searches = 0 def search():

Re: variable hell

2005-08-25 Thread rafi
Reinhold Birkenfeld wrote: exec(eval('a%s=%s' % (count, value))) why using the eval? exec ('a%s=%s' % (count, value)) should be fine And this demonstrates why exec as a statement was a mistake ;) It actually is exec 'a%s=%s' % (count, value) Noted. In the meantime another question

Re: variable hell

2005-08-25 Thread Robert Kern
Ron Garret wrote: In article [EMAIL PROTECTED], Robert Kern [EMAIL PROTECTED] wrote: In the bowels of my modules, I may not know what the contents are at code-time, Then how do you write your code? With style. ;-) I use a Bunch where I might otherwise use a dictionary inside my modules

Re: variable hell

2005-08-25 Thread Robert Kern
rafi wrote: In the meantime another question I cannot find an answer to: any idea why does eval() consider '=' as a syntax error? eval ('a=1') Traceback (most recent call last): File stdin, line 1, in ? File string, line 1 a=1 ^ SyntaxError: invalid syntax eval

minimalist regular expression

2005-08-25 Thread [EMAIL PROTECTED]
Exists some tool, programs or some able to compute the minimal regular expression, namely ,taking a series of regular exoression, the minimal one that makes the same matching? thanx in advance -- http://mail.python.org/mailman/listinfo/python-list

Re: variable hell

2005-08-25 Thread Steve Holden
rafi wrote: Reinhold Birkenfeld wrote: exec(eval('a%s=%s' % (count, value))) why using the eval? exec ('a%s=%s' % (count, value)) should be fine And this demonstrates why exec as a statement was a mistake ;) It actually is exec 'a%s=%s' % (count, value) Noted. In the meantime

Re: Suppressing checking of modules with pychecker

2005-08-25 Thread MrJean1
FWIIW, We use PyChecker all the time with Python files using importing wx plus wx.grid or wx.stc, etc. and the run times vary between 5 and 15 seconds. This is Python 2.4 with wxPython 2.4.2.4 and RedHat Fedora Core 2 Linux running on a 1.2 GHz Pentium 4 M laptop. /Jean Brouwers --

ANN: SPE 0.7.5.c: Improved documentation bugfixes

2005-08-25 Thread SPE - Stani's Python Editor
With special thanks to Dimitri Pater to contribute his documenation from http://www.serpia.com and Nir Aides for the documentation about the debugger. Also thanks to all Mac donors who bring real Mac support for SPE more and more close. For more info visit the homepage. Stani Spe is a free

Jargons of Info Tech industry

2005-08-25 Thread Alexander Zatvornitskiy
Привет Xah! 11 aug 2005 at 18:23, Xah Lee wrote: XL Jargons of Info Tech industry XL (A Love of Jargons) XL Xah Lee, 2002 Feb XL People in the computing field like to spur the use of spurious ...skipped... Look at this site for some info: http://lleo.aha.ru/na/en Alexander, [EMAIL

Re: variable hell

2005-08-25 Thread rafi
Steve Holden wrote: Because eval() takes an expression as an argument, and assignment is a statement. I am definitely not a language lawyer... but I should a little bit more thanks, -- rafi Imagination is more important than knowledge. (Albert

Re: New Arrival to Python

2005-08-25 Thread Luis M. Gonzalez
Windows Apps: Since you said professional looking applications, I assume you mean graphical interfaces (windows - GUI): If so, I recomend PythonCard ( http://pythoncard.sourceforge.net/ ). It is very easy to use, very similar to Visual Basic or Delphi (drag and drop widgets on a form...). Web

Re: New Arrival to Python

2005-08-25 Thread Luis M. Gonzalez
Windows Apps: Since you said professional looking applications, I assume you mean graphical interfaces (windows - GUI): If so, I recomend PythonCard ( http://pythoncard.sourceforge. net/ ). It is very easy to use, very similar to Visual Basic or Delphi (drag and drop widgets on a form...). Web

Re: Filetypes in email attachments.

2005-08-25 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: I would like to use the magic file to detect the filetype, if this is possible. I have the attachement stored and (generally) decoded in a variable. There is a Python binding to the libmagic library, see http://mx.gw.com/pipermail/file/2003/55.html Meanwhile,

Re: minimalist regular expression

2005-08-25 Thread Trent Mick
[EMAIL PROTECTED] wrote] Exists some tool, programs or some able to compute the minimal regular expression, namely ,taking a series of regular exoression, the minimal one that makes the same matching? def get_minimal_regex(*regexes): return .* :) Or, slightly less smart-ass-y:

Re: Limited XML tidy

2005-08-25 Thread uche . ogbuji
The problem is that when the sax handler raises an exception, I can't see how to find out why. What I want to do is for DodgyErrorHandler to do something different depending on where we are in the course of parsing. Is there anyway to get that information back from xml.sax (or indeed from any

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Claudio Grondi
I've learnt my lesson :) Thank you for your help, and apologies for wasting other people's time with this as well as my own! I've learnt my lesson reading through this thread, too. I am glad to be given the chance of wasting my time with it and very happy and thankful, that you posted your

pre-PEP: Object-oriented file module

2005-08-25 Thread Kenneth McDonald
I'd like to propose a new PEP [no, that isn't a redundant 'process' in there :-)--pre-PEP is a different process than PEP], for a standard library module that deals with files and file paths in an object oriented manner. I believe this module should be included as part of the standard

Re: minimalist regular expression

2005-08-25 Thread [EMAIL PROTECTED]
very nice -- http://mail.python.org/mailman/listinfo/python-list

a dummy python question

2005-08-25 Thread Learning Python
A example in learning Python by Mark Lutz and David Ascher about function scope example like this: def outer(x): def inner(i): print i, if i: inner(i-1) inner(x) outer(3) Here supposely, it should report error, because the function inner cannot see itself since inner

Re: Jargons of Info Tech industry

2005-08-25 Thread Rich Teer
On Thu, 25 Aug 2005, Ulrich Hobelmann wrote: CSS sheet. If things were that way, suddenly people *would* use Outlook No no no! Let's keep those Outhouse lusers away from Usenet. There's tto much top posting as it is! -- Rich Teer, SCNA, SCSA, OpenSolaris CAB member President, Rite Online

Re: Jargons of Info Tech industry

2005-08-25 Thread John Bokma
[EMAIL PROTECTED] wrote: In comp.lang.perl.misc John Bokma [EMAIL PROTECTED] wrote: the argument that usenet should never change seems a little heavy-handed and anachronistic. No, simple since there *are* alternatives: web based message boards. Those alternatives *do* support HTML

Usenet, HTML (was Re: Jargons of Info Tech industry)

2005-08-25 Thread John Bokma
Ulrich Hobelmann [EMAIL PROTECTED] wrote: On the information side (in contrast to the discussion side) RSS is replacing Usenet, LOL, how? I can't post to RSS feeds. Or do you mean for lurkers? There is no real reason why NNTP couldn't be used like RSS (i.e. contain a small description and

Re: minimalist regular expression

2005-08-25 Thread John Bokma
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Exists some tool, programs or some able to compute the minimal regular expression, namely ,taking a series of regular exoression, the minimal one that makes the same matching? thanx in advance length? (define minimal) :-D. -- John

Re: a dummy python question

2005-08-25 Thread infidel
Learning Python wrote: A example in learning Python by Mark Lutz and David Ascher about function scope example like this: def outer(x): def inner(i): print i, if i: inner(i-1) inner(x) outer(3) Here supposely, it should report error, because the function

Re: a dummy python question

2005-08-25 Thread [EMAIL PROTECTED]
This is not reproducible under either Python 2.3.4 (UNIX), Python 2.4.1 (UNIX) or Python 2.4.1 (Windows). If you still need help, we need to know precisely what you're doing. = scope_test.py = #!/usr/bin/env python # # (insert his code, verbatim...) # if __name__=='__main__':

MacPython 2.2 on Mac OS X 10.3.8 - configurePython error

2005-08-25 Thread Paul Miller
I have a user who is is having trouble getting MacPython on his OS X 10.3.8 system. When he runs ConfigurePythonCarbon, he gets this error: [terminated] 'import site' failed; use -v for traceback traceback )most recent call last): File Moes:SWdev:Jack:Python2.2:Mac:script:configurePython.py,

Re: New Arrival to Python

2005-08-25 Thread [EMAIL PROTECTED]
1. Whichever one works best for you, of course. :) There are lots of editors and IDEs out there. I find myself coming back to Emacs and jEdit the most, but there are a sizable number of vi partisans (benighted heathens tho they be) and an increasing number of Eclipse, Wing and Komodo

Re: a dummy python question

2005-08-25 Thread rafi
Learning Python wrote: def outer(x): def inner(i): print i, if i: inner(i-1) inner(x) outer(3) Here supposely, it should report error, because the function inner cannot see itself since inner is only in local namespace of outer. There is no error. the

Re: a dummy python question

2005-08-25 Thread Robert Kern
infidel wrote: Learning Python wrote: A example in learning Python by Mark Lutz and David Ascher about function scope example like this: def outer(x): def inner(i): print i, if i: inner(i-1) inner(x) outer(3) Here supposely, it should report error, because the

Re: pickle.load not working?

2005-08-25 Thread [EMAIL PROTECTED]
I get it, I missed the little parintheses or however you spell it. () . -- http://mail.python.org/mailman/listinfo/python-list

Re: a dummy python question

2005-08-25 Thread Learning Python
Thanks all for replying. I finally know what's going on. -- http://mail.python.org/mailman/listinfo/python-list

Re: MacPython 2.2 on Mac OS X 10.3.8 - configurePython error

2005-08-25 Thread Robert Kern
Paul Miller wrote: I have a user who is is having trouble getting MacPython on his OS X 10.3.8 system. When he runs ConfigurePythonCarbon, he gets this error: [terminated] 'import site' failed; use -v for traceback traceback )most recent call last): File

Embedding Python in other programs

2005-08-25 Thread Thomas Bartkus
Name: lib64python2.4-devel Summary: The libraries and header files needed for Python development Description: The Python programming language's interpreter can be extended with dynamically loaded extensions and can be embedded in other programs. This package contains the header files and

Re: pre-PEP: Object-oriented file module

2005-08-25 Thread Martin v. Löwis
Kenneth McDonald wrote: I'd like to propose a new PEP [no, that isn't a redundant 'process' in there :-)--pre-PEP is a different process than PEP], for a standard library module that deals with files and file paths in an object oriented manner. I believe this module should be included as

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing, was Re: Bug in slice type

2005-08-25 Thread Bryan Olson
Steve Holden asked: Do you just go round looking for trouble? In the course of programming, yes, absolutly. As far as position reporting goes, it seems pretty clear that find() will always report positive index values. In a five-character string then -1 and 4 are effectively equivalent.

Re: pre-PEP: Object-oriented file module

2005-08-25 Thread Kenneth McDonald
Why would any of the issues below be any more difficult than they are withthe current file functions? I'm not proposing a C replacement for currentfunctions, merely a Python module that wraps all of those functions (andadds some additional ones) in an appropriate class.On Aug 25, 2005, at 5:28 PM,

Re: pre-PEP: Object-oriented file module

2005-08-25 Thread Martin v. Löwis
Kenneth McDonald wrote: Why would any of the issues below be any more difficult than they are with the current file functions? I'm not proposing a C replacement for current functions, merely a Python module that wraps all of those functions (and adds some additional ones) in an appropriate

Re: Anyone recognize this numeric storage format - similar to float, but not quite

2005-08-25 Thread geskerrett
I am not sure if you are still watching this thread, but I seem to have a bit of a problem with the code sample you so graciously provided. It seems to work in all instances, except the original example I provided (namely, 1234567890). On my system, the number 1234567890, gets converted to

Re: variable hell

2005-08-25 Thread Ron Garret
In article [EMAIL PROTECTED], Steve Holden [EMAIL PROTECTED] wrote: rafi wrote: Reinhold Birkenfeld wrote: exec(eval('a%s=%s' % (count, value))) why using the eval? exec ('a%s=%s' % (count, value)) should be fine And this demonstrates why exec as a statement was a mistake

wanna stop by my homemade glory hole?

2005-08-25 Thread Casee
my husband is installing an extra bathroom poolside. there is a perfect size hole (unless you have a huge cock) to stick your dick through into the adjoing room. come around the side of my house(perfect if you look like a repair man) enter into the unfisnished bathroom and I'll service you

argument matching question

2005-08-25 Thread Learning Python
I know this is dummy, just never saw an example of this. I want to use the special argument matching. A code like this: def adder(**varargs): sum=varargs[varargs.keys()[0]] for next in varargs.keys()[1:]: sum=sum+varargs[next] return sum print adder(

Re: argument matching question

2005-08-25 Thread Leif K-Brooks
Learning Python wrote: A code like this: def adder(**varargs): sum=varargs[varargs.keys()[0]] for next in varargs.keys()[1:]: sum=sum+varargs[next] return sum print adder( first,second,'third') How to pass arguments to a functions that use dictionary

Re: argument matching question

2005-08-25 Thread Learning Python
thanks, got it. I want to test the **name option for argument matching. -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-08-25 Thread Mike Meyer
Mike Schilling [EMAIL PROTECTED] writes: Another advantage is that evewry internet-enabled computer today already comes with an HTML renderer (AKA browser) No, they don't. Minimalist Unix distributions don't include a browser by default. I know the BSD's don't, and suspect that gentoo Linux

Re: variable hell

2005-08-25 Thread Nx
Thanks for all the responses and animated discussion, which is still the best way to learn something new. Most of the time it is not that you want to do something in a certain way , it rather is one cannot think of a better , faster more efficient way . Nx --

Re: Jargons of Info Tech industry

2005-08-25 Thread Paul Rubin
Mike Meyer [EMAIL PROTECTED] writes: Another advantage is that evewry internet-enabled computer today already comes with an HTML renderer (AKA browser) No, they don't. Minimalist Unix distributions don't include a browser by default. I know the BSD's don't, and suspect that gentoo Linux

Re: Jargons of Info Tech industry

2005-08-25 Thread John Bokma
Paul Rubin http://[EMAIL PROTECTED] wrote: Mike Meyer [EMAIL PROTECTED] writes: Another advantage is that evewry internet-enabled computer today already comes with an HTML renderer (AKA browser) No, they don't. Minimalist Unix distributions don't include a browser by default. I know the

Re: Jargons of Info Tech industry

2005-08-25 Thread Gordon Burditt
HTML is designed to degrade gracefully (never mind that most web authors and many browser developers don't seem to comprehend this), so you don't really need a subset html to get the safety features you want. All you need to do is disable the appropriate features in the HTML renderer in your news

Re: Jargons of Info Tech industry

2005-08-25 Thread Chris Head
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] wrote: [snip] ... and generally these web based message boards (i.e. forums I assume you mean) have none of the useful tools that Usenet offers and are much, much slower. [snip] Arrgh, I *emphatically* *hate* Web-based-(almost

Re: Jargons of Info Tech industry

2005-08-25 Thread BJ Swope
So says Chris from his webmail account... On 8/25/05, Chris Head [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] wrote: [snip] ... and generally these web based message boards (i.e. forums I assume you mean) have none of the useful tools that

Re: Jargons of Info Tech industry

2005-08-25 Thread CBFalconer
Chris Head wrote: ... snip ... Why can't we use the Web for what it was meant for: viewing hypertext pages? Why must we turn it into a wrapper around every application imaginable? Because the Lord High PoohBah (Bill) has so decreed. He has replaced General bullMoose. -- Chuck F ([EMAIL

<    1   2   3   >