DjangoCon US 2010

2010-08-09 Thread Steve Holden
This is a reminder that DjangoCon US 2010 is now under a month away! The third such conference, DjangoCon returns this year to the green Doubletree Hotel in Portland, OR from September 7-9, with a three day sprint hosted by Urban Airship from September 10-12. The program schedule is at

TkinterTreectrl v.1.0 released

2010-08-09 Thread klappnase
Hello, there is an updated version of the Tkinter wrapper of the tktreectrl widget available at : http://klappnase.bubble.org/TkinterTreectrl/index.html The treectrl widget allows to create fancy things like sortable multi column listboxes and hierarchical tree views. An impressive set of

ANN: python-ldap-2.3.12

2010-08-09 Thread Michael Ströder
Find a new release of python-ldap: http://pypi.python.org/pypi/python-ldap/2.3.12 python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related

Re: Win7. Why Don't Matplotlib, ... Show up in Control Panel Add-Remove?

2010-08-09 Thread Martin v. Loewis
There's a discrepancy because package management on Python is completely broken. Distutils and Setuptools (and it's new fork, Distribute) are inadequate- they act as installers, but don't provide a way to uninstall the program. That's not true. If you use the bdist_wininst, bdist_msi, or

Re: Win7. Why Don't Matplotlib, ... Show up in Control Panel Add-Remove?

2010-08-09 Thread Martin v. Loewis
The basic answer is that nobody is in charge. There's nobody even trying to herd the third-party modules. Unlike CPAN, which has standards for Perl packages and some level of quality control, PyPi is just a link farm. Do the standards of CPAN also include uninstallation? To my

Re:Need mentor

2010-08-09 Thread Ranjith Kumar
Hi all, I have described the theme of my project here, When the script is runned a configuring window has to be displayed where the user has to configure for there desired Web Browser, Audio Player, Video Player, Text Editor (Each Specified in separate SS Tab). Here the script should retrieve all

Re: Win7. Why Don't Matplotlib, ... Show up in Control Panel Add-Remove?

2010-08-09 Thread Christoph Gohlke
On Aug 8, 9:54 pm, W. eWatson wolftra...@invalid.com wrote: On 8/8/2010 5:51 PM, Steven D'Aprano wrote: On Sun, 08 Aug 2010 16:15:45 -0700, W. eWatson wrote: To suggest Google as above, makes no sense to me. This is the place to ask, as another poster stated. He may have stated it, but

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-09 Thread Νίκος
On 8 Αύγ, 17:59, Thomas Jollans tho...@jollans.com wrote: Two problems here: str.replace doesn't use regular expressions. You'll have to use the re module to use regexps. (the re.sub function to be precise) '.'  matches a single character. Any character, but only one. '.*' matches as many

xmlrpc and processes

2010-08-09 Thread iu2
Hi, I have a SimpleXMLRPCServer running on one PC. I need several ServerProxy-s talking to it, each one running on a different PC. That is, I run on each PC a client application, that talks to the one server using xml-rpc. Is the xml-rpc designed to work like this? If not, is there something I

Re: urgent requirement

2010-08-09 Thread Carl Banks
On Aug 8, 9:25 pm, sushma sushma.kona...@gmail.com wrote:   We have an urgent requirement for people who are having experience in python.  If you are interested for this position forward your updated resume to the sush...@millenniumsoft.com with the details mention below; current ctc:

Re: Python Portability

2010-08-09 Thread Lawrence D'Oliveiro
In message i3m9vm$2l...@news.eternal-september.org, W. eWatson wrote: Believe me I had no intent of expanding this thread beyond looking for a straight and simple insight to Python distribution (portability, whatever) and how to get my partner squared away. The general issue seems to drifted

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-09 Thread Νίκος
Now the code looks as follows: = #!/usr/bin/python import re, os, sys id = 0 # unique page_id for currdir, files, dirs in os.walk('test'): for f in files: if f.endswith('php'): # get abs path to filename

Re: Python Portability

2010-08-09 Thread geremy condra
On Sun, Aug 8, 2010 at 11:57 PM, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message i3m9vm$2l...@news.eternal-september.org, W. eWatson wrote: Believe me I had no intent of expanding this thread beyond looking for a straight and simple insight to Python distribution

Re: Python -Vs- Ruby: A regexp match to the death!

2010-08-09 Thread rantingrick
On Aug 8, 8:15 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: In Ruby they decided to be more general, so you can define whatever heredoc you need to quote whatever literal string you need. That's not bone-headed. Devils Advocate! PS: Man you're irb main was so full of

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-09 Thread Peter Otten
Νίκος wrote: Now the code looks as follows: for currdir, files, dirs in os.walk('test'): for f in files: if f.endswith('php'): # get abs path to filename src_f = join(currdir, f) I just tried to test it. I

Re: Python Portability

2010-08-09 Thread rantingrick
On Aug 8, 8:03 am, W. eWatson wolftra...@invalid.com wrote: I'm done here. Well thats just great, now how will we ever know what the one char change was. Hmm. a = 'somestring' -a Traceback (most recent call last): File pyshell#2, line 1, in module -a TypeError: bad operand type for

Re: os.unlink on Windows

2010-08-09 Thread Lawrence D'Oliveiro
In message a44efe04-11bd-4c2e-8d4b-88ff02ddf...@f6g2000yqa.googlegroups.com, Shambhu wrote: It is working now after using double backslash in pathname. Might be simpler to use slashes. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python -Vs- Ruby: A regexp match to the death!

2010-08-09 Thread Steven D'Aprano
On Mon, 09 Aug 2010 00:29:19 -0700, rantingrick wrote: On Aug 8, 8:15 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: In Ruby they decided to be more general, so you can define whatever heredoc you need to quote whatever literal string you need. That's not bone-headed.

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-09 Thread Νίκος
On 9 Αύγ, 10:38, Peter Otten __pete...@web.de wrote: Νίκος wrote: Now the code looks as follows: for currdir, files, dirs in os.walk('test'):         for f in files:                 if f.endswith('php'):                         # get abs path to filename                        

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-09 Thread Peter Otten
Νίκος wrote: On 9 Αύγ, 10:38, Peter Otten __pete...@web.de wrote: Νίκος wrote: Now the code looks as follows: for currdir, files, dirs in os.walk('test'): for f in files: if f.endswith('php'): # get abs path to filename src_f = join(currdir, f) I just tried to test it. I

avoiding top posts in gmail [was easy question on parsing python: is not None]

2010-08-09 Thread Cameron Simpson
On 05Aug2010 12:07, wheres pythonmonks wherespythonmo...@gmail.com wrote: | P.S. Sorry for the top-post -- is there a way to not do top posts from | gmail? I haven't used usenet since tin. The standard way is with attitude: view having your cursor at the top not as forcing you to top post but as

Re: easy question on parsing python: is not None

2010-08-09 Thread Bruno Desthuilliers
Gregory Ewing a écrit : Ethan Furman wrote: Instead of using 'is' use '=='. Maybe not as cute, but definitely more robust! It's also just as efficient if you use strings that resemble identifiers, because they will be interned, Remember : this IS an implementation detail. --

Re: Smith-Waterman Algorithm in Python

2010-08-09 Thread Daniel Fetchinson
Every one of the first 20 entries is either the OP questions or your reply. And you think it was there before the OP sent his message? Oh wait, did you just invent a time machine? :) Daniel - you are no help at all, and no funny. Actually, I'm damn funny! :) I have noticed before that

how to change a string into dictionary

2010-08-09 Thread aimeixu
Hi, I am newbie for python ,Here is my question: a = {'a':'1','b':'2'} how to change a into a dictionary ,says, a = {'a':'1','b':'2'} Thanks a lot .Really need help. -- http://mail.python.org/mailman/listinfo/python-list

simple renaming files program

2010-08-09 Thread blur959
Hi, all, I am working on a simple program that renames files based on the directory the user gives, the names the user searched and the names the user want to replace. However, I encounter some problems. When I try running the script, when it gets to the os.rename part, there will be an error. The

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-09 Thread Νίκος
On 9 Αύγ, 11:45, Peter Otten __pete...@web.de wrote: Νίκος wrote: On 9 Αύγ, 10:38, Peter Otten __pete...@web.de wrote: Νίκος wrote: Now the code looks as follows: for currdir, files, dirs in os.walk('test'): for f in files: if f.endswith('php'): # get abs path to filename

Re: how to change a string into dictionary

2010-08-09 Thread Shashwat Anand
On Mon, Aug 9, 2010 at 3:03 PM, aimeixu aime...@amazon.com wrote: Hi, I am newbie for python ,Here is my question: a = {'a':'1','b':'2'} how to change a into a dictionary ,says, a = {'a':'1','b':'2'} Thanks a lot .Really need help. Parse the string and re-create the dictionary. s =

Re: simple renaming files program

2010-08-09 Thread Chris Rebert
On Mon, Aug 9, 2010 at 2:44 AM, blur959 blur...@hotmail.com wrote: Hi, all, I am working on a simple program that renames files based on the directory the user gives, the names the user searched and the names the user want to replace. However, I encounter some problems. When I try running the

Re: simple renaming files program

2010-08-09 Thread Shashwat Anand
On Mon, Aug 9, 2010 at 3:14 PM, blur959 blur...@hotmail.com wrote: Hi, all, I am working on a simple program that renames files based on the directory the user gives, the names the user searched and the names the user want to replace. However, I encounter some problems. When I try running the

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-09 Thread Peter Otten
Νίκος wrote: On 9 Αύγ, 11:45, Peter Otten __pete...@web.de wrote: Νίκος wrote: On 9 Αύγ, 10:38, Peter Otten __pete...@web.de wrote: Νίκος wrote: Now the code looks as follows: for currdir, files, dirs in os.walk('test'): for f in files: if f.endswith('php'): # get abs path

Re: how to change a string into dictionary

2010-08-09 Thread Chris Rebert
On Mon, Aug 9, 2010 at 2:53 AM, Shashwat Anand anand.shash...@gmail.com wrote: On Mon, Aug 9, 2010 at 3:03 PM, aimeixu aime...@amazon.com wrote: Hi, I am newbie for python ,Here is my question: a = {'a':'1','b':'2'} how to change a into a dictionary ,says, a = {'a':'1','b':'2'} Thanks a lot

Re: how to change a string into dictionary

2010-08-09 Thread Ulrich Eckhardt
aimeixu wrote: a = {'a':'1','b':'2'} how to change a into a dictionary ,says, a = {'a':'1','b':'2'} You could evaluate it as regular Python code, using exec: res = {} exec(a={'a':'1'}, res) print res['a'] However, if this is input from a file or the user, be aware that this opens

Re: simple renaming files program

2010-08-09 Thread Ulrich Eckhardt
blur959 wrote: Hi, all, I am working on a simple program that renames files based on the directory the user gives, the names the user searched and the names the user want to replace. However, I encounter some problems. When I try running the script, when it gets to the os.rename part, there

Re: simple renaming files program

2010-08-09 Thread Peter Otten
Chris Rebert wrote: Hence (untested): from os import listdir, rename from os.path import isdir, join directory = raw_input(input file directory) s = raw_input(search for name) r = raw_input(replace name) for filename in listdir(directory): path = join(directory, filename) #paste the

Create child class of Python dict with modified values

2010-08-09 Thread dmitrey
hi all, suppose I have defined a child class of Python dict, currently it constructor looks like that: def __init__(self, *args, **kwargs): dict.__init__(self, *args, **kwargs) #(+some more insufficient code) Constructor should be capable of calling with either any way Python

dumping generator

2010-08-09 Thread targetsmart
Right now if I want to dump the contents of a generator object I use , a snip from a bigger block of code.. try: while gen: print gen.next() except StopIteration: print Done else: raise is there a much simpler way ? like for printing list we do list = range(10) print list would print [0, 1,

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-09 Thread Νίκος
On 9 Αύγ, 13:06, Peter Otten __pete...@web.de wrote: So since its utf-8 what the problem of opening it? Python says it's not, and I tend to believe it. You are right! I tried to do the same exact openign via IDLE enviroment and i goth the encoding of the file from there!

Re: Create child class of Python dict with modified values

2010-08-09 Thread Peter Otten
dmitrey wrote: hi all, suppose I have defined a child class of Python dict, currently it constructor looks like that: def __init__(self, *args, **kwargs): dict.__init__(self, *args, **kwargs) #(+some more insufficient code) Constructor should be capable of calling

Re: dumping generator

2010-08-09 Thread Peter Otten
targetsmart wrote: Right now if I want to dump the contents of a generator object I use , a snip from a bigger block of code.. try: while gen: print gen.next() except StopIteration: print Done else: raise is there a much simpler way ? Indeed there is: for item in gen: print

Re: Create child class of Python dict with modified values

2010-08-09 Thread dmitrey
On Aug 9, 1:38 pm, Peter Otten __pete...@web.de wrote: dmitrey wrote: hi all, suppose I have defined a child class of Python dict, currently it constructor looks like that:     def __init__(self, *args, **kwargs):         dict.__init__(self, *args, **kwargs)         #(+some more

Re: simple renaming files program

2010-08-09 Thread blur959
On Aug 9, 6:01 pm, Chris Rebert c...@rebertia.com wrote: On Mon, Aug 9, 2010 at 2:44 AM, blur959 blur...@hotmail.com wrote: Hi, all, I am working on a simple program that renames files based on the directory the user gives, the names the user searched and the names the user want to replace.

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-09 Thread Peter Otten
Νίκος wrote: On 9 Αύγ, 13:06, Peter Otten __pete...@web.de wrote: So since its utf-8 what the problem of opening it? Python says it's not, and I tend to believe it. You are right! I tried to do the same exact openign via IDLE enviroment and i goth the encoding of the file from

Re: dumping generator

2010-08-09 Thread Ulrich Eckhardt
targetsmart wrote: Right now if I want to dump the contents of a generator object I use , a snip from a bigger block of code.. try: while gen: print gen.next() except StopIteration: print Done else: raise is there a much simpler way ? Why not something like this: for i in gen:

Decorators without function

2010-08-09 Thread Vedran
Hello! Is it possible to apply a decorator on a block of code, without defining a function that decorator is applied to. I have to generate a lot of similar graphs. For that reason I use plot_decorator to perform usual figure setup(outfile, legend, x_label, y_label and so on), and pylab.plot

Re: Decorators without function

2010-08-09 Thread Peter Otten
Vedran wrote: Hello! Is it possible to apply a decorator on a block of code, without defining a function that decorator is applied to. You can only decorate functions or classes. I have to generate a lot of similar graphs. For that reason I use plot_decorator to perform usual figure

Re: easy question on parsing python: is not None

2010-08-09 Thread saeed.gnu
x is y means id(y) == id(y) x is not y means id(x) != id(x) x is not None means id(x) != id(None) x is not None is a really silly statement!! because id(None) and id of any constant object is not predictable! I don't know whay people use is instead of ==. you should write

Re: Python -Vs- Ruby: A regexp match to the death!

2010-08-09 Thread Stefan Schwarzer
Hi Steven, On 2010-08-09 10:21, Steven D'Aprano wrote: And that it's quite finicky about blank lines between methods and inside functions. Makes it hard to paste code directly into the interpreter. And that pasting doesn't strip out any leading prompts. It needs a good doctest mode.

GUI automation tool (windows)

2010-08-09 Thread Alex Barna
I know that this question has been asked for several times, but it surprises that there is no tool under very active development and the community activities are very low (mailing list posts). All the tools listed in: http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy#GUITestingTools

Re: easy question on parsing python: is not None

2010-08-09 Thread saeed.gnu
On Aug 9, 3:41 pm, saeed.gnu saeed@gmail.com wrote: x is y          means   id(y) == id(y) x is not y      means   id(x) != id(x) x is not None   means   id(x) != id(None) x is not None  is a really silly statement!! because id(None) and id of any constant object is not predictable! I

Re: Python why questions

2010-08-09 Thread saeed.gnu
1)  Why do Python lists start with element [0], instead of element [1]?  Common sense would seem to suggest that lists should start with [1].   Because Zero is the neutral element of addition operation. And indexes (and all adresses in computing) involve with addition much more than

Circular imports (again)

2010-08-09 Thread Frank Millman
Hi all I know the problems related to circular imports, and I know some of the techniques to get around them. However, I find that I bump my head into them from time to time, which means, I guess, that I have not fully understood how to organise my code so that I avoid them in the first

Re: Regular expression issue

2010-08-09 Thread genxtech
On Aug 8, 7:34 pm, Tim Chase python.l...@tim.thechases.com wrote: On 08/08/10 17:20, genxtech wrote: if re.search(search_string, in_string) != None: While the other responses have addressed some of the big issues, it's also good to use    if thing_to_test is None: or    if

Re: Python -Vs- Ruby: A regexp match to the death!

2010-08-09 Thread Mike Kent
On Aug 8, 8:43 pm, rantingrick rantingr...@gmail.com wrote: Hello folks, You all know i been forced to use Ruby and i am not happy about that. ***Blablabla cut long rant*** Xah, this is really you, isn't it. Come on, confess. -- http://mail.python.org/mailman/listinfo/python-list

HELP! build python error with message: unable to load the file system codec

2010-08-09 Thread Wang Lei
Hi, developers! I get python3k from the svn repository. The revision is 83889. When building it, i encounter this error. gcc -pthread -Xlinker -export-dynamic -o python Modules/python.o libpython3.2.a -lpthread -ldl -lutil -lm XXX lineno: 1098, opcode: 32 Unable to get

Re: Why is python not written in C++ ?

2010-08-09 Thread Ulrich Eckhardt
candide wrote: Python is an object oriented langage (OOL). The Python main implementation is written in pure and old C90. Is it for historical reasons? The fact that Python is OOP doesn't mean that the implementation of it has to be written using an OOP language. Other than that, I'm actually

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-09 Thread MRAB
Νίκος wrote: On 8 Αύγ, 17:59, Thomas Jollans tho...@jollans.com wrote: Two problems here: str.replace doesn't use regular expressions. You'll have to use the re module to use regexps. (the re.sub function to be precise) '.' matches a single character. Any character, but only one. '.*'

Re: simple renaming files program

2010-08-09 Thread Dave Angel
blur959 wrote: On Aug 9, 6:01 pm, Chris Rebert c...@rebertia.com wrote: snip os.rename() takes paths that are absolute (or possibly relative to the cwd), not paths that are relative to some arbitrary directory (as returned by os.listdir()). Also, never name a variable file; it shadows the

Re: Regular expression issue

2010-08-09 Thread MRAB
genxtech wrote: On Aug 8, 7:34 pm, Tim Chase python.l...@tim.thechases.com wrote: On 08/08/10 17:20, genxtech wrote: if re.search(search_string, in_string) != None: While the other responses have addressed some of the big issues, it's also good to use if thing_to_test is None: or if

Re: simple renaming files program

2010-08-09 Thread MRAB
Dave Angel wrote: blur959 wrote: On Aug 9, 6:01 pm, Chris Rebert c...@rebertia.com wrote: snip os.rename() takes paths that are absolute (or possibly relative to the cwd), not paths that are relative to some arbitrary directory (as returned by os.listdir()). Also, never name a variable file;

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-09 Thread Νίκος
On 9 Αύγ, 13:47, Peter Otten __pete...@web.de wrote: Νίκος wrote: On 9 Αύγ, 13:06, Peter Otten __pete...@web.de wrote: So since its utf-8 what the problem of opening it? Python says it's not, and I tend to believe it. You are right! I tried to do the same exact openign via IDLE

Re: easy question on parsing python: is not None

2010-08-09 Thread Dave Angel
saeed.gnu wrote: On Aug 9, 3:41 pm, saeed.gnu saeed@gmail.com wrote: x is y means id(y) =id(y) x is not y means id(x) !=d(x) x is not None means id(x) !=d(None) x is not None is a really silly statement!! because id(None) and id of any constant object is not

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-09 Thread Νίκος
On 9 Αύγ, 16:52, MRAB pyt...@mrabarnett.plus.com wrote: Νίκος wrote: On 8 Αύγ, 17:59, Thomas Jollans tho...@jollans.com wrote: Two problems here: str.replace doesn't use regular expressions. You'll have to use the re module to use regexps. (the re.sub function to be precise) '.'  

Creating a custom UI inside Maya with python

2010-08-09 Thread blur959
Hi, all, I wonder if my post is relevant here, but i will still post it anyway. I am working on creating a custom UI inside Maya and I encountered some problems. Firstly, I am trying to create a textfield button that creates a locator-shaped curve based on the coordinates the user keyed into the

Re: simple renaming files program

2010-08-09 Thread Dave Angel
MRAB wrote: snip from os.path import isdir, join snip Have a look at the imports, Dave. :-) Oops. I should have noticed that it was a function call, not a method. And there's no built-in called join(). I just usually avoid using this kind of alias, unless performance requires.

Re: easy question on parsing python: is not None

2010-08-09 Thread Nobody
On Mon, 09 Aug 2010 04:41:23 -0700, saeed.gnu wrote: x is not None is a really silly statement!! because id(None) and id of any constant object is not predictable! I don't know whay people use is instead of ==. you should write if x!=None instead of x is not None No, you should use the

Re: Regular expression issue

2010-08-09 Thread nn
On Aug 9, 9:18 am, genxtech jrmy.l...@gmail.com wrote: On Aug 8, 7:34 pm, Tim Chase python.l...@tim.thechases.com wrote: On 08/08/10 17:20, genxtech wrote: if re.search(search_string, in_string) != None: While the other responses have addressed some of the big issues, it's also good

Re: Creating a custom UI inside Maya with python

2010-08-09 Thread MRAB
blur959 wrote: Hi, all, I wonder if my post is relevant here, but i will still post it anyway. I am working on creating a custom UI inside Maya and I encountered some problems. Firstly, I am trying to create a textfield button that creates a locator-shaped curve based on the coordinates the user

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-09 Thread MRAB
Νίκος wrote: On 9 Αύγ, 16:52, MRAB pyt...@mrabarnett.plus.com wrote: Νίκος wrote: On 8 Αύγ, 17:59, Thomas Jollans tho...@jollans.com wrote: Two problems here: str.replace doesn't use regular expressions. You'll have to use the re module to use regexps. (the re.sub function to be precise) '.'

Re: Python why questions

2010-08-09 Thread Grant Edwards
On 2010-08-07, Hexamorph hexamo...@gmx.net wrote: Lurking for long enough to know your style. Looking at your Unicode rant, combined with some other comments and your general I am right and you are wrong because you disagree with me. style, I came to the conclusion, that you are either a

Using dicts and lists as default arguments of functions

2010-08-09 Thread Johan
Dear all, Considering this test program: def tst(a={}): print 1, a a['1'] = 1 print 2, a del a def tstb(a=[]): print 1, a a.append(1) print 2, a del a tst() tst() tstb() tstb() With output: t...@tnjx:~/tst python tt.py 1 {} 2 {'1': 1} 1 {'1': 1} 2 {'1': 1}

Re: Using dicts and lists as default arguments of functions

2010-08-09 Thread Mel
Johan wrote: Dear all, Considering this test program: def tst(a={}): print 1, a a['1'] = 1 print 2, a del a The idiom to use is def tst (a=None): if a is None: a = {} # ... and so on. This means that every call to tst with unspecified a creates

Re: Using dicts and lists as default arguments of functions

2010-08-09 Thread MRAB
Johan wrote: Dear all, Considering this test program: def tst(a={}): print 1, a a['1'] = 1 print 2, a del a def tstb(a=[]): print 1, a a.append(1) print 2, a del a [snip] Do this instead: def tst(a=None): if a is None: a = {} print 1, a

Re: Using dicts and lists as default arguments of functions

2010-08-09 Thread Bruno Desthuilliers
Johan a écrit : Dear all, Considering this test program: def tst(a={}): Stop here, we already know what will follow !-) And yes, it's one of Python's most (in)famous gotchas : default arguments values are computed only once, at function definition time (that is, when the def statement is

EARN FROM HOME...EAZY... TRY THIS.####

2010-08-09 Thread SAKEERA
EARN FROM HOME...EAZY... TRY THIS. http://www.hymarkets.com/servlet/track?campaignID=7012000AS5Ba_aid=d629b730 EARN FROM HOME...EAZY... TRY THIS. http://www.hymarkets.com/servlet/track?campaignID=7012000AS5Ba_aid=d629b730 EARN FROM HOME...EAZY... TRY THIS.

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-09 Thread Νίκος
Please tell me that no matter what weird charhs has inside ic an still open thosie fiels and make the neccessary replacements. -- http://mail.python.org/mailman/listinfo/python-list

Subprocess Problem (Wait and while)

2010-08-09 Thread Alban Nona
Hi, I have some problem with my actual code. In fact, the script is done to work within nuke from the foundry which is a compositing software. Homever, I have some code difficulties as I quite new in the area. Here the deal: Im using subprocess command to copy some files into local directory,

iter

2010-08-09 Thread daryn
I'm just playing around with the iter function and I realize that I can use the iterator returned by it long after the original object has any name bound to it. Example: a=[1,2,3,4] b=iter(a) b.next() 1 a[1]=99 a[3]=101 del a b.next() 99 b.next() 3 b.next() 101 it seems as if the original

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-09 Thread Peter Otten
Νίκος wrote: Please tell me that no matter what weird charhs has inside ic an still open thosie fiels and make the neccessary replacements. Go back to 2.6 for the moment and defer learning about unicode until you're done with the conversion job. --

ANN: python-ldap-2.3.12

2010-08-09 Thread Michael Ströder
Find a new release of python-ldap: http://pypi.python.org/pypi/python-ldap/2.3.12 python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related

Re: easy question on parsing python: is not None

2010-08-09 Thread Terry Reedy
On 8/9/2010 7:41 AM, saeed.gnu wrote: x is y means id(y) == id(y) x is not y means id(x) != id(x) x is not None means id(x) != id(None) x is not None is a really silly statement!! Wrong. It is exactly right when that is what one means and is the STANDARD IDIOM.

Re: iter

2010-08-09 Thread Peter Otten
daryn wrote: I'm just playing around with the iter function and I realize that I can use the iterator returned by it long after the original object has any name bound to it. Example: a=[1,2,3,4] b=iter(a) b.next() 1 a[1]=99 a[3]=101 del a b.next() 99 b.next() 3 b.next() 101 it seems

Re: xmlrpc and processes

2010-08-09 Thread bobicanprogram
On Aug 9, 2:50 am, iu2 isra...@elbit.co.il wrote: Hi, I have a SimpleXMLRPCServer running on one PC. I need several ServerProxy-s talking to it, each one running on a different PC. That is, I run on each PC a client application, that talks to the one server using xml-rpc. Is the xml-rpc

Re: Python parsing XML file problem with SAX

2010-08-09 Thread Aahz
In article mailman.1250.1280314148.1673.python-l...@python.org, Stefan Behnel stefan...@behnel.de wrote: First of all: don't use SAX. Use ElementTree's iterparse() function. That will shrink you code down to a simple loop in a few lines. Unless I'm missing something, that only helps if the

Re: xmlrpc and processes

2010-08-09 Thread Martin P. Hellwig
On 08/09/10 07:50, iu2 wrote: Hi, I have a SimpleXMLRPCServer running on one PC. I need several ServerProxy-s talking to it, each one running on a different PC. That is, I run on each PC a client application, that talks to the one server using xml-rpc. Is the xml-rpc designed to work like

Re: how to change a string into dictionary

2010-08-09 Thread Daniel Urban
a = {'a':'1','b':'2'} how to change a into a dictionary ,says, a = {'a':'1','b':'2'} See also the ast.literal_eval function: http://docs.python.org/py3k/library/ast.html#ast.literal_eval Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: iter

2010-08-09 Thread Terry Reedy
On 8/9/2010 12:11 PM, daryn wrote: I'm just playing around with the iter function and I realize that I can use the iterator returned by it long after the original object has any name bound to it. Example: a=[1,2,3,4] b=iter(a) b.next() 1 a[1]=99 Changing a list while iterating through it

Re: Need mentor

2010-08-09 Thread Terry Reedy
On 8/9/2010 2:31 AM, Ranjith Kumar wrote: I have described the theme of my project here, Is this a class assignment or paid work? -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Python why questions

2010-08-09 Thread Terry Reedy
On 8/9/2010 11:16 AM, Grant Edwards wrote: IOW, the Ugly American. [snip hate rant] Stereotypically bashing Americans is as ugly and obnoxious as bashing any other ethnic group. I have traveled the world and Americans are no worse, but are pretty much the same mix of good and bad. It is

Re: Python parsing XML file problem with SAX

2010-08-09 Thread Stefan Behnel
Aahz, 09.08.2010 18:52: In articlemailman.1250.1280314148.1673.python-l...@python.org, Stefan Behnel wrote: First of all: don't use SAX. Use ElementTree's iterparse() function. That will shrink you code down to a simple loop in a few lines. Unless I'm missing something, that only helps if

Re: Circular imports (again)

2010-08-09 Thread Ethan Furman
Frank Millman wrote: Hi all I know the problems related to circular imports... It has just happened again. I have organised my code into three modules, each representing a fairly cohesive functional area of the overall application. However, there really are times when Module A wants to

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-09 Thread Νίκος
On 9 Αύγ, 19:21, Peter Otten __pete...@web.de wrote: Νίκος wrote: Please tell me that no matter what weird charhs has inside ic an still open thosie fiels and make the neccessary replacements. Go back to 2.6 for the moment and defer learning about unicode until you're done with the

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-09 Thread Thomas Jollans
On Monday 09 August 2010, it occurred to Νίκος to exclaim: On 9 Αύγ, 19:21, Peter Otten __pete...@web.de wrote: Νίκος wrote: Please tell me that no matter what weird charhs has inside ic an still open thosie fiels and make the neccessary replacements. Go back to 2.6 for the moment

Re: Python why questions

2010-08-09 Thread Grant Edwards
On 2010-08-09, Terry Reedy tjre...@udel.edu wrote: On 8/9/2010 11:16 AM, Grant Edwards wrote: IOW, the Ugly American. [snip hate rant] Stereotypically bashing Americans I wasn't bashing Americans. I was making light of a certain type of American tourist commonly denoted by the phrase ugly

Re: Why is python not written in C++ ?

2010-08-09 Thread Carl Banks
On Aug 9, 6:39 am, Ulrich Eckhardt eckha...@satorlaser.com wrote: candide wrote: Python is an object oriented langage (OOL). The Python main implementation is written in pure and old C90. Is it for historical reasons? The fact that Python is OOP doesn't mean that the implementation of it

Re: Why is python not written in C++ ?

2010-08-09 Thread Christian Heimes
I highly doubt the Python source would build with a C++ compiler. C++ is 'mostly' 'backwards' compatible with C insofar as you can pretty easily write C code that is also legal (and semantically equivalent) C++. But if you don't actively try to write code that is compatible with both

Re: Need mentor

2010-08-09 Thread Carey Tilden
On Sun, Aug 8, 2010 at 11:31 PM, Ranjith Kumar ranjitht...@gmail.com wrote: I have described the theme of my project here, It appears all you did was describe your project. Did you ask a question or seek any specific guidance? Did I miss something? Carey --

Re: Circular imports (again)

2010-08-09 Thread Carl Banks
On Aug 9, 6:19 am, Frank Millman fr...@chagford.com wrote: It has just happened again. I have organised my code into three modules, each representing a fairly cohesive functional area of the overall application. However, there really are times when Module A wants to invoke something from

Re: Python why questions

2010-08-09 Thread Bartc
D'Arcy J.M. Cain da...@druid.net wrote in message news:mailman.1735.1281185722.1673.python-l...@python.org... On Sat, 07 Aug 2010 13:48:32 +0200 News123 news1...@free.fr wrote: It makes sense in assembly language and even in many byte code languages. It makes sense if you look at the

EARN FROM HOME... ITS REAL....

2010-08-09 Thread SAKEERA
EARN FROM HOME... ITS REAL http://www.kamaraja.com/howitworks.htm?aff=naagaarjuna ...AND.. http://www.hyaffiliates.com?pid=d629b730 EARN FROM HOME... ITS REAL http://www.kamaraja.com/howitworks.htm?aff=naagaarjuna ...AND.. http://www.hyaffiliates.com?pid=d629b730

Re: Replace and inserting strings within .txt files with the use of regex

2010-08-09 Thread Νίκος
On 8 Αύγ, 20:29, John S jstrick...@gmail.com wrote: When replacing text in an HTML document with re.sub, you want to use the re.S (singleline) option; otherwise your pattern won't match when the opening tag is on one line and the closing is on another. Thats exactly the problem iam facing now

  1   2   3   4   >