Re: To make simpleXMLRPC support multi-thread

2013-08-08 Thread dieter
Zhang JiaQiang writes: > I try to use simpleXMLRPC and support request multithreads ,used > ThreadingMixIn. > > Why what I get from the console still blocking ? I am not sure - but, you fail to call the inherited "__init__" method in your deriving class. This might things mess up. > ... > clas

Re: Is it possible to make a unittest decorator to rename a method from "x" to "testx?"

2013-08-08 Thread Peter Otten
adam.pre...@gmail.com wrote: > On Thursday, August 8, 2013 3:50:47 AM UTC-5, Peter Otten wrote: >> Peter Otten wrote: >> Oops, that's an odd class name. Fixing the name clash in Types.__new__() >> is >> >> left as an exercise... > > Interesting, I got __main__.T, even though I pretty much just t

Re: Resolving import errors reported by PyLint in modules using Python.NET

2013-08-08 Thread Benjamin Kaplan
On Thu, Aug 8, 2013 at 10:17 PM, wrote: > PyLint can't figure out imports of .NET code being referenced in my Python > scripts that use Python.NET. I can kind of see why; you have to evaluate > some clr.AddReference calls for the imports to even succeed. I wonder if I > have any recourse. G

Resolving import errors reported by PyLint in modules using Python.NET

2013-08-08 Thread adam . preble
PyLint can't figure out imports of .NET code being referenced in my Python scripts that use Python.NET. I can kind of see why; you have to evaluate some clr.AddReference calls for the imports to even succeed. I wonder if I have any recourse. Generally, to import a DLL you have to do a few thi

Re: Is it possible to make a unittest decorator to rename a method from "x" to "testx?"

2013-08-08 Thread adam . preble
On Thursday, August 8, 2013 3:50:47 AM UTC-5, Peter Otten wrote: > Peter Otten wrote: > Oops, that's an odd class name. Fixing the name clash in Types.__new__() is > > left as an exercise... Interesting, I got __main__.T, even though I pretty much just tried your code wholesale. For what it's

Re: [tkinter] trouble running imported modules in main program

2013-08-08 Thread David
On 9 August 2013 14:28, snakeinmyboot wrote: > On Thursday, August 8, 2013 1:13:48 AM UTC-4, David wrote: >> On 8 August 2013 14:06, snakeinmyboot wrote: >> >> Did you try at all to find the answer to this yourself? >> >> I ask because it took me only a few seconds to go to wikipedia and >> searc

Re: Using sudo to write to a file as root from a script

2013-08-08 Thread David
On 9 August 2013 14:11, Adam Mercer wrote: > > I'm trying to write a script that writes some content to a file root > through sudo, but it's not working at all. I am using: [...] At a quick glance, I have a couple of suggestions. > command = ['echo', '-n', channel, '|', 'sudo', 'tee', config_

Re: Using sudo to write to a file as root from a script

2013-08-08 Thread Denis McMahon
On Thu, 08 Aug 2013 23:11:09 -0500, Adam Mercer wrote: > Hi > > I'm trying to write a script that writes some content to a file root > through sudo, but it's not working at all. I am using: > > channel = 'stable' > config_file = '/opt/ldg/etc/channel.conf' > command = ['echo', '-n', channe

Re: [tkinter] trouble running imported modules in main program

2013-08-08 Thread snakeinmyboot
On Thursday, August 8, 2013 1:13:48 AM UTC-4, David wrote: > On 8 August 2013 14:06, snakeinmyboot wrote: > > > > > > for REAL you guys...wtf does this even mean lol. what is a boilerplate test > > code? > > > > Did you try at all to find the answer to this yourself? > > > > I ask because

Using sudo to write to a file as root from a script

2013-08-08 Thread Adam Mercer
Hi I'm trying to write a script that writes some content to a file root through sudo, but it's not working at all. I am using: channel = 'stable' config_file = '/opt/ldg/etc/channel.conf' command = ['echo', '-n', channel, '|', 'sudo', 'tee', config_file] p = subprocess.Popen(command, stdo

Re: Python 3 and SSH Tunnel

2013-08-08 Thread Chris Angelico
On Fri, Aug 9, 2013 at 1:50 AM, D. Xenakis wrote: >> Alternatively, can you use PostgreSQL instead? :) > > Yes there is such an option to be honest. > Would that be helpfull instead of MySQL? It would, mainly because it's simply a better database engine. Everything to do with tunneling is going t

Re: Python 3 and SSH Tunnel

2013-08-08 Thread Chris Angelico
On Fri, Aug 9, 2013 at 1:46 AM, D. Xenakis wrote: > I've played with putty to achieve this but to be honest i'd like something > more efficient. Opening putty everytime and making all the connection > settings etc, and then running the programm, is kinda messy. Id like this to > be done in an a

Re: Python 3 and SSH Tunnel

2013-08-08 Thread D. Xenakis
> Alternatively, can you use PostgreSQL instead? :) Yes there is such an option to be honest. Would that be helpfull instead of MySQL? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3 and SSH Tunnel

2013-08-08 Thread D. Xenakis
> > HOWTO anyone? > > > > > > What im trying to succeed here is create one SSH tunnel, so that i can > > connect from a python script running on my pc, to a remote MySQL database > > running on my Host and id like to stick with Python 3.3 . > > > > > > I contacted my host and he informed me

Re: Python 3 and SSH Tunnel

2013-08-08 Thread Chris Angelico
On Thu, Aug 8, 2013 at 8:30 PM, D. Xenakis wrote: > HOWTO anyone? > > What im trying to succeed here is create one SSH tunnel, so that i can > connect from a python script running on my pc, to a remote MySQL database > running on my Host and id like to stick with Python 3.3 . > > I contacted my

Re: Issues with if and elif statements in 3.3

2013-08-08 Thread Kris Mesenbrink
WOW as if it was something as easy as that,i had been looking for awhile on what i was doing wrong. as it seems i just don't know my way around if statements at all, thank a bunch for this. makes everything else i have been code work thanks again -- http://mail.python.org/mailman/listinfo/pyt

Re: Suggestion: PEP for popping slices from lists

2013-08-08 Thread Terry Reedy
On 8/8/2013 5:32 PM, Joshua Landau wrote: On 8 August 2013 21:03, Terry Reedy wrote: If .pop were being added today, I would argue against including the index parameter. GASP! That's no fair! 1) When using pop you normally want to keep the mutability available, so iter(mylist) is a no-go. 2)

Re: Suggestion: PEP for popping slices from lists

2013-08-08 Thread Tim Chase
On 2013-08-08 22:32, Joshua Landau wrote: > On 8 August 2013 21:03, Terry Reedy wrote: > > If .pop were being added today, I would argue against including > > the index parameter. > > 3) There's always deque for deques Unless you have pre-2.4 code, in which case I'm glad .pop() was included (but

Re: Suggestion: PEP for popping slices from lists

2013-08-08 Thread Joshua Landau
On 8 August 2013 21:03, Terry Reedy wrote: > If .pop were being added today, I would argue against including the index > parameter. GASP! That's no fair! 1) When using pop you normally want to keep the mutability available, so iter(mylist) is a no-go. 2) When using the index, it's often somewher

Re: right adjusted strings containing umlauts

2013-08-08 Thread Terry Reedy
On 8/8/2013 11:24 AM, Kurt Mueller wrote: print( u'{0:>3} {1:>3} {2:>3} {3:>3} {4:>3}'.format( *output_list ) ) Using autonumbering feature, same as print( u'{:>3} {:>3} {:>3} {:>3} {:>3}'.format( *output_list ) ) print( (u' '.join([u'{:>3}']*5)).format(*output_list) ) print( (u' '.join([u'{:

Re: beginner question (True False help)

2013-08-08 Thread Terry Reedy
On 8/8/2013 7:41 AM, Chris Angelico wrote: On Thu, Aug 8, 2013 at 7:20 AM, wrote: def z2(): ... letters = 'abc' ... while True: ... c = input('letter: ') ... if c not in letters: ... print('end, fin, Schluss') ... break ... else: ...

Re: Python 3 and SSH Tunnel

2013-08-08 Thread Skip Montanaro
On Thu, Aug 8, 2013 at 2:30 PM, D. Xenakis wrote: > HOWTO anyone? > > What im trying to succeed here is create one SSH tunnel, so that i can > connect from a python script running on my pc, to a remote MySQL database > running on my Host and id like to stick with Python 3.3 . http://lmgtfy.com/

Re: Suggestion: PEP for popping slices from lists

2013-08-08 Thread Terry Reedy
On 8/8/2013 7:44 AM, Neatu Ovidiu wrote: Objection 1. People usually want to chunk sequences, not lists specifically. We now try to add new features that work with iterators and iterables generally, not just lists. This can be useful for doing all kinds of basic stuff. For example if you wa

Python 3 and SSH Tunnel

2013-08-08 Thread D. Xenakis
HOWTO anyone? What im trying to succeed here is create one SSH tunnel, so that i can connect from a python script running on my pc, to a remote MySQL database running on my Host and id like to stick with Python 3.3 . I contacted my host and he informed me that this is the only way. I tried pyc

Re: How Do I get my Python script to attach multiple files and send as a single email

2013-08-08 Thread Joel Goldstick
On Thu, Aug 8, 2013 at 3:19 PM, Gary Herron wrote: > On 08/08/2013 12:05 PM, wachk...@gmail.com wrote: >> >> I have a dilemma I cant figure out how to send multiple files as an >> attachment to my email using this script. I can only send a single file >> attachment . Help!!! Here is my script. >>

Re: How Do I get my Python script to attach multiple files and send as a single email

2013-08-08 Thread Ian Kelly
On Thu, Aug 8, 2013 at 1:05 PM, wrote: > I have a dilemma I cant figure out how to send multiple files as an > attachment to my email using this script. I can only send a single file > attachment . Help!!! Here is my script. You just need to repeat part3 for each attachment. Also the content

Re: paramiko installation problem

2013-08-08 Thread D. Xenakis
Wow thats bad news. Any workaround? What im trying to succeed here is create one SSH tunnel, so that i can connect from a python script running on my pc, to a remote MySQL database running on my Host and id like to stick with Python 3.3 . Any thoughts? -- http://mail.python.org/mailman/listinfo

Re: How Do I get my Python script to attach multiple files and send as a single email

2013-08-08 Thread Gary Herron
On 08/08/2013 12:05 PM, wachk...@gmail.com wrote: I have a dilemma I cant figure out how to send multiple files as an attachment to my email using this script. I can only send a single file attachment . Help!!! Here is my script. All filename's are txt files. There is a standard Python mo

Re: Is it possible to make a unittest decorator to rename a method from "x" to "testx?"

2013-08-08 Thread Terry Reedy
On 8/8/2013 12:20 PM, adam.pre...@gmail.com wrote: On Thursday, August 8, 2013 3:04:30 AM UTC-5, Terry Reedy wrote: def test(f): f.__class__.__dict__['test_'+f.__name__] Sorry, f.__class__ is 'function', not the enclosing class. A decorator for a method could not get the enclosing cl

How Do I get my Python script to attach multiple files and send as a single email

2013-08-08 Thread wachkama
I have a dilemma I cant figure out how to send multiple files as an attachment to my email using this script. I can only send a single file attachment . Help!!! Here is my script. All filename's are txt files. fo = with open(filename,'rb') fo1 = open(filename2,'rb') fo2= open(filename3, 'rb')

Re: paramiko installation problem

2013-08-08 Thread MRAB
On 08/08/2013 19:04, D. Xenakis wrote: import sys print (sys.path) returns: ['C:\\Python33\\Lib\\idlelib', 'C:\\Python33\\lib\\site-packages\\pip-1.4-py3.3.egg', 'C:\\Windows\\system32\\python33.zip', 'C:\\Python33\\DLLs', 'C:\\Python33\\lib', 'C:\\Python33', 'C:\\Python33\\lib\\site-packag

Re: paramiko installation problem

2013-08-08 Thread D. Xenakis
>>> import sys >>> print (sys.path) returns: ['C:\\Python33\\Lib\\idlelib', 'C:\\Python33\\lib\\site-packages\\pip-1.4-py3.3.egg', 'C:\\Windows\\system32\\python33.zip', 'C:\\Python33\\DLLs', 'C:\\Python33\\lib', 'C:\\Python33', 'C:\\Python33\\lib\\site-packages'] then if i type: >>> sys.path

Re: right adjusted strings containing umlauts

2013-08-08 Thread Dave Angel
Kurt Mueller wrote: > Now I have this small example: > -- > #!/usr/bin/env python > # vim: set fileencoding=utf-8 : > > from __future__ import print_function > import sys, shlex > > print( repr( sys.stdin.encoding ) ) > > strg_form = u'{0:>3}

Re: Is it possible to make a unittest decorator to rename a method from "x" to "testx?"

2013-08-08 Thread Ned Batchelder
On 8/8/13 12:17 PM, adam.pre...@gmail.com wrote: On Thursday, August 8, 2013 3:50:47 AM UTC-5, Peter Otten wrote: Peter Otten wrote: Oops, that's an odd class name. Fixing the name clash in Types.__new__() is left as an exercise... I will do some experiments with a custom test loader since I w

RE: Newbie: static typing?

2013-08-08 Thread Prasad, Ramit
Rui Maciel wrote: > Chris Angelico wrote: > > > On Tue, Aug 6, 2013 at 10:01 AM, Rui Maciel wrote: > >> It would be nice if some functions threw an error if they were passed a > >> type > >> they don't support or weren't designed to handle. That would avoid > >> having to deal with some bugs whi

Re: right adjusted strings containing umlauts

2013-08-08 Thread Chris Angelico
On Thu, Aug 8, 2013 at 5:16 PM, Kurt Mueller wrote: > Am 08.08.2013 17:44, schrieb Peter Otten: >> Kurt Mueller wrote: >>> What do I do, when input_strings/output_list has other codings like >>> iso-8859-1? >> >> You have to know the actual encoding. With that information it's easy: > output_l

Re: right adjusted strings containing umlauts

2013-08-08 Thread Peter Otten
Kurt Mueller wrote: > Am 08.08.2013 17:44, schrieb Peter Otten: >> Kurt Mueller wrote: >>> What do I do, when input_strings/output_list has other codings like >>> iso-8859-1? >> >> You have to know the actual encoding. With that information it's easy: > output_list >> ['\xc3\xb6', '\xc3\xbc',

Re: Is it possible to make a unittest decorator to rename a method from "x" to "testx?"

2013-08-08 Thread adam . preble
On Thursday, August 8, 2013 3:04:30 AM UTC-5, Terry Reedy wrote: > I cannot help but note that this is *more* typing. But anyhow, something It wasn't so much about the typing so much as having "test" in front of everything. It's a problem particular to me since I'm writing code that, well, run

Re: right adjusted strings containing umlauts

2013-08-08 Thread Kurt Mueller
Now I have this small example: -- #!/usr/bin/env python # vim: set fileencoding=utf-8 : from __future__ import print_function import sys, shlex print( repr( sys.stdin.encoding ) ) strg_form = u'{0:>3} {1:>3} {2:>3} {3:>3} {4:>3}' for inpt_l

Re: Is it possible to make a unittest decorator to rename a method from "x" to "testx?"

2013-08-08 Thread adam . preble
On Thursday, August 8, 2013 3:50:47 AM UTC-5, Peter Otten wrote: > Peter Otten wrote: > Oops, that's an odd class name. Fixing the name clash in Types.__new__() is > > left as an exercise... I will do some experiments with a custom test loader since I wasn't aware of that as a viable alternativ

Re: Mock pathc question

2013-08-08 Thread balderman
On Thursday, August 8, 2013 12:04:38 PM UTC+2, Jean-Michel Pichavant wrote: > - Mail original - > > > Hi > > 1) I prefer to use start/stop and not the decorator . > > 2) mock_play is the name of the module where the code belongs > > > Thanks > > > Avishay > > Sent from my iPhone > > >

Re: right adjusted strings containing umlauts

2013-08-08 Thread Kurt Mueller
Am 08.08.2013 17:44, schrieb Peter Otten: > Kurt Mueller wrote: >> What do I do, when input_strings/output_list has other codings like >> iso-8859-1? > > You have to know the actual encoding. With that information it's easy: output_list > ['\xc3\xb6', '\xc3\xbc', 'i', 's', 'f'] encoding

Re: right adjusted strings containing umlauts

2013-08-08 Thread Dave Angel
Kurt Mueller wrote: > Am 08.08.2013 16:43, schrieb jfhar...@gmail.com: >> On Thursday, 8 August 2013 15:23:46 UTC+1, Kurt Mueller wrote: >>> I'd like to print strings right adjusted. >>> print( '>{0:>3}<'.format( 'ä' ) ) >> >> Make both strings unicode >> print( u'>{0:>3}<'.format( u'ä' ) ) >> W

Re: right adjusted strings containing umlauts

2013-08-08 Thread Peter Otten
Kurt Mueller wrote: > Am 08.08.2013 16:43, schrieb jfhar...@gmail.com: >> On Thursday, 8 August 2013 15:23:46 UTC+1, Kurt Mueller wrote: >>> I'd like to print strings right adjusted. >>> print( '>{0:>3}<'.format( 'ä' ) ) >> >> Make both strings unicode >> print( u'>{0:>3}<'.format( u'ä' ) ) >> W

Re: right adjusted strings containing umlauts

2013-08-08 Thread Kurt Mueller
Am 08.08.2013 16:43, schrieb jfhar...@gmail.com: > On Thursday, 8 August 2013 15:23:46 UTC+1, Kurt Mueller wrote: >> I'd like to print strings right adjusted. >> print( '>{0:>3}<'.format( 'ä' ) ) > > Make both strings unicode > print( u'>{0:>3}<'.format( u'ä' ) ) > Why not use rjust for it though

Re: right adjusted strings containing umlauts

2013-08-08 Thread MRAB
On 08/08/2013 15:40, Neil Cerutti wrote: On 2013-08-08, Kurt Mueller wrote: I'd like to print strings right adjusted. ( Python 2.7.3, Linux 3.4.47-2.38-desktop ) from __future__ import print_function print( '>{0:>3}<'.format( 'a' ) ) a< But if the string contains an Umlaut: print( '>{0:>3}

Re: Suggestion: PEP for popping slices from lists

2013-08-08 Thread Skip Montanaro
On Thu, Aug 8, 2013 at 6:40 AM, Neatu Ovidiu wrote: > This can be useful for doing all kinds of basic stuff. For example if you > wanted to take 4 items of a list at at a time, do something with them and > then update the list. > > jobs = ['job1', 'job2', 'job3', 'job5', 'job6', 'job7', 'job8',

Re: right adjusted strings containing umlauts

2013-08-08 Thread jfharden
On Thursday, 8 August 2013 15:23:46 UTC+1, Kurt Mueller wrote: > I'd like to print strings right adjusted. > > print( '>{0:>3}<'.format( 'ä' ) ) > Make both strings unicode print( u'>{0:>3}<'.format( u'ä' ) ) Why not use rjust for it though? u'ä'.rjust(3) -- Jonathan -- http://mail.python

Re: right adjusted strings containing umlauts

2013-08-08 Thread Neil Cerutti
On 2013-08-08, Kurt Mueller wrote: > I'd like to print strings right adjusted. > ( Python 2.7.3, Linux 3.4.47-2.38-desktop ) > > from __future__ import print_function > print( '>{0:>3}<'.format( 'a' ) ) >> a< > > But if the string contains an Umlaut: > print( '>{0:>3}<'.format( '??' ) ) >> ??< >

right adjusted strings containing umlauts

2013-08-08 Thread Kurt Mueller
I'd like to print strings right adjusted. ( Python 2.7.3, Linux 3.4.47-2.38-desktop ) from __future__ import print_function print( '>{0:>3}<'.format( 'a' ) ) > a< But if the string contains an Umlaut: print( '>{0:>3}<'.format( 'ä' ) ) > ä< Same with % notation: print( '>%3s<' % ( 'a' ) ) > a<

Re: Suggestion: PEP for popping slices from lists

2013-08-08 Thread Nicholas Cole
On Thu, Aug 8, 2013 at 2:32 PM, Neatu Ovidiu wrote: > On Thursday, August 8, 2013 4:08:13 PM UTC+3, Nicholas wrote: > > On Thu, Aug 8, 2013 at 12:50 PM, Neatu Ovidiu wrote: > > > > > > > > > > On Thursday, August 8, 2013 2:44:05 PM UTC+3, Neatu Ovidiu wrote: > > > > > On Thursday, August 8, 2013

Re: Suggestion: PEP for popping slices from lists

2013-08-08 Thread Neatu Ovidiu
On Thursday, August 8, 2013 4:08:13 PM UTC+3, Nicholas wrote: > On Thu, Aug 8, 2013 at 12:50 PM, Neatu Ovidiu wrote: > > > > > On Thursday, August 8, 2013 2:44:05 PM UTC+3, Neatu Ovidiu wrote: > > > On Thursday, August 8, 2013 2:12:53 PM UTC+3, Nicholas wrote: > > > > > > > On Thu, Aug 8, 2

Re: outputting time in microseconds or milliseconds

2013-08-08 Thread Roy Smith
In article , Skip Montanaro wrote: > When Tim Peters wrote datetime, the world became a better > place. Lots of languages and databases have things called datetimes. It's easy to be lulled into thinking that they're all the same, but they're not. They all have slightly different ranges an

Re: Suggestion: PEP for popping slices from lists

2013-08-08 Thread Nicholas Cole
On Thu, Aug 8, 2013 at 12:50 PM, Neatu Ovidiu wrote: > On Thursday, August 8, 2013 2:44:05 PM UTC+3, Neatu Ovidiu wrote: > > On Thursday, August 8, 2013 2:12:53 PM UTC+3, Nicholas wrote: > > > > > On Thu, Aug 8, 2013 at 11:38 AM, Neatu Ovidiu > wrote: > > > > > > > > > > > > > > > > > > > > > >

Re: outputting time in microseconds or milliseconds

2013-08-08 Thread Skip Montanaro
> i did: > >from time import strftime, time >from datetime import datetime > >now = datetime.now() > >self.logfile.write('%s\t'%(strftime("%Y-%m-%d",))) >self.logfile.write('%s\t'%(now.strftime("%H:%M:%S.%f",))) Note that you don't need the time module here. Datetime objects h

Re: Suggestion: PEP for popping slices from lists

2013-08-08 Thread Neatu Ovidiu
On Thursday, August 8, 2013 2:44:05 PM UTC+3, Neatu Ovidiu wrote: > On Thursday, August 8, 2013 2:12:53 PM UTC+3, Nicholas wrote: > > > On Thu, Aug 8, 2013 at 11:38 AM, Neatu Ovidiu wrote: > > > > > > > > > > > > > > > > > > > > > > > > > But what's your use case? > > > > > > >

Re: Suggestion: PEP for popping slices from lists

2013-08-08 Thread Neatu Ovidiu
On Thursday, August 8, 2013 2:12:53 PM UTC+3, Nicholas wrote: > On Thu, Aug 8, 2013 at 11:38 AM, Neatu Ovidiu wrote: > > > > > > > > > But what's your use case? > > > > > > Does it occur often enough that you cannot afford a two-liner like > > I think uses cases are plenty. > > > > >

Re: Suggestion: PEP for popping slices from lists

2013-08-08 Thread Neatu Ovidiu
On Thursday, August 8, 2013 2:12:53 PM UTC+3, Nicholas wrote: > On Thu, Aug 8, 2013 at 11:38 AM, Neatu Ovidiu wrote: > > > > > > > > > But what's your use case? > > > > > > Does it occur often enough that you cannot afford a two-liner like > > I think uses cases are plenty. > > > > >

Re: beginner question (True False help)

2013-08-08 Thread Chris Angelico
On Thu, Aug 8, 2013 at 7:20 AM, wrote: def z2(): > ... letters = 'abc' > ... while True: > ... c = input('letter: ') > ... if c not in letters: > ... print('end, fin, Schluss') > ... break > ... else: > ... print('do stuff')

Re: Suggestion: PEP for popping slices from lists

2013-08-08 Thread Nicholas Cole
On Thu, Aug 8, 2013 at 11:38 AM, Neatu Ovidiu wrote: > > > > But what's your use case? > > > > Does it occur often enough that you cannot afford a two-liner like > I think uses cases are plenty. > > The possible cases I can think of would be better served with list comprehensions (what you seem t

paramiko installation problem

2013-08-08 Thread D. Xenakis
Im having problems using paramiko after installation on my Win7 64bit system. I can see both paramiko and pycrypto being "there" installed via pip list: I have tried so many different ways but in the end im always getting the same error when trying to import paramiko: (i can import Crypto with no

Re: Suggestion: PEP for popping slices from lists

2013-08-08 Thread Neatu Ovidiu
On Thursday, August 8, 2013 1:07:16 PM UTC+3, Peter Otten wrote: > Neatu Ovidiu Gabriel wrote: > > > > > The list.pop(index) returns the element represented by the index and also > > > reduces the list by removing that element. So it a short one liner for > > > doing both things. But when it c

Re: Issues with if and elif statements in 3.3

2013-08-08 Thread Dave Angel
krismesenbr...@gmail.com wrote: > def town(): > print ("You stand in the middle of Coffeington while you descide what" > " to do next, you have herd rumor of the Coffeington Caves that run" > "under the city, would you like to check them out?") > answer = input() > if answer ==

Re: Suggestion: PEP for popping slices from lists

2013-08-08 Thread Peter Otten
Neatu Ovidiu Gabriel wrote: > The list.pop(index) returns the element represented by the index and also > reduces the list by removing that element. So it a short one liner for > doing both things. But when it comes for popping a slice of the list there > is nothing similar for doing in that simpl

Re: Mock pathc question

2013-08-08 Thread Jean-Michel Pichavant
- Mail original - > Hi > 1) I prefer to use start/stop and not the decorator . > 2) mock_play is the name of the module where the code belongs > Thanks > Avishay > Sent from my iPhone You should not neeed to refer to the Calc class using mock_play since it is defined in the very same

[ActivePython] Add Qt/PyQt and wxWidgets/wxPython?

2013-08-08 Thread Gilles
Hello I upgraded to ActivePython 2.7.2.5, and would like to get started learning about Qt and wxWidgets in Python. I have a couple of question: 1. Are there obvious reasons to choose either QT/PyQt or wxWidgets/wxPython? I have the impression that Qt is a richer GUI than wxWidgets, but it could

Suggestion: PEP for popping slices from lists

2013-08-08 Thread Neatu Ovidiu Gabriel
The list.pop(index) returns the element represented by the index and also reduces the list by removing that element. So it a short one liner for doing both things. But when it comes for popping a slice of the list there is nothing similar for doing in that simple way. If you want to remove a sl

Re: [GUI] Good frameworks for Windows/Mac?

2013-08-08 Thread Gilles
On Thu, 8 Aug 2013 01:47:21 -0700 (PDT), sagar varule wrote: >Pyside is also Good. It has a Designer which can be helpful. Thanks for the info. -- http://mail.python.org/mailman/listinfo/python-list

To make simpleXMLRPC support multi-thread

2013-08-08 Thread Zhang JiaQiang
I try to use simpleXMLRPC and support request multithreads ,used ThreadingMixIn. Why what I get from the console still blocking ? launch the two clients at the same time,one finish, then begin the other, between them there is 15 sec. Here is the console output on server windows: Use Cc to ex

Re: Is it possible to make a unittest decorator to rename a method from "x" to "testx?"

2013-08-08 Thread Peter Otten
Peter Otten wrote: > $ python3 mytestcase_demo.py -v > test_one (__main__.test_two) ... ok > test_two (__main__.test_two) ... ok > > -- > Ran 2 tests in 0.000s Oops, that's an odd class name. Fixing the name clash in Types.__new

Re: [GUI] Good frameworks for Windows/Mac?

2013-08-08 Thread sagar varule
On Tuesday, August 6, 2013 4:05:40 PM UTC+5:30, Gilles wrote: > Hello > > > > I need to write a small GUI application that should run on Windows and > > Mac. > > > > What open-source framework would you recommend? I just need basic > > widgets (button, listbox, etc.) and would rather a solu

Re: Is it possible to make a unittest decorator to rename a method from "x" to "testx?"

2013-08-08 Thread Peter Otten
adam.pre...@gmail.com wrote: > We were coming into Python's unittest module from backgrounds in nunit, > where they use a decorate to identify tests. So I was hoping to avoid the > convention of prepending "test" to the TestClass methods that are to be > actually run. I'm sure this comes up all

Re: Is it possible to make a unittest decorator to rename a method from "x" to "testx?"

2013-08-08 Thread Terry Reedy
On 8/8/2013 2:32 AM, adam.pre...@gmail.com wrote: We were coming into Python's unittest module from backgrounds in nunit, where they use a decorate to identify tests. So I was hoping to avoid the convention of prepending "test" to the TestClass methods that are to be actually run. I'm sure th

Thinking Unicode

2013-08-08 Thread wxjmfauth
I wrote many times on this list, the ascii (generic name for "byte string") world and the unicode world are two incompatible worlds. There are bridges, basically there are incompatible, they requires to think differently. There is an interesting case on the dev list: http://mail.python.org/piperma

Re: Reg secure python environment with web terminal emulator

2013-08-08 Thread Lakshmipathi.G
>> the same exploits. Think of a binary generated elsewhere (where > "gcc" is available) and put into your environment. That's pretty bad news :( > > I am convinced that 100 % security is impossible - and correspondingly > would use a pragmatic approach: I would rely on OS level > constraints (us

Paramiko Help. Execute command to Interactive Shell which is opened by SSHClient()

2013-08-08 Thread sagar varule
Hi All, Im using Paramiko for my SSH automation. Im using method that is shown in demo_simple.py example which comes with Paramiko. Below is code from demo_simple.py. As you can make out, below code opens SSH connection and opens Interactie Shell, and then wait for the command from user. I wan

Issues with if and elif statements in 3.3

2013-08-08 Thread krismesenbrink
def town(): print ("You stand in the middle of Coffeington while you descide what" " to do next, you have herd rumor of the Coffeington Caves that run" "under the city, would you like to check them out?") answer = input() if answer == ("yes") or ("Yes") or ("y"): print("