[RELEASE] six 1.4.0

2013-09-02 Thread Benjamin Peterson
I'm pleased to announce the release of six 1.4.0. This release sees some nice improvements, most significantly a much-requested compatibility layer for the Py3 urllib package. I'd like to thank Marc Abramowitz for contributing that as well as Jason R. Coombs for several other helpful pull

pyqt and doesnt work out of mainwindow

2013-09-02 Thread Mohsen Pahlevanzadeh
Dear all, My question is at: http://stackoverflow.com/questions/18564293/main-program-work-good-but-when-put-it-into-a-function-doesnt-work-pyqt before answering, thank you Yours, mohsen -- http://mail.python.org/mailman/listinfo/python-list

Re: A Pragmatic Case for Static Typing

2013-09-02 Thread Paul Rubin
Russ P. russ.paie...@gmail.com writes: I just stumbled across this video and found it interesting: http://vimeo.com/72870631 My apologies if it has been posted here already. The slides for it are here, so I didn't bother watching the 1 hour video:

Re: Simplex Algorithm

2013-09-02 Thread Oscar Benjamin
On Sep 2, 2013 2:31 AM, Tommy Vee xx...@xx.xxx wrote: Anyone know where I can get an easy to use Python class or algorithm for the Simplex optimization algorithm? I've tried the one in the link below, but I can't figure out if a) I'm using it properly, or b) where to get the solution. BTW,

Re: semicolon at end of python's statements

2013-09-02 Thread Steven D'Aprano
On Sun, 01 Sep 2013 21:58:15 +0200, Antoon Pardon wrote: Op 31-08-13 02:09, Steven D'Aprano schreef: Adding a fourth option: for spam in sequence if predicate(spam): process(spam) saves absolutely nothing except a line and an indent level, neither of which are in short supply, and

Re: semicolon at end of python's statements

2013-09-02 Thread Antoon Pardon
Op 02-09-13 01:30, MRAB schreef: On 01/09/2013 20:58, Antoon Pardon wrote: Op 31-08-13 02:09, Steven D'Aprano schreef: On Fri, 30 Aug 2013 11:32:17 +0100, Fábio Santos wrote: We really are spoiled for choice here. We can write any of these: # Option 1 for spam in sequence: if

Re: A Pragmatic Case for Static Typing

2013-09-02 Thread Steven D'Aprano
On Mon, 02 Sep 2013 01:10:34 -0700, Paul Rubin wrote: Russ P. russ.paie...@gmail.com writes: I just stumbled across this video and found it interesting: http://vimeo.com/72870631 My apologies if it has been posted here already. The slides for it are here, so I didn't bother watching the 1

Re: Simplex Algorithm

2013-09-02 Thread Robert Kern
On 2013-09-02 09:06, Oscar Benjamin wrote: On Sep 2, 2013 2:31 AM, Tommy Vee xx...@xx.xxx wrote: Anyone know where I can get an easy to use Python class or algorithm for the Simplex optimization algorithm? I've tried the one in the link below, but I can't figure out if a) I'm using it

Re: semicolon at end of python's statements

2013-09-02 Thread Antoon Pardon
Op 02-09-13 10:05, Steven D'Aprano schreef: On Sun, 01 Sep 2013 21:58:15 +0200, Antoon Pardon wrote: Op 31-08-13 02:09, Steven D'Aprano schreef: Adding a fourth option: for spam in sequence if predicate(spam): process(spam) saves absolutely nothing except a line and an indent

Re: semicolon at end of python's statements

2013-09-02 Thread Steven D'Aprano
On Mon, 02 Sep 2013 10:29:05 +0200, Antoon Pardon wrote: Why should we be more concerned with cascading ifs than with cascading controls in general? What cascading controls? for element in seq: if filter: block is not a cascading control. [...] All these discussions about

Re: Simplex Algorithm

2013-09-02 Thread Robert Kern
On 2013-09-02 02:26, Tommy Vee wrote: Anyone know where I can get an easy to use Python class or algorithm for the Simplex optimization algorithm? I've tried the one in the link below, but I can't figure out if a) I'm using it properly, or b) where to get the solution. BTW, I tried some test

Re: semicolon at end of python's statements

2013-09-02 Thread Chris Angelico
On Mon, Sep 2, 2013 at 7:52 PM, Steven D'Aprano st...@pearwood.info wrote: Instead, we would have spent 100 times as much time and energy debating the One True Indentation Scheme, akin to the brace wars that went on for *years* in the C community. And still haven't completely gone. You mean

Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow)

2013-09-02 Thread Chris Angelico
On Mon, Sep 2, 2013 at 3:28 PM, anntzer@gmail.com wrote: On Sunday, September 1, 2013 2:03:56 PM UTC-7, Chris Angelico wrote: I tried using netifaces (https://pypi.python.org/pypi/netifaces) which seems to rely on getifaddrs (according to the doc, I didn't check the source). Again,

Re: semicolon at end of python's statements

2013-09-02 Thread Fábio Santos
On 09/02/2013 10:45 AM, Antoon Pardon wrote: Op 02-09-13 10:05, Steven D'Aprano schreef: It doesn't keep a whole chain of if clauses together. It doesn't let you do anything that you haven't already done. It just saves an indent and a newline. The cost, on the other hand, includes the risk that

Re: semicolon at end of python's statements

2013-09-02 Thread Antoon Pardon
Op 02-09-13 11:52, Steven D'Aprano schreef: On Mon, 02 Sep 2013 10:29:05 +0200, Antoon Pardon wrote: Why should we be more concerned with cascading ifs than with cascading controls in general? What cascading controls? for element in seq: if filter: block is not a

Re: semicolon at end of python's statements

2013-09-02 Thread Antoon Pardon
Op 02-09-13 12:42, Fábio Santos schreef: On 09/02/2013 10:45 AM, Antoon Pardon wrote: Op 02-09-13 10:05, Steven D'Aprano schreef: It doesn't keep a whole chain of if clauses together. It doesn't let you do anything that you haven't already done. It just saves an indent and a newline. The

Re: UnicodeDecodeError issue

2013-09-02 Thread Dave Angel
On 2/9/2013 00:16, Ferrous Cranus wrote: Have you tried to decode those bytes in various encodings other than utf-8 ? No, because i wasn't aware of what string/variable they were pertaining at. http://pypi.python.org/pypi/chardet is a package which tries to 'guess' an encoding for a

Re: UnicodeDecodeError issue

2013-09-02 Thread Ferrous Cranus
Στις 2/9/2013 2:38 μμ, ο/η Dave Angel έγραψε: On 2/9/2013 00:16, Ferrous Cranus wrote: Have you tried to decode those bytes in various encodings other than utf-8 ? No, because i wasn't aware of what string/variable they were pertaining at. http://pypi.python.org/pypi/chardet is a

Re: UnicodeDecodeError issue

2013-09-02 Thread MRAB
On 02/09/2013 12:38, Dave Angel wrote: On 2/9/2013 00:16, Ferrous Cranus wrote: Have you tried to decode those bytes in various encodings other than utf-8 ? No, because i wasn't aware of what string/variable they were pertaining at. http://pypi.python.org/pypi/chardet is a package

Re: A Pragmatic Case for Static Typing

2013-09-02 Thread Chris Angelico
On Mon, Sep 2, 2013 at 6:10 PM, Paul Rubin no.email@nospam.invalid wrote: Russ P. russ.paie...@gmail.com writes: I just stumbled across this video and found it interesting: http://vimeo.com/72870631 My apologies if it has been posted here already. The slides for it are here, so I didn't

Re: UnicodeDecodeError issue

2013-09-02 Thread Dave Angel
On 2/9/2013 07:49, Ferrous Cranus wrote: snip Στις 2/9/2013 2:38 μμ, ο/η Dave Angel έγραψε: Does that string make any sense to you? Yes it does, it mean Unknown Hostname The Linux 'file' utility thinks this string is in ISO-8859, so you might want to try a decode('ISO-8859-1') as well.

Re: UnicodeDecodeError issue

2013-09-02 Thread Dave Angel
On 2/9/2013 07:56, MRAB wrote: On 02/09/2013 12:38, Dave Angel wrote: snip ¶γνωστοόνομα συστήματος I don't have a clue what it might be; it's not English, and I don't know whatever language it may be in. You don't recognise Greek? I recognize most of those as Greek characters, but

Re: A Pragmatic Case for Static Typing

2013-09-02 Thread Roy Smith
In article 7xfvtnwsn9@ruckus.brouhaha.com, Paul Rubin no.email@nospam.invalid wrote: Russ P. russ.paie...@gmail.com writes: I just stumbled across this video and found it interesting: http://vimeo.com/72870631 My apologies if it has been posted here already. The slides for it are

Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow)

2013-09-02 Thread Roy Smith
In article 00843d58-db21-4cf0-9430-85362a1dd...@googlegroups.com, anntzer@gmail.com wrote: As it happens I found a better way: just add the proper entry to /etc/hosts. You have not found a better way. You still have a network (or more specifically, DNS) configuration that's broken. What

Re: A Pragmatic Case for Static Typing

2013-09-02 Thread Roy Smith
In article 52245df4$0$2743$c3e8da3$76491...@news.astraweb.com, Steven D'Aprano st...@pearwood.info wrote: One factor I don't see very often mentioned is that static typing increases coupling between distant parts of your code. If func() changes from returning int to MyInt, everything that

Re: semicolon at end of python's statements

2013-09-02 Thread Grant Edwards
On 2013-08-31, Paul Rudin paul.nos...@rudin.co.uk wrote: Jussi Piitulainen jpiit...@ling.helsinki.fi writes: # Option 1.5 for spam in sequence: if not predicate(spam): continue process(spam) This saves an indent level. Just out of interest: is saving an indent level a useful

Re: optparse question (python 2.6)

2013-09-02 Thread Andy Kannberg
Hi all, I tried with the example Peter gave me, and it works. But only when the options are boolean. At least, that is my conclusion with experimenting. I'll elaborate: The code to create 'mutually exclusive options': option_names = [ l, o , s ] toggled_options = [name for name in

Re: Simplex Algorithm

2013-09-02 Thread Tommy Vee
On 9/2/2013 4:06 AM, Oscar Benjamin wrote: On Sep 2, 2013 2:31 AM, Tommy Vee xx...@xx.xxx wrote: Anyone know where I can get an easy to use Python class or algorithm for the Simplex optimization algorithm? I've tried the one in the link below, but I can't figure out if a) I'm using it

Re: semicolon at end of python's statements

2013-09-02 Thread Tim Chase
On 2013-09-02 14:20, Grant Edwards wrote: This saves an indent level. Just out of interest: is saving an indent level a useful thing? Perhaps he's worried about the world running out of tabs? I heard that most of the tab mines are in China and they're going to stop exporting... And

Re: UnicodeDecodeError issue

2013-09-02 Thread MRAB
On 02/09/2013 13:24, Dave Angel wrote: On 2/9/2013 07:56, MRAB wrote: On 02/09/2013 12:38, Dave Angel wrote: snip ¶γνωστοόνομα συστήματος I don't have a clue what it might be; it's not English, and I don't know whatever language it may be in. You don't recognise Greek? I

Re: semicolon at end of python's statements

2013-09-02 Thread Roy Smith
In article mailman.491.1378133042.19984.python-l...@python.org, Tim Chase python.l...@tim.thechases.com wrote: On 2013-09-02 14:20, Grant Edwards wrote: This saves an indent level. Just out of interest: is saving an indent level a useful thing? Perhaps he's worried about the world

Re: semicolon at end of python's statements

2013-09-02 Thread Steven D'Aprano
On Mon, 02 Sep 2013 20:14:40 +1000, Chris Angelico wrote: On Mon, Sep 2, 2013 at 7:52 PM, Steven D'Aprano st...@pearwood.info wrote: Instead, we would have spent 100 times as much time and energy debating the One True Indentation Scheme, akin to the brace wars that went on for *years* in the

user interfaces python3.x

2013-09-02 Thread Paul Rice
Im new to python3.x (well, programming as a whole. Never done before) and was wondering how do i get a proper interface instead of just writing. Im using android device(sl4a and py34a). Ive heard something about kivy for android is that what i need if so does anyone know of a tutorial to use

Re: Simplex Algorithm

2013-09-02 Thread Tommy Vee
On 9/2/2013 5:55 AM, Robert Kern wrote: On 2013-09-02 02:26, Tommy Vee wrote: Anyone know where I can get an easy to use Python class or algorithm for the Simplex optimization algorithm? I've tried the one in the link below, but I can't figure out if a) I'm using it properly, or b) where to

Re: UnicodeDecodeError issue

2013-09-02 Thread Ferrous Cranus
Στις 2/9/2013 3:21 μμ, ο/η Dave Angel έγραψε: Starting with the byte string in the error message: f = open(junk.txt, w) f.write(b'\xb6\xe3\xed\xf9\xf3\xf4\xef\xfc\xed\xef\xec\xe1 \xf3\xf5\xf3\xf4\xde\xec\xe1\xf4\xef\xf2\n') f.close() Ιndeed but yet again, file checks out the encoding of the

Re: optparse question (python 2.6)

2013-09-02 Thread Peter Otten
Andy Kannberg wrote: I tried with the example Peter gave me, and it works. But only when the options are boolean. At least, that is my conclusion with experimenting. I'll elaborate: The code to create 'mutually exclusive options': option_names = [ l, o , s ] toggled_options = [name

Re: Simplex Algorithm

2013-09-02 Thread Robert Kern
On 2013-09-02 16:06, Tommy Vee wrote: On 9/2/2013 5:55 AM, Robert Kern wrote: On 2013-09-02 02:26, Tommy Vee wrote: Anyone know where I can get an easy to use Python class or algorithm for the Simplex optimization algorithm? I've tried the one in the link below, but I can't figure out if a)

How can I remove the first line of a multi-line string?

2013-09-02 Thread Anthony Papillion
Hello Everyone, I have a multi-line string and I need to remove the very first line from it. How can I do that? I looked at StringIO but I can't seem to figure out how to properly use it to remove the first line. Basically, I want to toss the first line but keep everything else. Can anyone put

Re: user interfaces python3.x

2013-09-02 Thread Steven D'Aprano
On Mon, 02 Sep 2013 08:03:02 -0700, Paul Rice wrote: Im new to python3.x (well, programming as a whole. Never done before) and was wondering how do i get a proper interface instead of just writing. A proper interface huh? Well, I'd love to tell you the answer, but I don't know what icon to

Re: How can I remove the first line of a multi-line string?

2013-09-02 Thread Chris “Kwpolska” Warrick
On Mon, Sep 2, 2013 at 6:06 PM, Anthony Papillion papill...@gmail.com wrote: Hello Everyone, I have a multi-line string and I need to remove the very first line from it. How can I do that? I looked at StringIO but I can't seem to figure out how to properly use it to remove the first line.

Re: How can I remove the first line of a multi-line string?

2013-09-02 Thread Oscar Benjamin
On 2 September 2013 17:06, Anthony Papillion papill...@gmail.com wrote: Hello Everyone, I have a multi-line string and I need to remove the very first line from it. How can I do that? I looked at StringIO but I can't seem to figure out how to properly use it to remove the first line.

Re: user interfaces python3.x

2013-09-02 Thread Paul Rudin
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: On Mon, 02 Sep 2013 08:03:02 -0700, Paul Rice wrote: Im new to python3.x (well, programming as a whole. Never done before) and was wondering how do i get a proper interface instead of just writing. A proper interface huh? Well,

Re: How can I remove the first line of a multi-line string? (SOLVED)

2013-09-02 Thread Anthony Papillion
On 09/02/2013 11:12 AM, Chris “Kwpolska” Warrick wrote: On Mon, Sep 2, 2013 at 6:06 PM, Anthony Papillion papill...@gmail.com wrote: Hello Everyone, I have a multi-line string and I need to remove the very first line from it. How can I do that? I looked at StringIO but I can't seem to figure

Re: How can I remove the first line of a multi-line string?

2013-09-02 Thread MRAB
On 02/09/2013 17:12, Chris “Kwpolska” Warrick wrote: On Mon, Sep 2, 2013 at 6:06 PM, Anthony Papillion papill...@gmail.com wrote: Hello Everyone, I have a multi-line string and I need to remove the very first line from it. How can I do that? I looked at StringIO but I can't seem to figure out

Re: user interfaces python3.x

2013-09-02 Thread Paul Rice
I know that most of my time will be writing . I dont think i specified very well what im asking. What i mean by proper interface is a interface like for an app or something, let me give u an example; Say i have made a phonebook just for this example and i want to use it like a normal phonebook

Re: How can I remove the first line of a multi-line string? (SOLVED)

2013-09-02 Thread Roy Smith
In article mailman.500.1378139057.19984.python-l...@python.org, Anthony Papillion papill...@gmail.com wrote: On 09/02/2013 11:12 AM, Chris “Kwpolska” Warrick wrote: On Mon, Sep 2, 2013 at 6:06 PM, Anthony Papillion papill...@gmail.com wrote: Hello Everyone, I have a multi-line

Re: user interfaces python3.x

2013-09-02 Thread Joel Goldstick
On Mon, Sep 2, 2013 at 12:18 PM, Paul Rudin paul.nos...@rudin.co.uk wrote: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: On Mon, 02 Sep 2013 08:03:02 -0700, Paul Rice wrote: Im new to python3.x (well, programming as a whole. Never done before) and was wondering how do i get a

Cookie or not..?

2013-09-02 Thread mrcoludk
Hello Group. I am a Python noob, and need some help. I am trying to log in to website using python and parse info after login. In a browser, this link will log me in and keep me loged in: http://[domain].com/loginh.aspx?SID=[xxx]USER=[xxx]PW=[xxx] (sorry for the tripple x, but it is actually

Re: How can I remove the first line of a multi-line string?

2013-09-02 Thread Vlastimil Brom
2013/9/2 Anthony Papillion papill...@gmail.com: Hello Everyone, I have a multi-line string and I need to remove the very first line from it. How can I do that? I looked at StringIO but I can't seem to figure out how to properly use it to remove the first line. Basically, I want to toss the

Re: user interfaces python3.x

2013-09-02 Thread Dan Sommers
On Mon, 02 Sep 2013 16:08:04 +, Steven D'Aprano wrote: (If you think text is not a proper interface, you're going to have a bad time as a programmer. 99% of your programming time will be writing.) I'm a programmer, and I spend way more than 1% of my programming time drawing, even taking

Re: user interfaces python3.x

2013-09-02 Thread Joe Junior
On 2 September 2013 14:00, Paul Rice lfcpaulr...@gmail.com wrote: I know that most of my time will be writing . I dont think i specified very well what im asking. What i mean by proper interface is a interface like for an app or something, let me give u an example; Say i have made a

Re: Cookie or not..?

2013-09-02 Thread Joel Goldstick
On Mon, Sep 2, 2013 at 1:11 PM, mrcol...@gmail.com wrote: Hello Group. I am a Python noob, and need some help. I am trying to log in to website using python and parse info after login. In a browser, this link will log me in and keep me loged in:

Re: user interfaces python3.x

2013-09-02 Thread Joel Goldstick
On Mon, Sep 2, 2013 at 1:16 PM, Joe Junior joe.fbs.jun...@gmail.com wrote: On 2 September 2013 14:00, Paul Rice lfcpaulr...@gmail.com wrote: I know that most of my time will be writing . I dont think i specified very well what im asking. What i mean by proper interface is a interface like

Re: Newbie: use of built-in exceptions

2013-09-02 Thread Rui Maciel
Chris “Kwpolska” Warrick wrote: There are no rules. You should use common sense instead: if the exception fits your needs (eg. ValueError when incorrect output occurs) then use it. Ok, thanks for the tip. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: semicolon at end of python's statements

2013-09-02 Thread albert visser
On Mon, 02 Sep 2013 12:58:23 +0200, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: Op 02-09-13 12:42, Fábio Santos schreef: On 09/02/2013 10:45 AM, Antoon Pardon wrote: Op 02-09-13 10:05, Steven D'Aprano schreef: [...] for item in seq: if cond: do_this() do_that() else:

Re: user interfaces python3.x

2013-09-02 Thread Joe Junior
On 2 September 2013 14:30, Joel Goldstick joel.goldst...@gmail.com wrote: On Mon, Sep 2, 2013 at 1:16 PM, Joe Junior joe.fbs.jun...@gmail.com wrote: On 2 September 2013 14:00, Paul Rice lfcpaulr...@gmail.com wrote: I know that most of my time will be writing . I dont think i specified very

Python FTP timeout value not effective

2013-09-02 Thread John Nagle
I'm reading files from an FTP server at the U.S. Securities and Exchange Commission. This code has been running successfully for years. Recently, they imposed a consistent connection delay of 20 seconds at FTP connection, presumably because they're having some denial of service attack.

Re: semicolon at end of python's statements

2013-09-02 Thread Roy Smith
In article mailman.508.1378143885.19984.python-l...@python.org, albert visser albert.vis...@gmail.com wrote: I like being able to do e.g. with open('some_file') as _in, open('another_file', 'w') as _out: It would be nice if you could write that as: with open('some_file'),

Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow)

2013-09-02 Thread anntzer . lee
On Monday, September 2, 2013 5:45:26 AM UTC-7, Roy Smith wrote: In article 00843d58-db21-4cf0-9430-85362a1dd...@googlegroups.com, anntzer@gmail.com wrote: As it happens I found a better way: just add the proper entry to /etc/hosts. You have not found a better way. You still have a

Re: semicolon at end of python's statements

2013-09-02 Thread Tim Chase
On 2013-09-02 10:47, Roy Smith wrote: Perhaps he's worried about the world running out of tabs? I heard that most of the tab mines are in China and they're going to stop exporting... And buying all that indentation supports terrorists. Conserve whitespace or the terrorists

Re: UnicodeDecodeError issue

2013-09-02 Thread Dave Angel
On 2/9/2013 11:05, Ferrous Cranus wrote: Στις 2/9/2013 3:21 μμ, ο/η Dave Angel έγραψε: Starting with the byte string in the error message: f = open(junk.txt, w) f.write(b'\xb6\xe3\xed\xf9\xf3\xf4\xef\xfc\xed\xef\xec\xe1 \xf3\xf5\xf3\xf4\xde\xec\xe1\xf4\xef\xf2\n') f.close() Ιndeed but

Re: user interfaces python3.x

2013-09-02 Thread Paul Rice
Sorry for the wording of the question buy finally i have an answer. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: user interfaces python3.x

2013-09-02 Thread Paul Rice
Sorry for the wording of the question buy finally i have an answer. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: A Pragmatic Case for Static Typing

2013-09-02 Thread Russ P.
On Monday, September 2, 2013 1:10:34 AM UTC-7, Paul Rubin wrote: Russ P. writes: I just stumbled across this video and found it interesting: http://vimeo.com/72870631 My apologies if it has been posted here already. The slides for it are here, so I didn't bother watching the 1

Re: Simplex Algorithm

2013-09-02 Thread Tommy Vee
On 9/2/2013 11:43 AM, Robert Kern wrote: On 2013-09-02 16:06, Tommy Vee wrote: On 9/2/2013 5:55 AM, Robert Kern wrote: On 2013-09-02 02:26, Tommy Vee wrote: Anyone know where I can get an easy to use Python class or algorithm for the Simplex optimization algorithm? I've tried the one in the

Re: How to split with \ character, and licence copyleft mirror of ©

2013-09-02 Thread Ethan Furman
On 09/01/2013 07:40 PM, Tim Roberts wrote: Another altrnative is to use raw strings, in which backslashes are not interpreted: a = r'E:\Dropbox\jjfsdjjsdklfj\sdfjksdfkjslkj\flute.wav' a.split(r'\') Not quite. -- r'\' File stdin, line 1 r'\' ^ SyntaxError: EOL while

Re: semicolon at end of python's statements

2013-09-02 Thread Chris Angelico
On Tue, Sep 3, 2013 at 3:58 AM, Tim Chase python.l...@tim.thechases.com wrote: On 2013-09-02 10:47, Roy Smith wrote: Perhaps he's worried about the world running out of tabs? I heard that most of the tab mines are in China and they're going to stop exporting... And buying all that

Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow)

2013-09-02 Thread Chris Angelico
On Tue, Sep 3, 2013 at 3:52 AM, anntzer@gmail.com wrote: To be honest, knowing nothing about DNS configuration, I don't even know if adding the entry to /etc/hosts is the proper fix or if the issue should be fixed somewhere else (or perhaps didn't know, as you seem to imply that that

Re: How to split with \ character, and licence copyleft mirror of (c)

2013-09-02 Thread Chris Angelico
On Tue, Sep 3, 2013 at 6:22 AM, Ethan Furman et...@stoneleaf.us wrote: In a raw string, the backslash is buggy (IMNSHO) when it's the last character. It's an inevitable consequence of using the backslash to escape the quote character. If instead, a raw string doubled the quote character (like

Re: Encapsulation unpythonic?

2013-09-02 Thread 88888 Dihedral
Fabrice Pombet於 2013年8月31日星期六UTC+8上午1時43分28秒寫道: On Saturday, August 17, 2013 2:26:32 PM UTC+2, Fernando Saldanha wrote: I am new to Python, with experience in Java, C++ and R. As I understand encapsulation is not a big thing in the Python world. I read that you can put

Re: Python FTP timeout value not effective

2013-09-02 Thread David Bolen
John Nagle na...@animats.com writes: Here's the relevant code: TIMEOUTSECS = 60 ## give up waiting for server after 60 seconds ... def urlopen(url,timeout=TIMEOUTSECS) : if url.endswith(.gz) : # gzipped file, must decompress first nd = urllib2.urlopen(url,timeout=timeout)

sqlite issue in 2.7.5

2013-09-02 Thread Joseph L. Casale
I have been battling an issue hopefully someone here has insight with. I have a database with a few tables I perform a query against with some joins against columns collated with NOCASE that leverage = comparisons. Running the query on the database opened in sqlitestudio returns the results in

Re: How can I remove the first line of a multi-line string?

2013-09-02 Thread Terry Reedy
On 9/2/2013 12:06 PM, Anthony Papillion wrote: I have a multi-line string and I need to remove the very first line from it. How can I do that? I looked at StringIO but I can't seem to figure out how to properly use it to remove the first line. Basically, I want to toss the first line but keep

Re: Python FTP timeout value not effective

2013-09-02 Thread Chris Angelico
On Tue, Sep 3, 2013 at 3:43 AM, John Nagle na...@animats.com wrote: URLError: urlopen error ftp error: [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to

Re: A Pragmatic Case for Static Typing

2013-09-02 Thread Chris Angelico
On Mon, Sep 2, 2013 at 10:41 PM, Roy Smith r...@panix.com wrote: In article 7xfvtnwsn9@ruckus.brouhaha.com, Paul Rubin no.email@nospam.invalid wrote: Russ P. russ.paie...@gmail.com writes: I just stumbled across this video and found it interesting: http://vimeo.com/72870631 My

Re: UnicodeDecodeError issue

2013-09-02 Thread Chris Angelico
On Tue, Sep 3, 2013 at 12:44 AM, MRAB pyt...@mrabarnett.plus.com wrote: I don't know Greek either, and I don't think there's any other language that uses the Greek alphabet. Assuming you don't count mathematics as a language. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: semicolon at end of python's statements

2013-09-02 Thread Modulok
So? Indeed there are too many people looking at these things as fighting for the one true way. That is IMO part a big part of the problem. I have no problem if someone else uses a different style than I do. Python as a language tries too hard to enforce a one true way. Try maintaining a

Re: Encapsulation unpythonic?

2013-09-02 Thread Rhodri James
On Sat, 31 Aug 2013 12:46:52 +0100, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: # THIS DOES NOT HAPPEN IN PYTHON # or any other language, as far as I am aware x = 23 y = x # y now has the value 23 x = 42 # change the value of the object ### NOT SO! ### print y = prints 42

Re: semicolon at end of python's statements

2013-09-02 Thread Roy Smith
In article mailman.523.1378163859.19984.python-l...@python.org, Modulok modu...@gmail.com wrote: So? Indeed there are too many people looking at these things as fighting for the one true way. That is IMO part a big part of the problem. I have no problem if someone else uses a different

Re: Python FTP timeout value not effective

2013-09-02 Thread Terry Reedy
On 9/2/2013 1:43 PM, John Nagle wrote: I'm reading files from an FTP server at the U.S. Securities and Exchange Commission. This code has been running successfully for years. Recently, they imposed a consistent connection delay of 20 seconds at FTP connection, presumably because they're

Re: Newbie: use of built-in exceptions

2013-09-02 Thread Cameron Simpson
On 01Sep2013 13:26, Chris “Kwpolska” Warrick kwpol...@gmail.com wrote: | On Sun, Sep 1, 2013 at 1:17 PM, Rui Maciel rui.mac...@gmail.com wrote: | Are there any guidelines on the use (and abuse) of Python's built-in exceptions, telling where | it's ok to raise them and where it's preferable to

problem of double import in python

2013-09-02 Thread Mohsen Pahlevanzadeh
Dear all, I remember to avoiding to confusing compiler for header, use / // in my include file #define MYHEADER_H // and in others code use: #ifndef MYHEADER_H #include blahblah / Unfortunately, i prevent to same error, double import to python, but i

Re: UnicodeDecodeError issue

2013-09-02 Thread Joel Goldstick
On Mon, Sep 2, 2013 at 6:45 PM, Chris Angelico ros...@gmail.com wrote: On Tue, Sep 3, 2013 at 12:44 AM, MRAB pyt...@mrabarnett.plus.com wrote: I don't know Greek either, and I don't think there's any other language that uses the Greek alphabet. Assuming you don't count mathematics as a

Re: semicolon at end of python's statements

2013-09-02 Thread Modulok
But, more than that, it saves the zillions of hours of time wasted arguing about which way is better. XD Nice. That's about the best supporting argument I've heard. -Modulok- -- http://mail.python.org/mailman/listinfo/python-list

Re: problem of double import in python

2013-09-02 Thread alex23
On 3/09/2013 10:48 AM, Mohsen Pahlevanzadeh wrote: Unfortunately, i prevent to same error, double import to python, but i don't know how to solve, Even i don't know policy of python programmers. You don't need to do anything, Python takes care of this for you. During execution, a module is

Re: A Pragmatic Case for Static Typing

2013-09-02 Thread Nobody
On Mon, 02 Sep 2013 09:44:20 +, Steven D'Aprano wrote: One factor I don't see very often mentioned is that static typing increases coupling between distant parts of your code. If func() changes from returning int to MyInt, everything that calls func now needs to be modified to accept

Re: problem of double import in python

2013-09-02 Thread Mohsen Pahlevanzadeh
When i uncomment from common.interface.interface import ShowHide in file contains Ui_Materials class i get the following traceback: // Traceback (most recent call last): File ./main.py, line 110, in module main() File ./main.py, line 91, in main

Re: problem of double import in python

2013-09-02 Thread Joel Goldstick
On Mon, Sep 2, 2013 at 9:16 PM, Mohsen Pahlevanzadeh moh...@pahlevanzadeh.org wrote: When i uncomment from common.interface.interface import ShowHide The line above only loads interface.interface.ShowHide I in file contains Ui_Materials class i get the following traceback:

Re: A Pragmatic Case for Static Typing

2013-09-02 Thread Joel Goldstick
On Mon, Sep 2, 2013 at 9:10 PM, Nobody nob...@nowhere.com wrote: On Mon, 02 Sep 2013 09:44:20 +, Steven D'Aprano wrote: One factor I don't see very often mentioned is that static typing increases coupling between distant parts of your code. If func() changes from returning int to MyInt,

Re: How to split with \ character, and licence copyleft mirror of ©

2013-09-02 Thread Steven D'Aprano
On Mon, 02 Sep 2013 13:22:37 -0700, Ethan Furman wrote: In a raw string, the backslash is buggy (IMNSHO) when it's the last character. Given the above error, you might think that to get a single-quote in a string delimited by single-quotes that you would use r'\'', but no: -- r'\'' \\'

Re: user interfaces python3.x

2013-09-02 Thread Steven D'Aprano
On Mon, 02 Sep 2013 11:26:49 -0700, Paul Rice wrote: Sorry for the wording of the question buy finally i have an answer. Thanks Actually, if you were paying attention, you actually had an answer in the very first response. Two answers really: even if you knew absolutely nothing about

How to execute command on remote windows machine

2013-09-02 Thread gaurangnshah
Hi Guys, I have a requirement where i need to kill one process on remote windows machine. Following command just works fine if i have to kill process on local machine os.system('taskkill /f /im processName.exe') However I am not able to figure out how to execute this command on remote

Re: How to execute command on remote windows machine

2013-09-02 Thread Steven D'Aprano
On Mon, 02 Sep 2013 21:45:57 -0700, gaurangnshah wrote: so is there any way i can execute command from windows machine on remote windows machine ? You are looking for information on Remote Procedure Calls, or RPC. There are obvious security implementations from enabling RPC, imagine if

Re: How to execute command on remote windows machine

2013-09-02 Thread alex23
On 3/09/2013 2:45 PM, gaurangns...@gmail.com wrote: I have a requirement where i need to kill one process on remote windows machine. Following command just works fine if i have to kill process on local machine os.system('taskkill /f /im processName.exe') However I am not able to figure out how

[issue18893] invalid exception handling in Lib/ctypes/macholib/dyld.py

2013-09-02 Thread Ronald Oussoren
Ronald Oussoren added the comment: Your analysis looks correct to me, that is raise e is supposed to raise the exception caught by the first try block. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18893

[issue18904] Unnecessary test in file descriptor inheritance test

2013-09-02 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18904 ___ ___

[issue18745] Test enum in test_json is ignorant of infinity value

2013-09-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset 50e583f20d78 by Ethan Furman in branch 'default': Close #18745: Improve enum tests in test_json for infinities and NaN. http://hg.python.org/cpython/rev/50e583f20d78 -- nosy: +python-dev resolution: - fixed stage: patch review -

[issue9709] test_distutils warning: initfunc exported twice on Windows

2013-09-02 Thread Stefan Krah
Stefan Krah added the comment: Is the distutils freeze still in place? If not, I'll commit initfunc2.patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9709 ___

[issue18828] urljoin behaves differently with custom and standard schemas

2013-09-02 Thread Berker Peksag
Berker Peksag added the comment: How about adding a codecs.register like public API for 3.4+? import urllib.parse urllib.parse.schemes.register('redis', 'rtmp') or: urllib.parse.urljoin('redis://localhost:6379/0', '/1', scheme='redis') or just:

[issue18709] SSL module fails to handle NULL bytes inside subjectAltNames general names (CVE-2013-4238)

2013-09-02 Thread Matěj Stuchlík
Matěj Stuchlík added the comment: Doing 'valgrind --suppressions=valgrind-python.supp ./python Lib/tests/regrtest.py test_ssl.py' I'm getting ==11944== LEAK SUMMARY: ==11944==definitely lost: 32 bytes in 1 blocks ==11944==indirectly lost: 392 bytes in 16 blocks ==11944== possibly

  1   2   >