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." 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: http://gbaz.github.io/slides/hurt-statictyping-07-2013.pdf I

Re: Simplex Algorithm

2013-09-02 Thread Oscar Benjamin
On Sep 2, 2013 2:31 AM, "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

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

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

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." 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 Robert Kern
On 2013-09-02 09:06, Oscar Benjamin wrote: On Sep 2, 2013 2:31 AM, "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

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 l

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: is not a cascading control. [...] > All these discussions > about comb

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 sce

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 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 like debating tabs

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

2013-09-02 Thread Chris Angelico
On Mon, Sep 2, 2013 at 3:28 PM, 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, it returns

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: > > > > is n

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 newlin

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 encod

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 p

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 which

Re: A Pragmatic Case for Static Typing

2013-09-02 Thread Chris Angelico
On Mon, Sep 2, 2013 at 6:10 PM, 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 hour video: > >

Re: UnicodeDecodeError issue

2013-09-02 Thread Dave Angel
On 2/9/2013 07:49, Ferrous Cranus wrote: > Στις 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')

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: >> ¶γνωστοόνομα συστήματος >> >> 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

Re: A Pragmatic Case for Static Typing

2013-09-02 Thread Roy Smith
In article <7xfvtnwsn9@ruckus.brouhaha.com>, 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

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. Wh

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 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 n

Re: semicolon at end of python's statements

2013-09-02 Thread Grant Edwards
On 2013-08-31, Paul Rudin wrote: > Jussi Piitulainen 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 thing? Perhaps he's worried about

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 option

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" 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

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 exportin

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: ¶γνωστοόνομα συστήματος 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 mos

Re: semicolon at end of python's statements

2013-09-02 Thread Roy Smith
In article , Tim Chase 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 running out of tabs? > > > > I heard that most of the tab mines

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 > 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

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 it?

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 get

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

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_optio

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) I'

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 me

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

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 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. Basically, I want

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 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. Basically, I want > to

Re: user interfaces python3.x

2013-09-02 Thread Paul Rudin
Steven D'Aprano 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, I'd love to tell you the

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 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

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 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

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 i

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

2013-09-02 Thread Roy Smith
In article , Anthony Papillion wrote: > On 09/02/2013 11:12 AM, Chris “Kwpolska” Warrick wrote: > > On Mon, Sep 2, 2013 at 6:06 PM, Anthony Papillion > > wrote: > >> Hello Everyone, > >> > >> I have a multi-line string and I need to remove the very first line from > >> it. How can I do tha

Re: user interfaces python3.x

2013-09-02 Thread Joel Goldstick
On Mon, Sep 2, 2013 at 12:18 PM, Paul Rudin wrote: > Steven D'Aprano 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. Y

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 : > 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

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 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 phonebook just for thi

Re: Cookie or not..?

2013-09-02 Thread Joel Goldstick
On Mon, Sep 2, 2013 at 1:11 PM, 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: > http://[domain].com/loginh.aspx?SID=[xxx]&USER=[xxx]&PW

Re: user interfaces python3.x

2013-09-02 Thread Joel Goldstick
On Mon, Sep 2, 2013 at 1:16 PM, Joe Junior wrote: > On 2 September 2013 14:00, Paul Rice 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 giv

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 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: do_something else() which

Re: user interfaces python3.x

2013-09-02 Thread Joe Junior
On 2 September 2013 14:30, Joel Goldstick wrote: > On Mon, Sep 2, 2013 at 1:16 PM, Joe Junior wrote: >> On 2 September 2013 14:00, Paul Rice 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

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. Pytho

Re: semicolon at end of python's statements

2013-09-02 Thread Roy Smith
In article , "albert visser" 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'), open('another_file, 'w') as _in, _out: -- http://mail.python.org/mailman/li

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

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 t

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') >

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

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 l

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 "", line 1 r'\' ^ SyntaxError: EOL while scan

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 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 indent

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

2013-09-02 Thread Chris Angelico
On Tue, Sep 3, 2013 at 3:52 AM, 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 is not the corr

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 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 in REXX), it'd nee

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

Re: Python FTP timeout value not effective

2013-09-02 Thread David Bolen
John Nagle 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) # ge

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 un

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 ev

Re: Python FTP timeout value not effective

2013-09-02 Thread Chris Angelico
On Tue, Sep 3, 2013 at 3:43 AM, John Nagle wrote: > "URLError: failed because the connected party did not properly respond after a > period of time, or established connection failed because connected host > has failed to respond>" > > But in both cases, the command line FTP client will work, afte

Re: A Pragmatic Case for Static Typing

2013-09-02 Thread Chris Angelico
On Mon, Sep 2, 2013 at 10:41 PM, Roy Smith wrote: > In article <7xfvtnwsn9@ruckus.brouhaha.com>, > 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. >

Re: UnicodeDecodeError issue

2013-09-02 Thread Chris Angelico
On Tue, Sep 3, 2013 at 12:44 AM, MRAB 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

Re: Encapsulation unpythonic?

2013-09-02 Thread Rhodri James
On Sat, 31 Aug 2013 12:46:52 +0100, Steven D'Aprano 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 Not directly, but FORTRAN did (does

Re: semicolon at end of python's statements

2013-09-02 Thread Roy Smith
In article , Modulok 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 style than I do. Python as > > a language tries too hard to enforc

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 ha

Re: Newbie: use of built-in exceptions

2013-09-02 Thread Cameron Simpson
On 01Sep2013 13:26, Chris “Kwpolska” Warrick wrote: | On Sun, Sep 1, 2013 at 1:17 PM, Rui Maciel 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 define custom exceptions instead? |

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 don't

Re: UnicodeDecodeError issue

2013-09-02 Thread Joel Goldstick
On Mon, Sep 2, 2013 at 6:45 PM, Chris Angelico wrote: > On Tue, Sep 3, 2013 at 12:44 AM, MRAB 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. You need to be rigorous to make

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 onl

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 accep

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 main() File "./main.py", line 91, in main interfac

Re: problem of double import in python

2013-09-02 Thread Joel Goldstick
On Mon, Sep 2, 2013 at 9:16 PM, Mohsen Pahlevanzadeh 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 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, everything t

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 progra

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 windo

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 ra

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

Re: Cookie or not..?

2013-09-02 Thread dieter
mrcol...@gmail.com writes: > 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 trip

Re: How to execute command on remote windows machine

2013-09-02 Thread gaurangnshah
Hi alex I tried the command you suggested however it is giving me following error. ERROR: The RPC server is unavailable. On Tuesday, 3 September 2013 11:03:17 UTC+5:30, alex23 wrote: > On 3/09/2013 2:45 PM, gaurangns...@gmail.com wrote: > > > I have a requirement where i need to kill one pro