ANN: Vancouver Python Workshop - keynote speakers announced

2006-05-19 Thread Brian Quinlan
What's New? === We are pleased to announce the keynote speakers for this year's Vancouver Python Workshop: Guido van Rossum and Jim Hugunin. Guido van Rossum (Google) is the inventor of Python and has managed its growth and development for more than a decade. Guido was awarded the Free

Reminder: call for proposals Python Language and Libraries Track for Europython 2006

2006-05-19 Thread Samuele Pedroni
Registration for Europython (3-5 July) at CERN in Geneva is now open, if you feel submitting a talk proposal there's still time until the 31th of May. If you want to talk about a library you developed, or you know well and want to share your knowledge, or about how you are making the best out of

released: RPyC 2.60

2006-05-19 Thread sebulba
Remote Python Call (RPyC) 2.60 has been released. changelog: * added: __version__ to the package (i.e., assert Rpyc.__version__ (2,50)) * added deliver, the counterpart of obtain() * deliver and obtain now support transfering functions * added DeliveringNamespace * added

Re: import woe

2006-05-19 Thread Serge Orlov
[EMAIL PROTECTED] wrote: hello, i have a problem. i would like to import python files above and below my current directory. i'm working on /home/foo/bar/jar.py i would like to import /home/foo/car.py and /home/foo/bar/far.py how can i do this? $ cat ~/.bashrc

Re: number of different lines in a file

2006-05-19 Thread Fredrik Lundh
r.e.s. wrote: BTW, the first thing I tried was Fredrik Lundh's program: def number_distinct(fn): return len(set(s.strip() for s in open(fn))) which worked without the square brackets. Interesting that omitting them doesn't seem to matter. a for loop inside square brackets is a

Re: newb: comapring two strings

2006-05-19 Thread Peter Otten
manstey wrote: Is there a clever way to see if two strings of the same length vary by only one character, and what the character is in both strings. E.g. str1=yaqtil str2=yaqtel they differ at str1[4] and the difference is ('i','e') But if there was str1=yiqtol and str2=yaqtel, I am

Re: Which is More Efficient?

2006-05-19 Thread Fredrik Lundh
Dustan wrote: Obviously it takes a geek to know you have to time it, as opposed to any other task you could be talking about. wasn't the original question my program uses a lot of CPU, and I want to make it more efficient ? what does a lot of CPU and more efficient mean to you, and how do

Re: import woe

2006-05-19 Thread vaibhav
Hi bob, 1. decide the directory which will be your root folder containing foo [/home/ROOT/foo/] 2. work out your directory structure relative to this root folder here it is -ROOT-foo-car.py -bar-far.py -bar-jar.py 3. add

Getting URL's

2006-05-19 Thread defcon8
How do I get all the URL's in a page? -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting URL's

2006-05-19 Thread Ju Hui
use htmlparser or regular expression -- http://mail.python.org/mailman/listinfo/python-list

Re: Tabs are *MISUNDERSTOOD*, *EVIL* AND *STUPID*, end of discussion. (Re: Tabs versus Spaces in Source Code)

2006-05-19 Thread PoD
On Thu, 18 May 2006 08:30:03 +, Duncan Booth wrote: PoD wrote: How many levels of indentation does 12 spaces indicate? It could be 1,2,3,4,6 or 12. If you say it's 3 then you are _implying_ that each level is represented by 4 spaces. By reading the code I can see how many levels of

Re: who can give me the detailed introduction of re modle?

2006-05-19 Thread Gary Herron
softwindow wrote: the re module is too large and difficult to study i need a detaild introduction. That's not the kind of question that's likely to get a useful response from an all volunteer newsgroup community, even one with as friendly a reputations as this one. Here's my suggestion:

Re: Tabs are *MISUNDERSTOOD*, *EVIL* AND *STUPID*, end of discussion. (Re: Tabs versus Spaces in Source Code)

2006-05-19 Thread PoD
On Thu, 18 May 2006 10:33:58 +0200, Christophe wrote: PoD a écrit : On Wed, 17 May 2006 21:37:14 +0800, Andy Sy wrote: If tabs are easily misunderstood, then they are a MISfeature and they need to be removed. From the Zen of Python: Explicit is better than implicit... In the face of

Re: Getting URL's

2006-05-19 Thread defcon8
Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting URL's

2006-05-19 Thread Paul McGuire
defcon8 [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] How do I get all the URL's in a page? pyparsing comes with a simple example that does this, too. -- Paul Download pyparsing at http://sourceforge.net/projects/pyparsing -- http://mail.python.org/mailman/listinfo/python-list

Re: Script to make Windows XP-readable ZIP file

2006-05-19 Thread John Bokma
softwindow [EMAIL PROTECTED] wrote: Carl Banks is right Did he write to check out: http://groups.google.com/support/bin/answer.py?answer=14213 ? Why didn't you do so? -- John MexIT: http://johnbokma.com/mexit/ personal page:

Re: who can give me the detailed introduction of re modle?

2006-05-19 Thread vaibhav
easy and convenient way to get a good introduction for any module [especially if ur stuck and dont have internet connectivity]: 1. start python interpreter $ python 2. import the module and ask it for help :-) import re help(re) -vaibhav --

Re: who can give me the detailed introduction of re modle?

2006-05-19 Thread softwindow
thanks for your advice! :) -- http://mail.python.org/mailman/listinfo/python-list

Re: WTF? Printing unicode strings

2006-05-19 Thread Ron Garret
In article [EMAIL PROTECTED], Serge Orlov [EMAIL PROTECTED] wrote: Ron Garret wrote: I'm using an OS X terminal to ssh to a Linux machine. In theory it should work out of the box. OS X terminal should set enviromental variable LANG=en_US.utf-8, then ssh should transfer this

Re: Tabs are *MISUNDERSTOOD*, *EVIL* AND *STUPID*, end of discussion. (Re: Tabs versus Spaces in Source Code)

2006-05-19 Thread Duncan Booth
PoD wrote: I think it is universally accepted that mixed tabs and spaces is indeed **EVIL** I should have said any code using tabs exclusively. Can you point at any significant body of publically visible Python code which uses tabs exclusively? All of the Python projects I've ever been

Re: Tkinter Dialog Management problems:

2006-05-19 Thread Eric Brunel
On Thu, 18 May 2006 11:52:54 -0400, Michael Yanowitz [EMAIL PROTECTED] wrote: Thanks. That helped alot. No problem. However it leaves a couple very minor problems which I think I can live with. 1) It brings up an empty additional 'main window'. I have tried using the

Re: Complex evaluation bug

2006-05-19 Thread Christophe
Gary Herron a écrit : of wrote: a = 1+3j complex(str(a)) Why does this not work ? It should Says who? By normal conventions in Python, str attempts only to make a nice human readable representation. The function repr is usually expected to provide output that can be parsed back

Re: Tabs are *MISUNDERSTOOD*, *EVIL* AND *STUPID*, end of discussion. (Re: Tabs versus Spaces in Source Code)

2006-05-19 Thread Christophe
PoD a écrit : Maybe what Python should do (but never will given the obsession with using spaces) is only allow one level of indentation increase per block so that def foo(): TABTABreturn 'bar' would return a syntax error Which would make TAB mandatory for indentation. What about some

Re: Getting URL's

2006-05-19 Thread softwindow
it is difficult to get all URL's in a page you can use sgmllib module to parse html files can get the standard href . -- http://mail.python.org/mailman/listinfo/python-list

Re: Complex evaluation bug

2006-05-19 Thread Fredrik Lundh
Christophe wrote: So, putting them together, you could expect eval(repr(a)) to reproduce a, and in fact it does so. Says who ? Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. repr(1+3j)

Re: Complex evaluation bug

2006-05-19 Thread Christophe
Fredrik Lundh a écrit : Christophe wrote: So, putting them together, you could expect eval(repr(a)) to reproduce a, and in fact it does so. Says who ? Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 Type help, copyright, credits or license for more

Re: Tabs are *MISUNDERSTOOD*, *EVIL* AND *STUPID*, end of discussion. (Re: Tabs versus Spaces in Source Code)

2006-05-19 Thread Sybren Stuvel
Duncan Booth enlightened us with: Can you point at any significant body of publically visible Python code which uses tabs exclusively? Everything Python at http://www.stuvel.eu/software Also, in the open source universe you are quite likely to pull in bits of code from other projects, and

Re: who can give me the detailed introduction of re modle?

2006-05-19 Thread Simon Brunning
On 18 May 2006 22:50:24 -0700, softwindow [EMAIL PROTECTED] wrote: the re module is too large and difficult to study i need a detaild introduction. http://gnosis.cx/publish/programming/regular_expressions.html -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/

Re: Opensource vs Microsoft, Wat do you think about opensource?

2006-05-19 Thread Sybren Stuvel
Ben Finney enlightened us with: Please don't spam here to ask for discussion on another forum, on a tangentially related topic. Hey, it's at least better than asking for a discussion on a tangentially related topic _here_ ;-) Sybren -- The problem with the world is stupidity. Not saying there

Re: Newbie append() question

2006-05-19 Thread Sybren Stuvel
Brian Blazer enlightened us with: def getCurrentClasses(): classes = [] print 'Please enter the class name. When finished enter D.' while (c != D): No need for the parentheses, and 'c' doesn't have a value yet. If you add 'c=' before the while-loop, it should be

Segmenting a pickle stream without unpickling

2006-05-19 Thread Boris Borcic
Assuming that the items of my_stream share no content (they are dumps of db cursor fetches), is there a simple way to do the equivalent of def pickles(my_stream) : from cPickle import load,dumps while 1 : yield dumps(load(my_stream)) without the overhead associated with

Re: galaxql

2006-05-19 Thread Steve Holden
Further to my recent mention of galaxql as a SQL learning tool, I had the following feedback through holdenweb.com: Below is the result of your feedback form. It was submitted by jari komppa ([EMAIL PROTECTED]) on Friday, May 19, 2006 at 00:07:53

ftplib.ftpcp(), undocumented function?

2006-05-19 Thread swordsp
Hi all, I found this function recently when I read the source code of ftplib module, I almost omit it at all and have tried to write it myself for FXP work. It seems exist long long ago, but never appeared in any document, anyone knows why? Is its implementation broken or planed to be removed

Re: WTF? Printing unicode strings

2006-05-19 Thread Serge Orlov
Ron Garret wrote: In article [EMAIL PROTECTED], Serge Orlov [EMAIL PROTECTED] wrote: Ron Garret wrote: I'm using an OS X terminal to ssh to a Linux machine. In theory it should work out of the box. OS X terminal should set enviromental variable LANG=en_US.utf-8, then ssh

Re: Question about exausted iterators

2006-05-19 Thread Christophe
Terry Reedy a écrit : Christophe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Instead of saying that all works as intended could you be a little helpful and tell me why it was intended in such an obviously broken way instead ? I answered both your explicit and implied

Re: Segmenting a pickle stream without unpickling

2006-05-19 Thread Paul Rubin
Boris Borcic [EMAIL PROTECTED] writes: def pickles(my_stream) : from cPickle import load,dumps while 1 : yield dumps(load(my_stream)) without the overhead associated with unpickling objects just to pickle them again ? I think you'd have to write something special. The

Specific performance question - Python vs. Java

2006-05-19 Thread reinsn
Hi, I have got a specific question on performance: Is the overhead of object creation in Python lower than in Java? I mean, I would argue, in Java by object creation, the complete class is the model and all methods and attributes are generated for the object. In Python, methods and objects are

Re: Programming language productivity

2006-05-19 Thread malv
John Bokma wrote: Connelly Barnes [EMAIL PROTECTED] wrote: http://barnesc.blogspot.com/2006/05/programming-language-productivity.h tml C:3 hours to write the program, 5 hours to track down the memory leaks Java: 4 hours to write the program, 6 hours to get all the exception

Re: Specific performance question - Python vs. Java

2006-05-19 Thread Diez B. Roggisch
reinsn wrote: Hi, I have got a specific question on performance: Is the overhead of object creation in Python lower than in Java? I mean, I would argue, in Java by object creation, the complete class is the model and all methods and attributes are generated for the object. In Python,

calling python functions using variables

2006-05-19 Thread creo
Hi all! this is a (relatively) newbie question I am writing a shell in Python and I am facing a problem The problem is, after taking the input from user, i have to execute the command which is a python function i invoke an 'ls' command like this commands.ls() where commands.py is a

Re: Windows Registry Dump

2006-05-19 Thread Dirk Hagemann
@Diez: I'm not trying to hack into somebody's computer - it is about collecting data from my company's anti-virus-parent-server. And all the information is only available in the registry (thanks Symantec...). @Tim, olso and Fredrik: THANKS - I will have a closer look at these modules. regards

Re: calling python functions using variables

2006-05-19 Thread Peter Otten
creo wrote: i invoke an 'ls' command like this commands.ls() where commands.py is a file in the same directory what i want to do is commands.VARIABLE() where VARIABLE holds the name of the function which i want to execute and depends on what the user has typed You want

RE: Windows Registry Dump

2006-05-19 Thread Tim Golden
[Dirk Hagemann] | @Diez: I'm not trying to hack into somebody's computer - it is about | collecting data from my company's anti-virus-parent-server. | And all the | information is only available in the registry (thanks Symantec...). | | @Tim, olso and Fredrik: THANKS - I will have a closer look

how to read a list from python in C?

2006-05-19 Thread Lialie KingMax
Hi, all I am writing a C extension with .Net. Now I have a list of points, like [(0.0, 0.0), (2.0, 3.0), (random x, random y)]. Is there a better way to translate it to an array than doing it one by one? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: calling python functions using variables

2006-05-19 Thread Ben Finney
Peter Otten [EMAIL PROTECTED] writes: creo wrote: what i want to do is commands.VARIABLE() where VARIABLE holds the name of the function which i want to execute and depends on what the user has typed You want getattr(commands, VARIABLE)() You'll also need to anticipate the

Re: who can give me the detailed introduction of re modle?

2006-05-19 Thread Kent Johnson
softwindow wrote: the re module is too large and difficult to study i need a detaild introduction. http://www.amk.ca/python/howto/regex/ Kent -- http://mail.python.org/mailman/listinfo/python-list

Python and Test Driven Development

2006-05-19 Thread Diego Torres Milano
First part of a series of articles about Python and Test Driven Development can be found at http://dtmilano.blogspot.com/2006/05/python-and-test-driven-development.html. These articles include some scripts to ease automatic test suite creation in Python. Comments are gladly welcome. --

Re: Windows Registry Dump

2006-05-19 Thread Dirk Hagemann
Hi Tim! I want to do some analysis (as always ;-) ) and for that reason I think it's more practical to go trough a text-file. I can produce this text-file also by right-click on the key (the folder) in the registry and select Export. There one can select Text-File and the place where to save the

RE: Windows Registry Dump

2006-05-19 Thread Tim Golden
[Dirk Hagemann] | I want to do some analysis (as always ;-) ) and for that | reason I think | it's more practical to go trough a text-file. I can produce this | text-file also by right-click on the key (the folder) in the registry | and select Export. There one can select Text-File and the |

Re: calling python functions using variables

2006-05-19 Thread bruno at modulix
Ben Finney wrote: Peter Otten [EMAIL PROTECTED] writes: (snip) You want getattr(commands, VARIABLE)() You'll also need to anticipate the situation where the value bound to VARIABLE is not the name of an attribute in 'commands'. Either deal with the resulting NameError exception (EAFP[0])

Re: who can give me the detailed introduction of re modle?

2006-05-19 Thread bruno at modulix
softwindow wrote: the re module is too large and difficult to study Too bad. i need a detaild introduction. That's fine. Then write it. Or pay someone to do so. Just for the record : that's the only answers you would have get on most usenet groups. Hopefully, c.l.py is a very friendly and

Re: Which is More Efficient?

2006-05-19 Thread Dustan
Fredrik Lundh wrote: Dustan wrote: Obviously it takes a geek to know you have to time it, as opposed to any other task you could be talking about. wasn't the original question my program uses a lot of CPU, and I want to make it more efficient ? what does a lot of CPU and more efficient

Re: Which is More Efficient?

2006-05-19 Thread Dustan
Dustan wrote: Fredrik Lundh wrote: Dustan wrote: Obviously it takes a geek to know you have to time it, as opposed to any other task you could be talking about. wasn't the original question my program uses a lot of CPU, and I want to make it more efficient ? what does a lot of

Encode exception for chinese text

2006-05-19 Thread Vinayakc
Hi all, I am new to python. I have written one small application which reads data from xml file and tries to encode data using apprpriate charset. I am facing problem while encoding one chinese paragraph with charset gb2312. code is: encoded_str = str_data.encode(gb2312) The type of str_data

Re: Newbie append() question

2006-05-19 Thread Brian Blazer
Thanks guys. Your solutions worked. I'm still not sure why it was grabbing the prompt string though. Thanks again, Brian [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Encode exception for chinese text

2006-05-19 Thread swordsp
Are you sure all the characters in original text are in gb2312 charset? Encoding with utf8 seems work for this character (u'\xa0'), but I don't know if the result is correct. Could you give a subset of str_data in unicode? -- http://mail.python.org/mailman/listinfo/python-list

Re: WTF? Printing unicode strings

2006-05-19 Thread Serge Orlov
Serge Orlov wrote: Ron Garret wrote: In article [EMAIL PROTECTED], Serge Orlov [EMAIL PROTECTED] wrote: Ron Garret wrote: I'm using an OS X terminal to ssh to a Linux machine. In theory it should work out of the box. OS X terminal should set enviromental variable

Re: Question about exausted iterators

2006-05-19 Thread [EMAIL PROTECTED]
Consider this example: X = range(5) Y = iter(X) Z = iter(Y) As you can see, X is a container, and Y is an iterator. They are simliar in that iter works on them both. Cristoph claims that this causes confusion. Why? Because iter doesn't have the same meaning for both of them. For X it always

Re: newb: comapring two strings

2006-05-19 Thread John Machin
Use the levenshtein distance. Given the constraint that the two strings are the same length, I'm assuming (as other posters appear to have done) that vary by only one character precludes insertion and deletion operations. In that case, the problem can be solved in O(n) time by a simple loop

memory error with zipfile module

2006-05-19 Thread Hari Sekhon
I do import zipfile zip=zipfile.ZipFile('d:\somepath\cdimage.zip') zip.namelist() ['someimage.iso'] then either of the two: A) file('someimage.iso','w').write(zip.read('someimage.iso')) or B) content=zip.read('someimage.iso') but both result in the same error: Traceback (most recent call

Re: Which is More Efficient?

2006-05-19 Thread Max Erickson
Dustan [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: The task manager says CPU Usage: 100% when the program is running, and only when the program is running. Efficiency is a measure of 2 things: CPU usage and time. If you measure just time, you're not necessarily getting the

Re: Encode exception for chinese text

2006-05-19 Thread Serge Orlov
Vinayakc wrote: Hi all, I am new to python. I have written one small application which reads data from xml file and tries to encode data using apprpriate charset. I am facing problem while encoding one chinese paragraph with charset gb2312. code is: encoded_str =

How to append to a dictionary

2006-05-19 Thread Harlin Seritt
I have some code here: groups = {'IRISH' : 'green', 'AMERICAN' : 'blue'} I want to add another key: 'ITALIAN' : 'orange' How do I append this to 'groups'? Thanks, Harlin Seritt -- http://mail.python.org/mailman/listinfo/python-list

Re: How to append to a dictionary

2006-05-19 Thread Tim Chase
groups = {'IRISH' : 'green', 'AMERICAN' : 'blue'} I want to add another key: 'ITALIAN' : 'orange' How do I append this to 'groups'? groups['ITALIAN'] = 'orange' as described at http://docs.python.org/tut/node7.html#SECTION00750 -tkc --

Re: How to append to a dictionary

2006-05-19 Thread Sybren Stuvel
Harlin Seritt enlightened us with: I have some code here: groups = {'IRISH' : 'green', 'AMERICAN' : 'blue'} I want to add another key: 'ITALIAN' : 'orange' How do I append this to 'groups'? groups['ITALIAN'] = 'orange' Sybren -- The problem with the world is stupidity. Not saying there

Re: Newbie append() question

2006-05-19 Thread Sybren Stuvel
Brian Blazer enlightened us with: I'm still not sure why it was grabbing the prompt string though. Me neither. Try it in a standalone script instead of an interactive session. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but

Re: WTF? Printing unicode strings

2006-05-19 Thread Laurent Pointal
Ron Garret a écrit : In article [EMAIL PROTECTED], Fredrik Lundh [EMAIL PROTECTED] wrote: Ron Garret wrote: u'\xbd' u'\xbd' print _ Traceback (most recent call last): File stdin, line 1, in ? UnicodeEncodeError: 'ascii' codec can't encode character u'\xbd' in position 0: ordinal

Re: who can give me the detailed introduction of re modle?

2006-05-19 Thread gene tani
softwindow wrote: the re module is too large and difficult to study it's powerful, takes a little time to work with. Make yourself aware of the VERBOSE switch, RE debuggers in komodo and Wing, string functions/methods and when you need a full parser, also

Re: memory error with zipfile module

2006-05-19 Thread Ganesan Rajagopal
Hari Sekhon [EMAIL PROTECTED] writes: Traceback (most recent call last): File stdin, line 1, in ? File D:\u\Python24\lib\zipfile.py, line 357, in read bytes = dc.decompress(bytes) MemoryError Looks like the .iso file is huge. Even if it's only a CD image (approx 650MB), reading it

problem with import autotest ...

2006-05-19 Thread bravegag
Hi all, Please beware I am new to Python and have little experience with it. I have a script that works just fine on linux but when I try to debug from Windows using Eclipse and PyDEV plugin then it does not work. The Python version is the same 2.3.x , and command line is roughly the same. from

Re: Encode exception for chinese text

2006-05-19 Thread Vinayakc
Yes serge, I have removed the first character but it is still giving encoding exception. -- http://mail.python.org/mailman/listinfo/python-list

Re: Encode exception for chinese text

2006-05-19 Thread John Machin
1. *By definition*, you can encode *any* Unicode string into utf-8. Proves nothing. 2. \u00a0 [no-break space] has no equivalent in gb2312, nor in the later gbk alias cp936. It does have an equivalent in the latest Chinese encoding, gb18030. 3. gb2312 is outdated. It is not really an appropriate

Python sqlite and regex.

2006-05-19 Thread Julien ARNOUX
Hi, I'd like to use regular expressions in sqlite query, I using apsw module but it doesn't work...Can you help me ? My script: import apsw import re path = 'db/db.db3' #regexp function (extract from python-list discusion) def regexp(expr, item): reg = re.compile(expr) return

Re: memory error with zipfile module

2006-05-19 Thread bruno at modulix
Hari Sekhon wrote: I do import zipfile zip=zipfile.ZipFile('d:\somepath\cdimage.zip') zip.namelist() ['someimage.iso'] then either of the two: A) file('someimage.iso','w').write(zip.read('someimage.iso')) or B) content=zip.read('someimage.iso') but both result in the same

Re: Encode exception for chinese text

2006-05-19 Thread Serge Orlov
Vinayakc wrote: Yes serge, I have removed the first character but it is still giving encoding exception. Then I guess this character was used as a poor man indentation tool at least in the beginning of your text. It's up to you to decide what to do with that character, you have several choices:

Re: CFLAGS are not taken into account properly

2006-05-19 Thread Toon Knapen
[EMAIL PROTECTED] wrote: Toon But some other (but 'similar') functionality is broken. Now I Toon succeeded in compiling python. But when using distutils (e.g. when Toon installing numarray using the setup.py), python will compile the Toon files using the '-xarch=v9' option but

Re: Encode exception for chinese text

2006-05-19 Thread Vinayakc
Hey Serge, john, Thank you very much. I was really not aware of these facts. Anyways this is happening only for one in millions so I can ignore this for now. Thanks again, Vinayakc -- http://mail.python.org/mailman/listinfo/python-list

Re: Python sqlite and regex.

2006-05-19 Thread Dan Sommers
On Fri, 19 May 2006 14:47:10 +0200, Julien ARNOUX [EMAIL PROTECTED] wrote: cur.execute(select foo from test where foo regex 'aa.[0-9])) and the error is: cur.execute('select foo from test where foo regex tata') apsw.SQLError: SQLError: near regex: syntax error I think you're missing a

Re: Question about exausted iterators

2006-05-19 Thread Mel Wilson
[EMAIL PROTECTED] wrote: Consider this example: X = range(5) Y = iter(X) Z = iter(Y) As you can see, X is a container, and Y is an iterator. They are simliar in that iter works on them both. Cristoph claims that this causes confusion. Why? Because iter doesn't have the same meaning

noob import question

2006-05-19 Thread Brian Blazer
OK, I have a very simple class here: class Student: Defines the student class def __init__(self, lName, fName, mi): self.lName = lName self.fName = fName self.mi = mi Then I have a small script that I am using as a test: from Student import * s1 =

about py2exe, I installed it, but can't find py2exe.exe in my computer.

2006-05-19 Thread python
I installed it, but can't find py2exe.exe in my computer. why? And , when I execute python setup.py py2exe under command line, it prompt error:wrong command py2exe . -- http://mail.python.org/mailman/listinfo/python-list

Re: noob import question

2006-05-19 Thread Iain King
Brian Blazer wrote: OK, I have a very simple class here: class Student: Defines the student class def __init__(self, lName, fName, mi): self.lName = lName self.fName = fName self.mi = mi Then I have a small script that I am using as a test: from

Re: noob import question

2006-05-19 Thread Diez B. Roggisch
I have tried to look up what is going on, but I have not found anything. Would it be possible for someone to take a minute and give an explanation? The from module import *|nameslist syntax imports some or all names found in module into the current modules namespace. Thus you can access

Re: noob import question

2006-05-19 Thread Brian Blazer
Thank you for your responses. I had a feeling is had something to do with a namespace issue but I wasn't sure. You are right, I do come from a Java background. If it is poor form to name your class file the same as your class, can I ask what the standard is? Thanks again, Brian On May

Re: Programming language productivity

2006-05-19 Thread Harry George
malv [EMAIL PROTECTED] writes: [snip] Once you get involved in larger projects, the dynamic nature of the programming tool becomes much more important. I mean by this, the ability to stop running code, modify or add to it and continue without having to re-establish the state of the program.

Re: about py2exe, I installed it, but can't find py2exe.exe in my computer.

2006-05-19 Thread Fredrik Lundh
python wrote: I installed it, but can't find py2exe.exe in my computer. why? why are you looking for an EXE file? py2exe is a Python module, not an application. And , when I execute python setup.py py2exe under command line, it prompt error:wrong command py2exe . you're supposed to import

released: RPyC 2.60

2006-05-19 Thread gangesmaster
Remote Python Call (RPyC) has been released. this release introduces delivering objects, reducing memory consumption with __slots__, and several other new/improved helper functions. see the release notes and changelog (on the site) for more info. home: http://rpyc.wikispaces.com -tomer --

Re: noob import question

2006-05-19 Thread Diez B. Roggisch
Brian Blazer wrote: Thank you for your responses. I had a feeling is had something to do with a namespace issue but I wasn't sure. You are right, I do come from a Java background. If it is poor form to name your class file the same as your class, can I ask what the standard is? Consider

Re: Which is More Efficient?

2006-05-19 Thread Fredrik Lundh
Dustan wrote: The task manager says CPU Usage: 100% when the program is running, and only when the program is running. Efficiency is a measure of 2 things: CPU usage and time. If you measure just time, you're not necessarily getting the efficiency. are you for real? /F --

Re: noob import question

2006-05-19 Thread PA
On May 19, 2006, at 15:33, Diez B. Roggisch wrote: And it seems as if you have some JAVA-background, putting one class in one file called the same as the class. Don't do that, it's a stupid restriction in JAVA and should be avoided in PYTHON. Restrictive or not, what's so fundamentally

Re: Script to make Windows XP-readable ZIP file

2006-05-19 Thread Grant Edwards
On 2006-05-19, softwindow [EMAIL PROTECTED] wrote: Carl Banks is right That would be valuable information if we know what he was right about. -- Grant Edwards grante Yow! Bo Derek ruined at my life!

Re: calling python functions using variables

2006-05-19 Thread Grant Edwards
On 2006-05-19, bruno at modulix [EMAIL PROTECTED] wrote: Either deal with the resulting NameError exception (EAFP[0]) try: getattr(commands, VARIABLE)() except NameError: print sys.stderr, Unknown command, VARIABLE or test first whether the attribute exists (LBYL[1]). command =

Re: how to read a list from python in C?

2006-05-19 Thread skip
Lialie I am writing a C extension with .Net. Now I have a list of Lialie points, like [(0.0, 0.0), (2.0, 3.0), (random x, random y)]. Lialie Is there a better way to translate it to an array than doing it Lialie one by one? Are you passing a list as an argument to one of the

Re: noob import question

2006-05-19 Thread Fredrik Lundh
PA [EMAIL PROTECTED] wrote: Restrictive or not, what's so fundamentally devious in putting a class declaration in a separate file whose name is that of the declared class (class Queue - Queue.py)? nothing. Sounds like a handy way of organizing your code, no? sure, if you prefer to do

Re: python vs perl lines of code

2006-05-19 Thread Terry Hancock
Edward Elliott wrote: For inquiries into real-world code, it's enough to believe that I'm not lying Yeah, well, this is the internet -- I've gotten emails trying to sell me ex-soviet rocket-launchers and child porn.* So I don't make assumptions about people without some kind of evidence. There

Re: noob import question

2006-05-19 Thread bruno at modulix
Brian Blazer wrote: OK, I have a very simple class here: class Student: class Student(object): Defines the student class def __init__(self, lName, fName, mi): self.lName = lName self.fName = fName self.mi = mi Do yourself a favour: use meaningful

Re: memory error with zipfile module

2006-05-19 Thread [EMAIL PROTECTED]
Take a look at the pywin32 extension, which I believe has some lower level memory allocation and file capabilities that might help you in this situation. If I'm completely wrong, someone please tell me XD. Of course, you could just make the read() a step process, reading, O lets say 8192 bytes at

Re: Tabs are *MISUNDERSTOOD*, *EVIL* AND *STUPID*, end of discussion. (Re: Tabs versus Spaces in Source Code)

2006-05-19 Thread Dave Hansen
On 19 May 2006 07:18:03 GMT in comp.lang.python, Duncan Booth [EMAIL PROTECTED] wrote: [...] My experience of programming with either spaces or tabs has taught me that tabs are evil not for themselves, but simply because no matter how hard you try they always end up being mixed with spaces.

Re: the tostring and XML methods in ElementTree

2006-05-19 Thread Stefan Behnel
George Sakkis wrote: Fredrik Lundh wrote: [EMAIL PROTECTED] wrote: I wanted to see what would happen if one used the results of a tostring method as input into the XML method. What I observed is this: a) beforeCtag.text is of type type 'str' b) beforeCtag.text when printed displays: I'm

Re: [OT] noob import question

2006-05-19 Thread bruno at modulix
Brian Blazer wrote: ot please, dont top-post, and edit out irrelevant material /ot You are right, I do come from a Java background. Then you may want to read this: http://dirtsimple.org/2004/12/python-is-not-java.html HTH -- bruno desthuilliers python -c print '@'.join(['.'.join([w[::-1]

  1   2   3   4   >