Re: Python error codes and messages location

2013-05-28 Thread Fábio Santos
On 29 May 2013 00:44, "Dennis Lee Bieber" wrote: > > On Tue, 28 May 2013 17:15:51 +1000, Chris Angelico > declaimed the following in gmane.comp.python.general: > > > > Can we internationalize English instead of localizing Python? > > > > Not-entirely-joking-ly yours, > > > All that is req

Re: How to: Setuptools

2013-05-28 Thread ray
On Monday, May 27, 2013 8:32:43 PM UTC-5, ray wrote: > I would like to use easy_install, but can't figure out how to install it. > > > > I have 64-bit Python 2.7.5 on Windows 7. > > > > Following the instructions on https://pypi.python.org/pypi/setuptools, it > says: > > Download ez_setup

Re: Python #ifdef

2013-05-28 Thread Dan Stromberg
Here're slides from a presentation about writing code that runs on 2.x and 3.x: http://stromberg.dnsalias.org/~dstromberg/Intro-to-Python/ And in case you still want a preprocessor for Python (you likely don't need one this time), here's an example of doing this using the venerable m4: https://pyp

Supporting both 2.x and 3.x in one code base [was Re: Python #ifdef]

2013-05-28 Thread Steven D'Aprano
On Tue, 28 May 2013 18:25:59 -0400, Joel Goldstick wrote: > I wonder > if it is a good idea in general to try to write code like this. -- > combined 2.x/3.x codebase can be a bear to maintain. Not so much a bear as a tiny little kitten. > I wouldn't do it > unless there was some imposing reaso

Re: Python #ifdef

2013-05-28 Thread Terry Jan Reedy
On 5/28/2013 6:25 PM, Joel Goldstick wrote: On Tue, May 28, 2013 at 6:18 PM, Mark Lawrence mailto:breamore...@yahoo.co.uk>> wrote: On 28/05/2013 20:46, Carlos Nepomuceno wrote: I'd like to have something like '#ifdef' to mix code from Python 2 and 3 in a single file.

Re: Future standard GUI library

2013-05-28 Thread 88888 Dihedral
Grant Edwards於 2013年5月29日星期三UTC+8上午2時25分08秒寫道: > On 2013-05-28, Wolfgang Keller wrote: > > > > > Actually productive work of significant intensity at a computer screen. > > > > Oh. You mean emacs. > > > > -- > > Grant Edwards grant.b.edwardsYow! Will it improve my

Re: Python #ifdef

2013-05-28 Thread 88888 Dihedral
Carlos Nepomuceno於 2013年5月29日星期三UTC+8上午3時46分37秒寫道: > Are there Python 'preprocessor directives'? > > I'd like to have something like '#ifdef' to mix code from Python 2 and 3 in a > single file. > > Is that possible? How? Use execfile(filename) at the beginning to get what you want. The .pyc ver

RE: Python #ifdef

2013-05-28 Thread Fábio Santos
On 28 May 2013 21:53, "Carlos Nepomuceno" wrote: > > > > Date: Tue, 28 May 2013 21:34:36 +0100 > > Subject: RE: Python #ifdef > > From: fabiosantos...@gmail.com > > To: carlosnepomuc...@outlook.com > > CC: python-list@python.org > > > > > > On 28 May 2013 21:26, "C

RE: Python #ifdef

2013-05-28 Thread Carlos Nepomuceno
> Date: Tue, 28 May 2013 18:25:59 -0400 > Subject: Re: Python #ifdef > From: joel.goldst...@gmail.com > To: breamore...@yahoo.co.uk > CC: python-list@python.org [...] > > my original response was from cell phone. I just answered that you > can't do ifdefs,

Re: Python #ifdef

2013-05-28 Thread Joel Goldstick
On Tue, May 28, 2013 at 6:18 PM, Mark Lawrence wrote: > On 28/05/2013 20:46, Carlos Nepomuceno wrote: > >> Are there Python 'preprocessor directives'? >> >> I'd like to have something like '#ifdef' to mix code from Python 2 and 3 >> in a single file. >> >> Is that possible? How? >> >> > https://py

Re: Python #ifdef

2013-05-28 Thread Mark Lawrence
On 28/05/2013 20:46, Carlos Nepomuceno wrote: Are there Python 'preprocessor directives'? I'd like to have something like '#ifdef' to mix code from Python 2 and 3 in a single file. Is that possible? How? https://pypi.python.org/pypi/six/1.3.0 -- If you're

RE: Future standard GUI library

2013-05-28 Thread Carlos Nepomuceno
> From: felip...@gmx.net > Subject: Re: Future standard GUI library > Date: Tue, 28 May 2013 19:26:55 +0200 > To: python-list@python.org > >> Please give me an example of a "suitable transport layer for a RPC >> protocol". > > I won't give you an example, bu

Re: How to: Setuptools

2013-05-28 Thread Michael Herman
I have a great video on how to setup Easy_Install via setuptools as well as pip - http://www.youtube.com/watch?v=MIHYflJwyLk On Mon, May 27, 2013 at 6:32 PM, ray wrote: > > I would like to use easy_install, but can't figure out how to install it. > > I have 64-bit Python 2.7.5 on Windows 7. > > F

RE: Python #ifdef

2013-05-28 Thread Carlos Nepomuceno
> From: invalid@invalid.invalid > Subject: Re: Python #ifdef > Date: Tue, 28 May 2013 20:42:34 + > To: python-list@python.org [...] > Here's the important lesson from this thread: > > Instead of asking "how do I write X in Python" where yoy've assumed X

RE: Python #ifdef

2013-05-28 Thread Carlos Nepomuceno
> Date: Tue, 28 May 2013 21:34:36 +0100 > Subject: RE: Python #ifdef > From: fabiosantos...@gmail.com > To: carlosnepomuc...@outlook.com > CC: python-list@python.org > > > On 28 May 2013 21:26, "Carlos Nepomuceno" > mailto:carlosnepomuc...@outlook.com>>

Re: Python #ifdef

2013-05-28 Thread Grant Edwards
On 2013-05-28, Carlos Nepomuceno wrote: > [...] >> You're trying to make this a lot harder than it really is: >> >> if sys.version_info[0] == 3: >> def original(n): >> m = 0 >> for b in n.to_bytes(6, 'big'): >> m = 256*m + b >> return m >> else: >> def original(n): >> > > Haha! That's it!!! > >

RE: Python #ifdef

2013-05-28 Thread Fábio Santos
On 28 May 2013 21:26, "Carlos Nepomuceno" wrote: > Haha! That's it!!! > > Just realized how funny this can be: ;) > > ### never to be opened ### > def pandoras_box(v): > return v/0.0 > > if customer_didnt_pay(): > pandoras_box() > > #lol 1/0 is, after print, my most common debug statement

PyDev 2.7.5 Released

2013-05-28 Thread Fabio Zadrozny
Hi All, PyDev 2.7.5 has been released Details on PyDev: http://pydev.org Details on its development: http://pydev.blogspot.com Release Highlights: --- * Icons in the outline are now correct. * Fixed deadlock found on code analysis. * Project-related error markers n

RE: Python #ifdef

2013-05-28 Thread Carlos Nepomuceno
> From: invalid@invalid.invalid > Subject: Re: Python #ifdef [...] > You're trying to make this a lot harder than it really is: > > if sys.version_info[0] == 3: > def original(n): > m = 0 > for b in n.to_bytes(6, 'big'): > m = 256*m + b > return m > else: >

RE: Python #ifdef

2013-05-28 Thread Benjamin Kaplan
On May 28, 2013 1:10 PM, "Carlos Nepomuceno" wrote: > > Thank you! I made it run like the following. What do you think about that? IS there a better way? > > > > #The following runs on Python 2.7 > sc3=''' > # Python 3 > def original(n): > m = 0 > for b in n.to_bytes(6, 'big'): > m

Re: Python #ifdef

2013-05-28 Thread Grant Edwards
On 2013-05-28, Carlos Nepomuceno wrote: > Thank you! I made it run like the following. What do you think about > that? IS there a better way? > > #The following runs on Python 2.7 > sc3=''' > # Python 3 > def original(n): > ??? m = 0 > ??? for b in n.to_bytes(6, 'big'): > ??? m = 256*m + b >

RE: Python #ifdef

2013-05-28 Thread Carlos Nepomuceno
Thank you! I made it run like the following. What do you think about that? IS there a better way? #The following runs on Python 2.7 sc3=''' # Python 3 def original(n):     m = 0     for b in n.to_bytes(6, 'big'):     m = 256*m + b     return m ''' if sys.version_info[0] == 3:     exec(sc3)

Re: Python #ifdef

2013-05-28 Thread Neil Cerutti
On 2013-05-28, Joel Goldstick wrote: > > No Yes. More below. > On May 28, 2013 3:48 PM, "Carlos Nepomuceno" > wrote: >> Are there Python 'preprocessor directives'? >> >> I'd like to have something like '#ifdef' to mix code from Python 2 and 3 >> in a single file. >> >> Is that possible? How? Y

Re: Python #ifdef

2013-05-28 Thread Dave Angel
On 05/28/2013 03:46 PM, Carlos Nepomuceno wrote: Are there Python 'preprocessor directives'? Python doesn't define a preprocessor, and CPYthon doesn't implement one. Nothing to stop you from doing so, however. I'd like to have something like '#ifdef' to mix code from Python 2 and 3 in a si

Re: Python #ifdef

2013-05-28 Thread Joel Goldstick
No On May 28, 2013 3:48 PM, "Carlos Nepomuceno" wrote: > Are there Python 'preprocessor directives'? > > I'd like to have something like '#ifdef' to mix code from Python 2 and 3 > in a single file. > > Is that possible? How? > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://

Re: Encodign issue in Python 3.3.1 (once again)

2013-05-28 Thread nagia . retsina
But i think iam gonna fight it some more because mysqldb in python 3 has issues too :( -- http://mail.python.org/mailman/listinfo/python-list

Python #ifdef

2013-05-28 Thread Carlos Nepomuceno
Are there Python 'preprocessor directives'? I'd like to have something like '#ifdef' to mix code from Python 2 and 3 in a single file. Is that possible? How? -- http://mail.python.org/mailman/listinfo/python-list

Re: Encodign issue in Python 3.3.1 (once again)

2013-05-28 Thread nagia . retsina
Τη Τρίτη, 28 Μαΐου 2013 9:19:21 μ.μ. UTC+3, ο χρήστης Michael Torrie έγραψε: > On 05/28/2013 12:08 PM, nagia.rets...@gmail.com wrote: > > > Τη Τρίτη, 28 Μαΐου 2013 8:17:05 μ.μ. UTC+3, ο χρήστης Michael Torrie > > > έγραψε: > > > > > >> Basically you want pelatologio.py to run and then you proc

Re: String object has no attribute "append"

2013-05-28 Thread Ian Kelly
On Tue, May 28, 2013 at 12:41 PM, Ian Kelly wrote: > On Tue, May 28, 2013 at 12:25 PM, Matt Graves wrote: >> I receive this error while toying around with Functions... >> >> def pulldata(speclist,speccolumn): >> with open('profiles.csv', 'r') as f: >> reader = csv.reader(f) >>

Re: String object has no attribute "append"

2013-05-28 Thread Ian Kelly
On Tue, May 28, 2013 at 12:25 PM, Matt Graves wrote: > I receive this error while toying around with Functions... > > def pulldata(speclist,speccolumn): > with open('profiles.csv', 'r') as f: > reader = csv.reader(f) > for column in reader: > (specl

Re: String object has no attribute "append"

2013-05-28 Thread mar...@python.net
On Tue, May 28, 2013, at 02:25 PM, Matt Graves wrote: > I receive this error while toying around with Functions... > > def pulldata(speclist,speccolumn): > with open('profiles.csv', 'r') as f: > reader = csv.reader(f) > for column in reader: > (sp

String object has no attribute "append"

2013-05-28 Thread Matt Graves
I receive this error while toying around with Functions... def pulldata(speclist,speccolumn): with open('profiles.csv', 'r') as f: reader = csv.reader(f) for column in reader: (speclist).append(column[('speccolumn')]) pulldata(speclist = 'numbers',

Re: Future standard GUI library

2013-05-28 Thread Grant Edwards
On 2013-05-28, Wolfgang Keller wrote: > Actually productive work of significant intensity at a computer screen. Oh. You mean emacs. -- Grant Edwards grant.b.edwardsYow! Will it improve my at CASH FLOW?

Re: Encodign issue in Python 3.3.1 (once again)

2013-05-28 Thread Michael Torrie
On 05/28/2013 12:08 PM, nagia.rets...@gmail.com wrote: > Τη Τρίτη, 28 Μαΐου 2013 8:17:05 μ.μ. UTC+3, ο χρήστης Michael Torrie > έγραψε: > >> Basically you want pelatologio.py to run and then you process the >> output through a template, correct? > > That is correct. > >> Inside pelatologio.py th

Re: Encodign issue in Python 3.3.1 (once again)

2013-05-28 Thread nagia . retsina
Τη Τρίτη, 28 Μαΐου 2013 8:17:05 μ.μ. UTC+3, ο χρήστης Michael Torrie έγραψε: > Basically you want pelatologio.py to run and then you process the output > through a template, correct? That is correct. > Inside pelatologio.py > there is some object that you are trying to reference the "id" attribu

Re: Future standard GUI library

2013-05-28 Thread Michael Torrie
On 05/28/2013 11:26 AM, Wolfgang Keller wrote: >> Please give me an example of a "suitable transport layer for a RPC >> protocol". > > I won't give you an example, but just some very basic criteria: > > - It must be very efficient for very small "datagrams" I

Re: Encodign issue in Python 3.3.1 (once again)

2013-05-28 Thread Joel Goldstick
On Tue, May 28, 2013 at 2:08 PM, wrote: > Τη Τρίτη, 28 Μαΐου 2013 8:17:05 μ.μ. UTC+3, ο χρήστης Michael Torrie > έγραψε: > > > Basically you want pelatologio.py to run and then you process the output > > through a template, correct? > > That is correct. > > > Inside pelatologio.py > > there is so

ANN: python-ldap 2.4.11

2013-05-28 Thread Michael Ströder
Find a new release of python-ldap: http://pypi.python.org/pypi/python-ldap/2.4.11 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 st

Re: Reading *.json from URL - json.loads() versus urllib.urlopen.readlines()

2013-05-28 Thread Alister
On Tue, 28 May 2013 08:31:35 +0100, Fábio Santos wrote: > On 28 May 2013 04:19, "Bryan Britten" wrote: >> I'm not familiar with using read(4096), I'll have to look into that. >> When > I tried to just save the file, my computer just sat in limbo for some > time and didn't seem to want to process

Re: Future standard GUI library

2013-05-28 Thread Wolfgang Keller
> What is "screenwork"? Actually productive work of significant intensity at a computer screen. As opposed to leisurely "clicking around" like managers, administrators or home users (gaming, "webbing",...) do. Sincerely, Wolfgang -- http://mail.python.org/mailman/listinfo/python-list

Re: Future standard GUI library

2013-05-28 Thread Wolfgang Keller
> Please give me an example of a "suitable transport layer for a RPC > protocol". I won't give you an example, but just some very basic criteria: - It must be very efficient for very small "datagrams" - It must provide connections - For asynchronous programmi

usage of os.posix_fadvise

2013-05-28 Thread Wolfgang Maier
Dear all, I was just experimenting for the first time with os.posix_fadvise(), which is new in Python3.3 . I'm reading from a really huge file (several GB) and I want to use the data only once, so I don't want OS-level page caching. I tried os.posix_fadvise with the os.POSIX_FADV_NOREUSE and with t

Re: Encodign issue in Python 3.3.1 (once again)

2013-05-28 Thread Michael Torrie
On 05/28/2013 10:45 AM, Νίκος Γκρ33κ wrote: > con = pymysql.connect( db = 'pelatologio', host = 'localhost', user = > 'blabla', passwd = 'blabla', init_command='SET NAMES UTF8', charset = 'utf-8' > ) > > produces this "God knows what" error traceback Hey at least your database code is now w

Re: IndentationError: expected an indented block but it's there

2013-05-28 Thread Peter Otten
Chris Angelico wrote: > On Wed, May 29, 2013 at 2:19 AM, Peter Otten <__pete...@web.de> wrote: >> Solution: configure your editor to use four spaces for indentation. > > ITYM eight spaces. I meant: one hit of the Tab key should add spaces up to the next multiple of four. Which implies > But t

Re: Encodign issue in Python 3.3.1 (once again)

2013-05-28 Thread Νίκος Γκρ33κ
con = pymysql.connect( db = 'pelatologio', host = 'localhost', user = 'blabla', passwd = 'blabla', init_command='SET NAMES UTF8', charset = 'utf-8' ) produces this "God knows what" error traceback /home/nikos/public_html/cgi-bin/metrites.py in () 217 template = htmldata

Re: Encodign issue in Python 3.3.1 (once again)

2013-05-28 Thread Michael Torrie
On 05/28/2013 10:00 AM, Νίκος Γκρ33κ wrote: > I do not know here to find connections.py Michael. It's part of the pymysql package that you installed. Look in there (the traceback even shows you where the file is). But you actually don't even need to look at it on your server. You can see the so

Re: IndentationError: expected an indented block but it's there

2013-05-28 Thread Chris Angelico
On Wed, May 29, 2013 at 2:19 AM, Peter Otten <__pete...@web.de> wrote: > Solution: configure your editor to use four spaces for indentation. ITYM eight spaces. But the real solution is to not mix tabs and spaces. Stick to one or the other and you're safe. ChrisA -- http://mail.python.org/mailman

Re: Encodign issue in Python 3.3.1 (once again)

2013-05-28 Thread MRAB
On 28/05/2013 17:00, Νίκος Γκρ33κ wrote: I do not know here to find connections.py Michael. But i do not understand since iam suing the following 2 statements, why a unicode error remains. #needed line, script does *not* work without it sys.stdout = os.fdopen(1, 'w', encoding='utf-8') # conne

Re: IndentationError: expected an indented block but it's there

2013-05-28 Thread Peter Otten
JackM wrote: > Having a problem getting a py script to execute. Got this error: > > File "/scripts/blockIPv4.py", line 19 > ip = line.split(';')[0] > ^ > IndentationError: expected an indented block > > > I'm perplexed because the code that the error refers to *is* indented: > > >

Re: How to get an integer from a sequence of bytes

2013-05-28 Thread Grant Edwards
On 2013-05-27, Mok-Kong Shen wrote: > From an int one can use to_bytes to get its individual bytes, > but how can one reconstruct the int from the sequence of bytes? One way is using the struct module. -- Grant Edwards grant.b.edwardsYow! Uh-oh!! I forgot

Re: Encodign issue in Python 3.3.1 (once again)

2013-05-28 Thread Νίκος Γκρ33κ
I do not know here to find connections.py Michael. But i do not understand since iam suing the following 2 statements, why a unicode error remains. #needed line, script does *not* work without it sys.stdout = os.fdopen(1, 'w', encoding='utf-8') # connect to database con = pymysql.connect( db =

Re: Making safe file names

2013-05-28 Thread Grant Edwards
On 2013-05-28, Albert van der Horst wrote: >> There's also the Windows device name hole. There may be trouble with >> artists named 'COM4', 'CLOCK$', 'Con', or similar. >> >>http://support.microsoft.com/kb/74496 > > That applies to MS-DOS names. God forbid that this still holds on > more modern M

Re: how to compare two json file line by line using python?

2013-05-28 Thread Grant Edwards
On 2013-05-27, Steven D'Aprano wrote: > On Sun, 26 May 2013 21:32:40 -0700, Avnesh Shakya wrote: > >> But I want to compare line by line and value by value. but i found that >> json data is unordered data, so how can i compare them without sorting >> it. please give me some idea about it. I am new

Re: IndentationError: expected an indented block but it's there

2013-05-28 Thread Steven D'Aprano
On Tue, 28 May 2013 11:32:06 -0400, JackM wrote: > Having a problem getting a py script to execute. Got this error: > > File "/scripts/blockIPv4.py", line 19 > ip = line.split(';')[0] > ^ > IndentationError: expected an indented block > > > I'm perplexed because the code that the err

Re: Short-circuit Logic

2013-05-28 Thread Steven D'Aprano
On Tue, 28 May 2013 15:14:03 +, Grant Edwards wrote: > On 2013-05-28, Steven D'Aprano > wrote: >> On Tue, 28 May 2013 01:39:09 -0700, Ahmed Abdulshafy wrote: >> >>> He just said that the way to test for zero equality is x == 0, and I >>> meant that this is true for integers but not necessaril

Re: IndentationError: expected an indented block but it's there

2013-05-28 Thread Michael Torrie
On 05/28/2013 09:32 AM, JackM wrote: > Having a problem getting a py script to execute. Got this error: > > File "/scripts/blockIPv4.py", line 19 > ip = line.split(';')[0] > ^ > IndentationError: expected an indented block > I'm perplexed because the code that the error refers to *is* i

Re: Future standard GUI library

2013-05-28 Thread Grant Edwards
On 2013-05-26, Roy Smith wrote: > Michael Torrie wrote: > >> On good thing web development has brought us is the knowledge that >> modularization and layers are a brilliant idea. > > Modularization and layers were a brilliant idea long before the web came > around. Once again USENET proves to

Re: Output from to_bytes

2013-05-28 Thread Grant Edwards
On 2013-05-26, Mok-Kong Shen wrote: > I don't understand why with the code: > > for k in range(8,12,1): > print(k.to_bytes(2,byteorder='big')) > > one gets the following output: > > b'\x00\x08' > b'\x00\t' > b'\x00\n' > b'\x00\x0b' > > I mean the 2nd and 3rd should be b'\

IndentationError: expected an indented block but it's there

2013-05-28 Thread JackM
Having a problem getting a py script to execute. Got this error: File "/scripts/blockIPv4.py", line 19 ip = line.split(';')[0] ^ IndentationError: expected an indented block I'm perplexed because the code that the error refers to *is* indented: with open('/var/www/html/mydomain.com/

Re: Python error codes and messages location

2013-05-28 Thread Fábio Santos
On 28 May 2013 09:22, "Chris Angelico" wrote: > > On Tue, May 28, 2013 at 6:10 PM, Fábio Santos wrote: > > Just to clarify, I am suggesting to have the unchanged messages in > > tracebacks, but having some methods in the exception to get the exception > > and message localised. Just like repr() a

Re: Short-circuit Logic

2013-05-28 Thread Grant Edwards
On 2013-05-28, Steven D'Aprano wrote: > On Tue, 28 May 2013 01:39:09 -0700, Ahmed Abdulshafy wrote: > >> He just said that the way to test for zero equality is x == 0, and I >> meant that this is true for integers but not necessarily for floats. And >> that's not specific to Python. > > Can you sh

Re: Text-to-Sound or Vice Versa (Method NOT the source code)

2013-05-28 Thread Grant Edwards
On 2013-05-25, Rakshith Nayak wrote: > Always wondered how sound is generated from text. Googling couldn't > help. Devs having knowledge about this could provide, the > information, Links, URLs or anything that could help. > > http://www.cstr.ed.ac.uk/projects/festival/ http://code.google.com/p

Re: Reading *.json from URL - json.loads() versus urllib.urlopen.readlines()

2013-05-28 Thread Bryan Britten
Thanks to everyone for the help and insight. I think for now I'll just back away from this file and go back to something much easier to practice with. -- http://mail.python.org/mailman/listinfo/python-list

Re: Encodign issue in Python 3.3.1 (once again)

2013-05-28 Thread Michael Torrie
On 05/27/2013 02:17 PM, Νίκος Γκρ33κ wrote: > I have checked the database through phpMyAdmin and it is indeed UTF-8. > > I have no idea why python 3.3.1 chooses to work with latin-iso only It's not python that is doing this here... If you look at the source code to pymysql, I'm sure you will

Re: Short-circuit Logic

2013-05-28 Thread Chris Angelico
On Tue, May 28, 2013 at 11:48 PM, Steven D'Aprano wrote: > py> y = 1e17 + x # x is not zero, so y should be > 1e17 > py> 1/(1e17 - y) > Traceback (most recent call last): > File "", line 1, in > ZeroDivisionError: float division by zero You don't even need to go for 1e17. By definition: >>>

Re: Short-circuit Logic

2013-05-28 Thread Steven D'Aprano
On Tue, 28 May 2013 01:39:09 -0700, Ahmed Abdulshafy wrote: > He just said that the way to test for zero equality is x == 0, and I > meant that this is true for integers but not necessarily for floats. And > that's not specific to Python. Can you show me a value of x where x == 0.0 returns False,

Re: How to: Setuptools

2013-05-28 Thread rusi
On May 28, 6:40 pm, Mark Lawrence wrote: > On 28/05/2013 14:05, ray wrote: > > > > > The installation fails.  The report stated it could not find the file. > > Per: > > Looking down into the content of ez_setup.py, I find: > > 'setuptools-0.6c10-py2.6.egg': > > but there is no entry > > 'setuptool

Re: Making safe file names

2013-05-28 Thread Chris Angelico
On Tue, May 28, 2013 at 11:44 PM, Albert van der Horst wrote: > In article , > Neil Hodgson wrote: >>There's also the Windows device name hole. There may be trouble with >>artists named 'COM4', 'CLOCK$', 'Con', or similar. >> >>http://support.microsoft.com/kb/74496 > > That applies to MS-DOS

Re: Short-circuit Logic

2013-05-28 Thread Steven D'Aprano
On Mon, 27 May 2013 13:11:28 -0700, Ahmed Abdulshafy wrote: > That may be true for integers, but for floats, testing for equality is > not always precise Incorrect. Testing for equality is always precise, and exact. The problem is not the *equality test*, but that you don't always have the numbe

Re: Making safe file names

2013-05-28 Thread Albert van der Horst
In article , Neil Hodgson wrote: >Andrew Berg: > >> This is not a Unicode issue since (modern) file systems will happily >accept it. The issue is that certain characters (which are ASCII) are >> not allowed on some file systems: >> \ / : * ? "< > | @ and the NUL character >> The first 9 are n

Re: How to: Setuptools

2013-05-28 Thread Mark Lawrence
On 28/05/2013 14:05, ray wrote: The installation fails. The report stated it could not find the file. Per: Looking down into the content of ez_setup.py, I find: 'setuptools-0.6c10-py2.6.egg': but there is no entry 'setuptools-0.6c10-py2.7.egg': Since I am trying to install this for Python 2.7,

Re: How to: Setuptools

2013-05-28 Thread rusi
On May 28, 6:05 pm, ray wrote: > On May 28, 7:26 am, Mark Lawrence wrote: > > > > > > > > > > > On 28/05/2013 13:03, rusi wrote: > > > > On May 28, 6:32 am, ray wrote: > > >> I would like to use easy_install, but can't figure out how to install it. > > > >> I have 64-bit Python 2.7.5 on Windows

Re: Source code as text/plain

2013-05-28 Thread Anssi Saari
Carlos Nepomuceno writes: > I'd like to have the option to download the source code as text/plain from > the docs.python.org pages. > > For example: when I'm a docs page, such as: > > http://docs.python.org/2/library/string.html > > and I click the source code link I'm taken to a Mercurial page:

Re: Python error codes and messages location

2013-05-28 Thread Serhiy Storchaka
28.05.13 11:17, Chris Angelico написав(ла): On Tue, May 28, 2013 at 6:10 PM, Fábio Santos wrote: Just to clarify, I am suggesting to have the unchanged messages in tracebacks, but having some methods in the exception to get the exception and message localised. Just like repr() and str() are dir

Re: How to: Setuptools

2013-05-28 Thread ray
On May 28, 7:26 am, Mark Lawrence wrote: > On 28/05/2013 13:03, rusi wrote: > > > > > > > On May 28, 6:32 am, ray wrote: > >> I would like to use easy_install, but can't figure out how to install it. > > >> I have 64-bit Python 2.7.5 on Windows 7. > > >> Following the instructions onhttps://pypi.

Re: How to: Setuptools

2013-05-28 Thread Mark Lawrence
On 28/05/2013 13:03, rusi wrote: On May 28, 6:32 am, ray wrote: I would like to use easy_install, but can't figure out how to install it. I have 64-bit Python 2.7.5 on Windows 7. Following the instructions onhttps://pypi.python.org/pypi/setuptools, it says: Download ez_setup.py and run it; it

Re: Python for IPSA (Power flow analysis)

2013-05-28 Thread Robert Marshall
On Tue, May 28 2013, Debbie wrote: > Hi there, I am new to Python, and wondering if you could help me with > python based coding for the IPSA (Power system analysis software). I > have a electrical distribution network with generators, buses and > loads, on which I am performing the load flow ana

Re: How to: Setuptools

2013-05-28 Thread rusi
On May 28, 6:32 am, ray wrote: > I would like to use easy_install, but can't figure out how to install it. > > I have 64-bit Python 2.7.5 on Windows 7. > > Following the instructions onhttps://pypi.python.org/pypi/setuptools, it says: > Download ez_setup.py and run it; it will download the appropr

Re: Encodign issue in Python 3.3.1 (once again)

2013-05-28 Thread rusi
On May 28, 10:55 am, Νίκος Γκρ33κ wrote: > Ôç Ôñßôç, 28 ÌáÀïõ 2013 1:18:06 ð.ì. UTC+3, ï ÷ñÞóôçò Chris Angelico Ýãñáøå: > > > You're effectively asking people to put in a few minutes' work, > > sometimes quite a few minutes, to help you. Is it too much to hope > > that you'll spend one more minute

Re: Short-circuit Logic

2013-05-28 Thread Mark Lawrence
On 28/05/2013 09:39, Ahmed Abdulshafy wrote: And that's not specific to Python. Using google products is also not specific to Python. However whereever it's used it's a PITA as people are forced into reading double spaced crap. Please check out the link in my signature. -- If you're usi

Re: Python for IPSA (Power flow analysis)

2013-05-28 Thread Dave Angel
On 05/28/2013 06:00 AM, Debbie wrote: Hi there, I am new to Python, Welcome. Could you tell us a little about yourself, such as whether you've experience in a few other languages, or if Python is your first programming experience? Also, what version of Python (presumably 2.7 or 2.6) and wh

Re: Problems with python and pyQT

2013-05-28 Thread Dave Angel
On 05/28/2013 05:41 AM, silusilus...@gmail.com wrote: Thanks for your reply: very useful!! I have another question: with hex command i display (for example) 0x1 is it possible to display 0x01? hex() is a function, not a command. And it only takes the one parameter, the int to be converted.

Python for IPSA (Power flow analysis)

2013-05-28 Thread Debbie
Hi there, I am new to Python, and wondering if you could help me with python based coding for the IPSA (Power system analysis software). I have a electrical distribution network with generators, buses and loads, on which I am performing the load flow analysis every 1 hour for a period of 1 year.

Re: Problems with python and pyQT

2013-05-28 Thread silusilusilu
Thanks for your reply: very useful!! I have another question: with hex command i display (for example) 0x1 is it possible to display 0x01? Thanks Il giorno lunedì 27 maggio 2013 15:10:24 UTC+2, Chris “Kwpolska” Warrick ha scritto: > On Mon, May 27, 2013 at 11:26 AM, wrote: > > > Hi, > > > i

Re: Future standard GUI library

2013-05-28 Thread 88888 Dihedral
Chris Angelico於 2013年5月28日星期二UTC+8下午3時11分55秒寫道: > On Tue, May 28, 2013 at 9:10 AM, Roy Smith wrote: > > > In article , > > > Chris Angelico wrote: > > > > > >> I'll use XML when I have to, but if I'm inventing my own protocol, > > >> nope. There are just too many quirks with it. How do you

RE: Short-circuit Logic

2013-05-28 Thread Carlos Nepomuceno
> Date: Tue, 28 May 2013 01:39:09 -0700 > Subject: Re: Short-circuit Logic > From: abdulsh...@gmail.com [...] >> What Steven wrote is entirely correct: sys.float_info.epsilon is the >> >> smallest value x such that 1.0 and 1.0+x have distinct floating-point

Re: Short-circuit Logic

2013-05-28 Thread Ahmed Abdulshafy
On Tuesday, May 28, 2013 2:10:05 AM UTC+2, Nobody wrote: > On Mon, 27 May 2013 13:11:28 -0700, Ahmed Abdulshafy wrote: > > > > > On Sunday, May 26, 2013 2:13:47 PM UTC+2, Steven D'Aprano wrote: > > > > > >> What the above actually tests for is whether x is so small that (1.0+x) > > >> cannot

Re: Python error codes and messages location

2013-05-28 Thread Steven D'Aprano
On Tue, 28 May 2013 17:15:51 +1000, Chris Angelico wrote: > Can we internationalize English instead of localizing Python? We have. English is the primary international language for programmers. (For which I am profoundly grateful.) Japanese is also a pretty important language, but mostly in Jap

Re: I want to know how to implement concurrent threads in Python

2013-05-28 Thread Ulrich Eckhardt
Am 26.05.2013 21:10, schrieb Daniel Gagliardi: I want to know how to implement concurrent threads in Python Have you tried searching the web or maybe looked on docs.python.org? Seriously, show at least some effort before asking here. Uli -- http://mail.python.org/mailman/listinfo/python-lis

Re: Python error codes and messages location

2013-05-28 Thread Chris Angelico
On Tue, May 28, 2013 at 6:10 PM, Fábio Santos wrote: > Just to clarify, I am suggesting to have the unchanged messages in > tracebacks, but having some methods in the exception to get the exception > and message localised. Just like repr() and str() are directed at different > audiences (the progr

Re: Python error codes and messages location

2013-05-28 Thread Fábio Santos
On 28 May 2013 08:19, "Chris Angelico" wrote: > > On Tue, May 28, 2013 at 4:57 PM, Fábio Santos wrote: > > > > On 28 May 2013 05:17, "Vito De Tullio" wrote: > >> I really hope really far... have you never tried to google a localized > >> error > >> message? :\ > > > > Never. I don't even try. >

Re: Ldap module and base64 oncoding

2013-05-28 Thread Michael Ströder
Joseph L. Casale wrote: > I had some time today, so I attempted to open the ldif files in binary mode > to simply > work with the raw byte strings but the moment the first entry was parsed, > parse() > stumbled on a character in the first entries dict and passed a dn of None for > the last half?

Re: Reading *.json from URL - json.loads() versus urllib.urlopen.readlines()

2013-05-28 Thread Fábio Santos
On 28 May 2013 04:19, "Bryan Britten" wrote: > I'm not familiar with using read(4096), I'll have to look into that. When I tried to just save the file, my computer just sat in limbo for some time and didn't seem to want to process the command. That's just file.read with an integer argument. You c

Re: Python error codes and messages location

2013-05-28 Thread Chris Angelico
On Tue, May 28, 2013 at 4:57 PM, Fábio Santos wrote: > > On 28 May 2013 05:17, "Vito De Tullio" wrote: >> I really hope really far... have you never tried to google a localized >> error >> message? :\ > > Never. I don't even try. Same happens when someone pastes an error onto a mailing list like

Re: Future standard GUI library

2013-05-28 Thread Chris Angelico
On Tue, May 28, 2013 at 9:10 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> I'll use XML when I have to, but if I'm inventing my own protocol, >> nope. There are just too many quirks with it. How do you represent an >> empty string named Foo? >> >> >> >> or equivalently >> >>

Re: Python error codes and messages location

2013-05-28 Thread Fábio Santos
On 28 May 2013 05:17, "Vito De Tullio" wrote: > > Fábio Santos wrote: > > >> > > Speaking of PEPs and exceptions. When do we get localized exceptions? > >> > > >> > What do you mean by "localized exceptions"? > >> > > >> > Please, tell me it's *NOT* a proposal to send the exception message in > >>