[ANN] pyxser-1.5.1r --- Python Object to XML serializer/deserializer

2010-10-11 Thread Daniel Molina Wegener
Hello Python Community. I'm pleased to announce pyxser-1.5.1r, a python extension which contains functions to serialize and deserialize Python Objects into XML. It is a model based serializer. What can do this serializer? * Serialization of cross references. * Serialization of circular

Re: open file on mac

2010-10-11 Thread tinauser
On Oct 10, 11:44 pm, Benjamin Kaplan benjamin.kap...@case.edu wrote: On Sun, Oct 10, 2010 at 5:29 PM, tinauser tinau...@libero.it wrote: On Oct 10, 6:54 am, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message

socket problem and html problem

2010-10-11 Thread bussiere bussiere
here is my code and two questions : why it says to me that i can't bind the socket ? normally it had closed it and kill it :/ and why it returns me plain text and not html ? Regards and a pack of mm's to the one who will help me on this two questions. import socket import sys # Create a TCP/IP

Re: Class-level variables - a scoping issue

2010-10-11 Thread Gregory Ewing
Lawrence D'Oliveiro wrote: It seems to me the same principle, that of disallowing implicit overriding of a name from an outer scope with that from an inner one after the former has already been referenced, should be applied here as well. How would you intend to enforce such a restriction?

Re: Class-level variables - a scoping issue

2010-10-11 Thread Lawrence D'Oliveiro
In message 8hfq23fet...@mid.individual.net, Gregory Ewing wrote: Lawrence D'Oliveiro wrote: It seems to me the same principle, that of disallowing implicit overriding of a name from an outer scope with that from an inner one after the former has already been referenced, should be applied

Re: Eclipse/PyDev - BOM Lexical Error

2010-10-11 Thread Lawrence D'Oliveiro
In message mailman.1533.1286774527.29448.python-l...@python.org, Ethan Furman wrote: Lawrence D'Oliveiro wrote: In message mailman.1466.1286556950.29448.python-l...@python.org, Ethan Furman wrote: Lawrence D'Oliveiro wrote: But they can only recognize it as a BOM if they assume UTF-8

Who is she?

2010-10-11 Thread nosrah
Lady Aisha (may Allah be pleased with her) is what this humanity possesses of bright mind, sharp wit, and abundant knowledge. Additionally, for her effective role in serving the Islamic thought through relating Prophet Muhammad's (PBUH) Hadiths (narrations); interpreting a lot of the aspects of

Re: UTF-8 problem encoding and decoding in Python3

2010-10-11 Thread Almar Klein
On 10 October 2010 23:01, Hidura hid...@gmail.com wrote: I try to encode a binary file what was upload to a server and is extract from the wsgi.input of the environ and comes as an unicode string. Firstly, UTF-8 is not meant to encode arbitrary binary data. But I guess you could have a

Re: [Python-ideas] [Python-Dev] Inclusive Range

2010-10-11 Thread Antoon Pardon
On Sat, Oct 09, 2010 at 01:37:03AM +, Steven D'Aprano wrote: On Fri, 08 Oct 2010 15:53:17 -0400, Jed Smith wrote: On Fri, Oct 8, 2010 at 1:26 PM, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Fri, 08 Oct 2010 10:21:16 +0200, Antoon Pardon wrote: Personnaly I find

Difficulty in easy_install

2010-10-11 Thread sankalp srivastava
I am having difficulty in easy_installing I use a proxy server and strange errors , like it can't fetch the package is showing up . the package is pyspeech ...please help me :( I don't know if the proxy server is causing the problems , in linux i would have import http-proxy in .bashrc but am

Re: cp936 uses gbk codec, doesn't decode `\x80` as U+20AC EURO SIGN

2010-10-11 Thread Ulrich Eckhardt
John Machin wrote: | '\x80'.decode('cp936') Traceback (most recent call last): File stdin, line 1, in module UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 0: incomplete multibyte sequence [...] So Microsoft appears to think that cp936 includes the euro, and the ICU

Mother Aisha may Allah be pleased with her

2010-10-11 Thread Sons Aisha
Lady Aisha (may Allah be pleased with her) is what this humanity possesses of bright mind, sharp wit, and abundant knowledge. Additionally, for her effective role in serving the Islamic thought through relating Prophet Muhammad's (PBUH) Hadiths (narrations); interpreting a lot of the aspects of

binary vtk file

2010-10-11 Thread Paul Biegel
Hi, I have a question related to read a binary vtk file. This file has been created using Matlab by the command fread. However, this file must be processed further within Python. It is not known to me which codec is used to encode this file. It starts with the following characters:

Re: [Python-ideas] [Python-Dev] Inclusive Range

2010-10-11 Thread Dave Angel
On 2:59 PM, Antoon Pardon wrote: On Sat, Oct 09, 2010 at 01:37:03AM +, Steven D'Aprano wrote: snip But the point was that Antoon claimed that there is no numeric value for the end position that will include L[0] in the reversed slice. My example shows that this is not correct. I stand by

ukhomemadescandals

2010-10-11 Thread sam
due to high pornography i have hidden the video in the website. left side below search box click the image and watch all video..http://ukhomemadescandals.tk/ -- http://mail.python.org/mailman/listinfo/python-list

Re: del() function - cannot find documentation

2010-10-11 Thread Lawrence D'Oliveiro
In message mailman.1449.1286482348.29448.python-l...@python.org, mafeu...@gmail.com wrote: the problem is I cannot find any information about del() function in python 2.7 documentation. Try the Python language reference. -- http://mail.python.org/mailman/listinfo/python-list

Re: I don't get why sys.exit(1) doesn't exit the while loop in the follow case

2010-10-11 Thread Lawrence D'Oliveiro
In message pan.2010.10.05.20.44.49.109...@nowhere.com, Nobody wrote: If I'm catching exceptions in order to perform clean-up, I'll use a bare except and re-raise the exception afterwards. In that situation, a bare except is usually the right thing to do. Wrong way to do it. --

Re: help!!!

2010-10-11 Thread Lawrence D'Oliveiro
In message mailman.1417.1286438621.29448.python-l...@python.org, Emile van Sebille wrote: Oh come now -- isn't being lazy a primary programmer's attribute? I wonder if that’s why more men are good at it than women... -- http://mail.python.org/mailman/listinfo/python-list

Re: help!!!

2010-10-11 Thread Lawrence D'Oliveiro
In message slrniaqm69.28f8.usenet-nos...@guild.seebs.net, Seebs wrote: ... but I wasn't aware that it had been deprecated, except in the sense of being derided and dismissed as of no value. What more did you want? :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading Outlook .msg file using Python

2010-10-11 Thread Tim Golden
On 10/10/2010 22:51, John Henry wrote: I have a need to read .msg files exported from Outlook. Google search came out with a few very old posts about the topic but nothing really useful. The email module in Python is no help - everything comes back blank and it can't even see if there are

Re: del() function - cannot find documentation

2010-10-11 Thread Lawrence D'Oliveiro
In message vedta6d9i8no1h6cmkb5nl7np5lfov1...@4ax.com, Tim Roberts wrote: This kind of confusion is, in my opinion, the primary reason why parentheses should never be used with del and return, as we so commonly see. It’s the kind of “confusion” that could be cleared up with 30 seconds’

Re: Help with sets

2010-10-11 Thread Lawrence D'Oliveiro
In message 8h9ob9fku...@mid.individual.net, Gregory Ewing wrote: Lawrence D'Oliveiro wrote: Did you know that applying the “set” or “frozenset” functions to a dict return a set of its keys? Seems a bit dodgy, somehow. That's just a consequence of the fact that dicts produce their keys

Re: [Python-ideas] [Python-Dev] Inclusive Range

2010-10-11 Thread Antoon Pardon
On Mon, Oct 11, 2010 at 06:25:49AM -0400, Dave Angel wrote: On 2:59 PM, Antoon Pardon wrote: On Sat, Oct 09, 2010 at 01:37:03AM +, Steven D'Aprano wrote: snip But the point was that Antoon claimed that there is no numeric value for the end position that will include L[0] in the reversed

Re: Many newbie questions regarding python

2010-10-11 Thread Jean-Michel Pichavant
Peter Pearson wrote: On Sat, 09 Oct 2010 19:30:16 -0700, Ethan Furman et...@stoneleaf.us wrote: Steven D'Aprano wrote: [snip] But that doesn't mean that the list comp is the general purpose solution. Consider the obvious use of the idiom: def func(arg, count): # Initialise

EOF while scanning triple-quoted string literal

2010-10-11 Thread bussiere bussiere
i've looked on the web and here but i didn't find an answer : here is my code zlib.decompress( xワᆳヤ=ラᄇHナs~Ʀᄑç\ムîà z...@ÑÁÔqÇlxÇÆïpp~ývãì゙m6ÛÐ|ê֭ᄁᄂヤ=)}éÓUe﬿ö3ᄎᄌú}ʿïÿ÷1þ8ñ́U÷ᄏñíLÒVi:`ᄈᄎL!Ê҆p6-%Fë^ヘ÷à,Q.K!ユô`ÄA!ÑêweÌ ÊÚAロYøøÂjôóᅠÂcñ䊧fᆴùテúN

Re: I don't get why sys.exit(1) doesn't exit the while loop in the follow case

2010-10-11 Thread Peter Otten
Steven D'Aprano wrote: On Tue, 05 Oct 2010 13:57:11 +1100, Ben Finney wrote: chad cdal...@gmail.com writes: while 1: A minor point: this is more explanatory and less misleading if you write it as ‘while True’. Why is it misleading? Is there some circumstance in Python where the

Re: Eclipse/PyDev - BOM Lexical Error

2010-10-11 Thread Ethan Furman
Lawrence D'Oliveiro wrote: In message mailman.1533.1286774527.29448.python-l...@python.org, Ethan Furman wrote: Lawrence D'Oliveiro wrote: In message mailman.1466.1286556950.29448.python-l...@python.org, Ethan Furman wrote: Lawrence D'Oliveiro wrote: But they can only recognize it

Re: [Python-ideas] [Python-Dev] Inclusive Range

2010-10-11 Thread Ethan Furman
Antoon Pardon wrote: On Sat, Oct 09, 2010 at 01:37:03AM +, Steven D'Aprano wrote: On Fri, 08 Oct 2010 15:53:17 -0400, Jed Smith wrote: On Fri, Oct 8, 2010 at 1:26 PM, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Fri, 08 Oct 2010 10:21:16 +0200, Antoon Pardon wrote:

Missing modules for python

2010-10-11 Thread Sunil Saggar
I was trying to make exe from python program and found the following errors The following modules appear to be missing ['email.FeedParser', 'email.Generator', 'email.Iterators', 'email.Message', 'email.Utils', 'simplejson', 'socks'] I am using Python 2.6 -- Regards Sunil Saggar --

Re: I don't get why sys.exit(1) doesn't exit the while loop in the follow case

2010-10-11 Thread Ethan Furman
Lawrence D'Oliveiro wrote: In message pan.2010.10.05.20.44.49.109...@nowhere.com, Nobody wrote: If I'm catching exceptions in order to perform clean-up, I'll use a bare except and re-raise the exception afterwards. In that situation, a bare except is usually the right thing to do. Wrong way

Re: Help with sets

2010-10-11 Thread Ethan Furman
Lawrence D'Oliveiro wrote: In message 8h9ob9fku...@mid.individual.net, Gregory Ewing wrote: Lawrence D'Oliveiro wrote: Did you know that applying the “set” or “frozenset” functions to a dict return a set of its keys? Seems a bit dodgy, somehow. That's just a consequence of the fact that

emdding python gui in c code - OS independent

2010-10-11 Thread tinauser
hi there, i need to embed python GUI in a c++ code. I've seen that,while on windows running GUI is no problem, in mac i need to use pythonw instead python. the question is,how should i tell the program that if the OS is mac, it should pythonw, otherwise python is fine? --

Re: [Python-Dev] PyArg_ParseTuple

2010-10-11 Thread Brian Curtin
On Mon, Oct 11, 2010 at 07:06, Ioan Ferencik ioan.feren...@tkk.fi wrote: I would like to ask where can I find more detailed info on PyArg_ParseTuple function. I find the doc limited on the matter. Mainly I am curious why the function requires an address of a pointer. I have issues in the

Re: Class-level variables - a scoping issue

2010-10-11 Thread Jean-Michel Pichavant
John Nagle wrote: Here's an obscure bit of Python semantics which is close to being a bug: class t(object) : ... classvar = 1 ... ... def fn1(self) : ... print(fn1: classvar = %d % (self.classvar,)) ... self.classvar = 2 ... print(fn1: classvar = %d %

Re: help!!!

2010-10-11 Thread Andreas Waldenburger
On Mon, 11 Oct 2010 23:51:46 +1300 Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message mailman.1417.1286438621.29448.python-l...@python.org, Emile van Sebille wrote: Oh come now -- isn't being lazy a primary programmer's attribute? I wonder if that’s why more men are

Re: help!!!

2010-10-11 Thread Jason Swails
On Mon, Oct 11, 2010 at 9:25 AM, Andreas Waldenburger use...@geekmail.invalid wrote: On Mon, 11 Oct 2010 23:51:46 +1300 Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message mailman.1417.1286438621.29448.python-l...@python.org, Emile van Sebille wrote: Oh come now --

Re: if the else short form

2010-10-11 Thread Neville Dempsey
On Oct 11, 11:46 am, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: Nowadays we take it for granted that the core language should be a strong and compact basis to build on, rather than providing lots of built-in features, and all the rest should come from run-time libraries.

Re: binary vtk file

2010-10-11 Thread Robert Kern
On 10/11/10 5:16 AM, Paul Biegel wrote: Hi, I have a question related to read a binary vtk file. This file has been created using Matlab by the command fread. However, this file must be processed further within Python. It is not known to me which codec is used to encode this file. It starts with

Re: Missing modules for python

2010-10-11 Thread Jed Smith
On Mon, Oct 11, 2010 at 8:43 AM, Sunil Saggar sunil.sag...@gmail.com wrote: I was trying to make exe from python program and found the following errors The following modules appear to be missing ['email.FeedParser', 'email.Generator', 'email.Iterators', 'email.Message', 'email.Utils',

Wingware Python IDE 3.2.11 released

2010-10-11 Thread Wingware
Hi, Wingware has released version 3.2.11 of Wing IDE, an integrated development environment designed specifically for the Python programming language. This release includes the following improvements: * Improved Perforce integration * Improved vi and Visual Studio modes, and keyboard

Re: Can't find pythonwin

2010-10-11 Thread Jed Smith
On Mon, Oct 11, 2010 at 3:46 AM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Sun, 10 Oct 2010 20:33:09 -0400, Jed Smith j...@jedsmith.org declaimed the following in gmane.comp.python.general: As far as I know, Pythonwin is a collection of extensions to Python that are available on

Re: Class-level variables - a scoping issue

2010-10-11 Thread John Posner
On 10/10/2010 7:02 PM, Steven D'Aprano wrote: On Sun, 10 Oct 2010 18:14:33 -0400, John Posner wrote: Class attributes are often used as class constants, so how about naming them with UPPERCASE names, like other constants? When you choose to override one of these constants, like this:

logging.handlers.SMTPHandler and fileConfig

2010-10-11 Thread pstatham
I'm trying to use pythons logging.handlers.SMTPHandler with a configuration file (so that I don't have to have passwords etc. inside of the script) Now the guide I'm following is [URL=http://docs.python.org/library/ logging.html#configuration-file-format]here[/URL], now the RotatingFileHandler is

Adding to an Array inside a Dict

2010-10-11 Thread MacOSX @ Rocteur.cc
Hi, Is there an easier way to do this, I am adding/creating to an array inside a dict but can find a cleaner way: So I first check if the key exists already, if it does then I know I use append, if it does not I create it. if osmdict.has_key(token):

Re: Help with sets

2010-10-11 Thread Robert Kern
On 10/11/10 6:11 AM, Lawrence D'Oliveiro wrote: In message8h9ob9fku...@mid.individual.net, Gregory Ewing wrote: Lawrence D'Oliveiro wrote: Did you know that applying the “set” or “frozenset” functions to a dict return a set of its keys? Seems a bit dodgy, somehow. That's just a

Re: help!!!

2010-10-11 Thread Robert Kern
On 10/11/10 8:44 AM, Jason Swails wrote: On Mon, Oct 11, 2010 at 9:25 AM, Andreas Waldenburger use...@geekmail.invalid wrote: On Mon, 11 Oct 2010 23:51:46 +1300 Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message

Re: Adding to an Array inside a Dict

2010-10-11 Thread Robert Kern
On 10/11/10 9:55 AM, MacOSX @ Rocteur.cc wrote: Hi, Is there an easier way to do this, I am adding/creating to an array inside a dict but can find a cleaner way: So I first check if the key exists already, if it does then I know I use append, if it does not I create it. if

Re: Reading Outlook .msg file using Python

2010-10-11 Thread John Henry
On Oct 11, 3:56 am, Tim Golden m...@timgolden.me.uk wrote: On 10/10/2010 22:51, John Henry wrote: I have a need to read .msg files exported from Outlook.  Google search came out with a few very old posts about the topic but nothing really useful.  The email module in Python is no help -

Re: Reading Outlook .msg file using Python

2010-10-11 Thread Tim Golden
On 11/10/2010 4:39 PM, John Henry wrote: I am trying your code but when it get to the line: mapi.MAPIInitialize ((mapi.MAPI_INIT_VERSION, 0)) I got the error message: Either there is no default mail client or the current mail client cannot fulfill the messsage requrest. Please run

Re: logging.handlers.SMTPHandler and fileConfig

2010-10-11 Thread Chris Rebert
On Mon, Oct 11, 2010 at 7:52 AM, pstatham pstat...@sefas.com wrote: I'm trying to use pythons logging.handlers.SMTPHandler with a configuration file (so that I don't have to have passwords etc. inside of the script) Now the guide I'm following is [URL=http://docs.python.org/library/

2D List

2010-10-11 Thread Fasihul Kabir
a = [0]*5 for i in range(0, 4): for j in range(0, i): a[i].append(j) why the above codes show the following error. and how to overcome it. Traceback (most recent call last): File pyshell#10, line 3, in module a[i].append(j) AttributeError: 'int' object has no attribute

Re: 2D List

2010-10-11 Thread Nitin Pawar
the declaration is wrong if you want to create a two dimensional array try to use functions like arange and reshape On Mon, Oct 11, 2010 at 9:54 PM, Fasihul Kabir rrock...@yahoo.com wrote: a = [0]*5 for i in range(0, 4): for j in range(0, i): a[i].append(j) why the above

Re: 2D List

2010-10-11 Thread Chris Rebert
On Mon, Oct 11, 2010 at 9:24 AM, Fasihul Kabir rrock...@yahoo.com wrote: a = [0]*5  for i in range(0, 4):     for j in range(0, i):         a[i].append(j) why the above codes show the following error. and how to overcome it. Traceback (most recent call last):   File pyshell#10, line 3, in

Re: help!!!

2010-10-11 Thread Jason Swails
On Mon, Oct 11, 2010 at 11:11 AM, Robert Kern robert.k...@gmail.com wrote: On 10/11/10 8:44 AM, Jason Swails wrote: On Mon, Oct 11, 2010 at 9:25 AM, Andreas Waldenburger use...@geekmail.invalid wrote: On Mon, 11 Oct 2010 23:51:46 +1300 Lawrence D'Oliveiro

Re: emdding python gui in c code - OS independent

2010-10-11 Thread Chris Rebert
On Mon, Oct 11, 2010 at 6:16 AM, tinauser tinau...@libero.it wrote: hi there, i need to embed python GUI in a c++ code. I've seen that,while on windows running GUI is no problem, in mac i need to use pythonw instead python. the question is,how should i tell the program that if the OS is mac,

Re: Many newbie questions regarding python

2010-10-11 Thread Peter Pearson
On Sun, 10 Oct 2010 18:36:27 -0700, Ethan Furman et...@stoneleaf.us wrote: [snip] My question is more along the lines of: a mutable object was passed in to func()... what style of loop could be used to turn that one object into /n/ distinct objects? A list comp won't do it, but neither will

Re: Class-level variables - a scoping issue

2010-10-11 Thread Chris Rebert
On Mon, Oct 11, 2010 at 9:44 AM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Mon, 11 Oct 2010 10:43:04 -0400, John Posner jjpos...@optimum.net declaimed the following in gmane.comp.python.general: No surprising behavior, just a surprising look:    self.EGGS = ... ... which might

Re: 2D List

2010-10-11 Thread Gary Herron
On 10/11/2010 09:24 AM, Fasihul Kabir wrote: a = [0]*5 for i in range(0, 4): for j in range(0, i): a[i].append(j) why the above codes show the following error. and how to overcome it. Traceback (most recent call last): File pyshell#10, line 3, in module a[i].append(j)

Re: Strong typing vs. strong testing

2010-10-11 Thread Vic Kelson
On Sep 28, 10:55 am, Tim Bradshaw t...@tfeb.org wrote: There's a large existing body of knowledge on dimensional analysis (it's a very important tool for physics, for instance), and obviously the answer is to do whatever it does.  Raising to any power is fine, I think (but transcendental

Re: emdding python gui in c code - OS independent

2010-10-11 Thread tinauser
On Oct 11, 6:49 pm, Chris Rebert c...@rebertia.com wrote: On Mon, Oct 11, 2010 at 6:16 AM, tinauser tinau...@libero.it wrote: hi there, i need to embed python GUI in a c++ code. I've seen that,while on windows running GUI is no problem, in mac i need to use pythonw instead python. the

char buffer type not available error while gunzip

2010-10-11 Thread Istvan Gouritz
Hello! I'm getting exception while trying to gunzip data, which is stored in db: File helper.py, line 33, in gunzip f = StringIO(data) exceptions.TypeError: char buffer type not available function which does gunzipping: def gunzip(s): print type(data)) #prints

Re: logging.handlers.SMTPHandler and fileConfig

2010-10-11 Thread Chris Withers
On 11/10/2010 15:52, pstatham wrote: I'm trying to use pythons logging.handlers.SMTPHandler with a configuration file (so that I don't have to have passwords etc. inside of the script) Use MailingLogger and ZConfig ;-)

How is correct use of eval()

2010-10-11 Thread Cata
Hi . I read about eval(). I also read about this bug : cod = raw_input ('Enter:) eval (cod) if i use rm -rf ~ all files will be deleted . What is correct way to use this function? Thank's -- http://mail.python.org/mailman/listinfo/python-list

Re: How is correct use of eval()

2010-10-11 Thread Chris Rebert
On Mon, Oct 11, 2010 at 11:11 AM, Cata catalinf...@gmail.com wrote: Hi . I read about eval(). I also read about this bug : cod = raw_input ('Enter:) eval (cod) if i use  rm -rf ~  all files will be deleted . That's incorrect. eval() does not (directly) run shell commands. It does evaluate

Re: Adding to an Array inside a Dict

2010-10-11 Thread MRAB
On 11/10/2010 15:55, MacOSX @ Rocteur.cc wrote: Hi, Is there an easier way to do this, I am adding/creating to an array inside a dict but can find a cleaner way: So I first check if the key exists already, if it does then I know I use append, if it does not I create it. if

Re: emdding python gui in c code - OS independent

2010-10-11 Thread Diez B. Roggisch
tinauser tinau...@libero.it writes: On Oct 11, 6:49 pm, Chris Rebert c...@rebertia.com wrote: On Mon, Oct 11, 2010 at 6:16 AM, tinauser tinau...@libero.it wrote: hi there, i need to embed python GUI in a c++ code. I've seen that,while on windows running GUI is no problem, in mac i need to

Re: help!!!

2010-10-11 Thread Robert Kern
On 10/11/10 11:44 AM, Jason Swails wrote: On Mon, Oct 11, 2010 at 11:11 AM, Robert Kern robert.k...@gmail.com mailto:robert.k...@gmail.com wrote: On 10/11/10 8:44 AM, Jason Swails wrote: On Mon, Oct 11, 2010 at 9:25 AM, Andreas Waldenburger use...@geekmail.invalid

Re: How is correct use of eval()

2010-10-11 Thread Robert Kern
On 10/11/10 1:11 PM, Cata wrote: Hi . I read about eval(). I also read about this bug : cod = raw_input ('Enter:) eval (cod) if i use rm -rf ~ all files will be deleted . What is correct way to use this function? There are cases when you are writing meta-programming tools for programmers.

Re: help!!!

2010-10-11 Thread Jason Swails
On Mon, Oct 11, 2010 at 3:05 PM, Robert Kern robert.k...@gmail.com wrote: On 10/11/10 11:44 AM, Jason Swails wrote: On Mon, Oct 11, 2010 at 11:11 AM, Robert Kern robert.k...@gmail.com mailto:robert.k...@gmail.com wrote: On 10/11/10 8:44 AM, Jason Swails wrote: On Mon, Oct

Re: harmful str(bytes)

2010-10-11 Thread Hallvard B Furuseth
Terry Reedy writes: On 10/8/2010 9:31 AM, Hallvard B Furuseth wrote: That's not the point - the point is that for 2.* code which _uses_ str vs unicode, the equivalent 3.* code uses str vs bytes. Yet not the same way - a 2.* 'str' will sometimes be 3.* bytes, sometime str. So upgraded old

Re: Adding to an Array inside a Dict

2010-10-11 Thread Robert Kern
On 10/11/10 1:29 PM, MRAB wrote: On 11/10/2010 15:55, MacOSX @ Rocteur.cc wrote: Hi, Is there an easier way to do this, I am adding/creating to an array inside a dict but can find a cleaner way: So I first check if the key exists already, if it does then I know I use append, if it does not I

Re: help!!!

2010-10-11 Thread Emile van Sebille
On 10/11/2010 12:11 PM Jason Swails said... But tabs ARE spaces (specifically 3 of them), in a row ;) Hoo boy Duckingly, Emile -- http://mail.python.org/mailman/listinfo/python-list

Re: harmful str(bytes)

2010-10-11 Thread Hallvard B Furuseth
Antoine Pitrou writes: Hallvard B Furuseth h.b.furus...@usit.uio.no wrote: Antoine Pitrou writes: Hallvard B Furuseth h.b.furus...@usit.uio.no wrote: The offender is bytes.__str__: str(b'foo') == b'foo'. It's often not clear from looking at a piece of code whether some data is treated as

Re: Difficulty in easy_install

2010-10-11 Thread Diez B. Roggisch
sankalp srivastava richi18...@gmail.com writes: I am having difficulty in easy_installing I use a proxy server and strange errors , like it can't fetch the package is showing up . the package is pyspeech ...please help me :( I don't know if the proxy server is causing the problems , in

Re: Adding to an Array inside a Dict

2010-10-11 Thread Arnaud Delobelle
MRAB pyt...@mrabarnett.plus.com writes: On 11/10/2010 15:55, MacOSX @ Rocteur.cc wrote: Hi, Is there an easier way to do this, I am adding/creating to an array inside a dict but can find a cleaner way: So I first check if the key exists already, if it does then I know I use append, if it

Standardizing RPython - it's time.

2010-10-11 Thread John Nagle
It may be time to standardize RPython. There are at least three implementations of RPython variants - PyPy, Shed Skin, and RPython for LLVM. The first two are up and running. There's a theory paper on the subject:

Python deadlocks when Popen in multithread.

2010-10-11 Thread INADA Naoki
On Ubuntu 10.10 amd64 and dual-core CPU, following code deadlocks. What's wrong on this code? #http://codepad.org/GkoXHbik #!/usr/bin/env python from subprocess import * from threading import * THREAD_COUNT=50 def worker(): p = Popen([cat], stdin=PIPE, stdout=PIPE, stderr=STDOUT) out

Re: harmful str(bytes)

2010-10-11 Thread Stefan Behnel
Hallvard B Furuseth, 11.10.2010 21:50: Antoine Pitrou writes: 2) some unicode objects didn't have a succesful str() Python 3 fixes both these issues. Fixing 1) means there's no automatic coercion when trying to mix bytes and unicode. Fine, so programs will have to do it themselves... Yes,

Re: Standardizing RPython - it's time.

2010-10-11 Thread Jed Smith
On Mon, Oct 11, 2010 at 4:01 PM, John Nagle na...@animats.com wrote: file:///C:/Users/nagle/AppData/Local/Temp/shedskin-tutorial-0.3.html This gives me a 404. Your Web server is broken! Fix it! ;) Temporarily mirrored: http://jedsmith.org/tmp/shedskin-tutorial-0.5.html -- Jed Smith

Re: Python deadlocks when Popen in multithread.

2010-10-11 Thread Jed Smith
On Mon, Oct 11, 2010 at 4:19 PM, INADA Naoki songofaca...@gmail.com wrote: def worker():    p = Popen([cat], stdin=PIPE, stdout=PIPE, stderr=STDOUT)    out = p.communicate(hoge)[0]    print %s %s % (current_thread().name, out) If, instead of spawning workers you directly call worker(), does

Re: Standardizing RPython - it's time.

2010-10-11 Thread John Nagle
On 10/11/2010 1:01 PM, John Nagle wrote: (Correct Shed Skin tutorial link) Shed Skin: http://shedskin.googlecode.com/files/shedskin-tutorial-0.3.html -- http://mail.python.org/mailman/listinfo/python-list

urllib2 script slowing and stopping

2010-10-11 Thread Dantium
I have a small script that reads several CSV files in a directory and puts the data in a DB using Django. There are about 1.7 million records in 120 CSV files, I am running the script on a VPS with about 512mb of memory python 2.6.5 on ubuntu 10.04. The script gets slow and seems to lock after

Re: help!!!

2010-10-11 Thread Seebs
On 2010-10-11, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message slrniaqm69.28f8.usenet-nos...@guild.seebs.net, Seebs wrote: ... but I wasn't aware that it had been deprecated, except in the sense of being derided and dismissed as of no value. What more did you want? :)

Re: Standardizing RPython - it's time.

2010-10-11 Thread Ryan Kelly
On Mon, 2010-10-11 at 13:01 -0700, John Nagle wrote: It may be time to standardize RPython. There are at least three implementations of RPython variants - PyPy, Shed Skin, and RPython for LLVM. The first two are up and running. There's a theory paper on the subject:

Re: urllib2 script slowing and stopping

2010-10-11 Thread Ian
On Oct 11, 2:48 pm, Dantium dan...@gmail.com wrote: I have a small script that reads several CSV files in a directory and puts the data in a DB using Django. There are about 1.7 million records in 120 CSV files, I am running the script on a VPS with about 512mb of memory python 2.6.5 on

Re: help!!!

2010-10-11 Thread geremy condra
On Mon, Oct 11, 2010 at 12:11 PM, Jason Swails jason.swa...@gmail.com wrote: On Mon, Oct 11, 2010 at 3:05 PM, Robert Kern robert.k...@gmail.com wrote: On 10/11/10 11:44 AM, Jason Swails wrote: On Mon, Oct 11, 2010 at 11:11 AM, Robert Kern robert.k...@gmail.com mailto:robert.k...@gmail.com

Re: help!!!

2010-10-11 Thread Jed Smith
On Mon, Oct 11, 2010 at 5:02 PM, Seebs usenet-nos...@seebs.net wrote: and something like scanf(), where I've never heard of a compiler doing anything of the sort. By default, MSVC complains hard enough when using scanf() to make you regret it (I think? been a while). -- Jed Smith

RE: Unicode Decode Error

2010-10-11 Thread Pratik Khemka
This is the original full traceback. when I was getting the Unicode Decode Error.. Traceback (most recent call last): File C:\Documents and Settings\pkhemka\My Documents\merge_py.py, line 315, i n module wbk.save('p4_merge.xls') File C:\Python25\lib\site-packages\xlwt\Workbook.py,

Re: harmful str(bytes)

2010-10-11 Thread Hallvard B Furuseth
Terry Reedy writes: On 10/8/2010 9:45 AM, Hallvard B Furuseth wrote: Actually, the implicit contract of __str__ is that it never fails, so that everything can be printed out (for debugging purposes, etc.). Nope: $ python2 -c 'str(u\u1000)' Traceback (most recent call last): File string,

Re: harmful str(bytes)

2010-10-11 Thread Hallvard B Furuseth
Stefan Behnel writes: Hallvard B Furuseth, 11.10.2010 21:50: Fine, so programs will have to do it themselves... Yes, they can finally handle bytes and Unicode data correctly and safely. Having byte data turn into Unicode strings unexpectedly makes the behaviour of your code hardly predictable

Re: EOF while scanning triple-quoted string literal

2010-10-11 Thread Rhodri James
On Mon, 11 Oct 2010 10:37:09 +0100, bussiere bussiere bussi...@gmail.com wrote: i've looked on the web and here but i didn't find an answer : here is my code zlib.decompress( xワᆳヤ=ラᄇHナs~Ʀᄑç\ムîà z...@ÑÁÔqÇlxÇÆïpp~ývãì゙m6ÛÐ|ê֭ᄁᄂヤ=)}éÓUe﬿ö3ᄎᄌú}ʿïÿ÷1þ8ñ́U÷ᄏñíLÒVi:`ᄈᄎL!Ê҆p6-%Fë^ヘ÷à,Q.K!ユô`ÄA!ÑêweÌ

Re: Unicode Decode Error

2010-10-11 Thread Ian Kelly
On Mon, Oct 11, 2010 at 3:44 PM, Pratik Khemka pratikkhe...@hotmail.comwrote: I tried to solve it using this *wbk = xlwt.Workbook('utf-8')... *The problem still persists. Is there a way I can solve this problem..? *Traceback (most recent call last): File C:\Documents and

Re: harmful str(bytes)

2010-10-11 Thread Antoine Pitrou
On Mon, 11 Oct 2010 21:50:32 +0200 Hallvard B Furuseth h.b.furus...@usit.uio.no wrote: I'd just posted an example in article hbf.20101008c...@bombur.uio.no: urllib.parse.urlunparse(('', '', '/foo', b'bar', '', '')) returns /foo;b'bar' instead of raising an exception or returning 2.6's

Re: EOF while scanning triple-quoted string literal

2010-10-11 Thread Ian Kelly
On Mon, Oct 11, 2010 at 3:59 PM, Rhodri James rho...@wildebst.demon.co.ukwrote: On Mon, 11 Oct 2010 10:37:09 +0100, bussiere bussiere bussi...@gmail.com wrote: i've looked on the web and here but i didn't find an answer : here is my code zlib.decompress( xワᆳヤ=ラᄇHナs~Ʀᄑç\ムîà

Re: Class-level variables - a scoping issue

2010-10-11 Thread Ixokai
On 10/9/10 10:30 PM, John Nagle wrote: Python protects global variables from similar confusion by making them read-only when referenced from an inner scope without a global statement. No. It doesn't. Assignments simply always apply to local variables, unless you explicitly indicate

Re: urllib2 script slowing and stopping

2010-10-11 Thread Dantium
On Oct 11, 10:07 pm, Ian ian.g.ke...@gmail.com wrote: On Oct 11, 2:48 pm, Dantium dan...@gmail.com wrote: I have a small script that reads several CSV files in a directory and puts the data in a DB using Django. There are about 1.7 million records in 120 CSV files, I am running the

Re: Missing modules for python

2010-10-11 Thread Steven D'Aprano
On Mon, 11 Oct 2010 10:32:44 -0400, Jed Smith wrote: simplejson got merged into the standard library in Python 2.6. In libcloud, I wrote this: try: import json except ImportError, excp: import simplejson as json I'm curious why you bother to bind the exception to the excp when you

Re: How is correct use of eval()

2010-10-11 Thread Steven D'Aprano
On Mon, 11 Oct 2010 11:18:37 -0700, Chris Rebert wrote: On Mon, Oct 11, 2010 at 11:11 AM, Cata catalinf...@gmail.com wrote: Hi . I read about eval(). I also read about this bug : cod = raw_input ('Enter:) eval (cod) if i use  rm -rf ~  all files will be deleted . That's incorrect.

Re: help!!!

2010-10-11 Thread Steven D'Aprano
On Mon, 11 Oct 2010 10:11:37 -0500, Robert Kern wrote: On 10/11/10 8:44 AM, Jason Swails wrote: On Mon, Oct 11, 2010 at 9:25 AM, Andreas Waldenburger use...@geekmail.invalid wrote: On Mon, 11 Oct 2010 23:51:46 +1300 Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote:

Re: help!!!

2010-10-11 Thread Robert Kern
On 10/11/10 6:17 PM, Steven D'Aprano wrote: On Mon, 11 Oct 2010 10:11:37 -0500, Robert Kern wrote: On 10/11/10 8:44 AM, Jason Swails wrote: On Mon, Oct 11, 2010 at 9:25 AM, Andreas Waldenburger use...@geekmail.invalid wrote: On Mon, 11 Oct 2010 23:51:46 +1300 Lawrence D'Oliveiro

  1   2   >