Re: problem on top-post

2014-08-14 Thread Ben Finney
John Gordon writes: > In luofeiyu > writes: > > > the best way is to excerpt only the relevent portions of the parent > > message ,not top-post nor bottom-post , right? > > The followup text appears underneath the quoted parent message, thus > bottom-post. “Bottom-post” usually refers to the

Re: timedelta problem

2014-08-14 Thread Ian Kelly
On Thu, Aug 14, 2014 at 9:51 PM, Denis McMahon wrote: > > On Fri, 15 Aug 2014 10:24:47 +0800, luofeiyu wrote: > > > import datetime > > t1='Sat, 09 Aug 2014 07:36:46 -0700' > > t2='Sat, 09 Aug 2014 07:36:46 +0700' > > datetime.datetime.strptime(t1,"%a, %d %b %Y %H:%M:%S %z") > > Are you sure? When

Re: timedelta problem

2014-08-14 Thread Chris Angelico
On Fri, Aug 15, 2014 at 1:51 PM, Denis McMahon wrote: > On Fri, 15 Aug 2014 10:24:47 +0800, luofeiyu wrote: > >> import datetime >> t1='Sat, 09 Aug 2014 07:36:46 -0700' >> t2='Sat, 09 Aug 2014 07:36:46 +0700' >> datetime.datetime.strptime(t1,"%a, %d %b %Y %H:%M:%S %z") > > Are you sure? When I try

Re: timedelta problem

2014-08-14 Thread Denis McMahon
On Fri, 15 Aug 2014 10:24:47 +0800, luofeiyu wrote: > import datetime > t1='Sat, 09 Aug 2014 07:36:46 -0700' > t2='Sat, 09 Aug 2014 07:36:46 +0700' > datetime.datetime.strptime(t1,"%a, %d %b %Y %H:%M:%S %z") Are you sure? When I try this I get: ValueError: 'z' is a bad directive in format '%a, %

Re: timedelta problem

2014-08-14 Thread Ian Kelly
On Thu, Aug 14, 2014 at 9:37 PM, Ian Kelly wrote: > On Thu, Aug 14, 2014 at 8:24 PM, luofeiyu wrote: > > t1 is GMT time 2014 00:36:46 > > t2 is GMT time 2014 14:36:46 > > You have it backwards. t1 is a later time than t2. > > > datetime.datetime.strptime do not give me the right answer. >

Re: timedelta problem

2014-08-14 Thread Ian Kelly
On Thu, Aug 14, 2014 at 8:24 PM, luofeiyu wrote: > import datetime > t1='Sat, 09 Aug 2014 07:36:46 -0700' > t2='Sat, 09 Aug 2014 07:36:46 +0700' > >>> datetime.datetime.strptime(t1,"%a, %d %b %Y %H:%M:%S %z") > datetime.datetime(2014, 8, 9, 7, 36, 46, tzinfo=datetime.timezone(datetime.timed > elta

Re: timedelta problem

2014-08-14 Thread Ben Finney
luofeiyu writes: > import datetime > t1='Sat, 09 Aug 2014 07:36:46 -0700' > t2='Sat, 09 Aug 2014 07:36:46 +0700' > >>> datetime.datetime.strptime(t1,"%a, %d %b %Y %H:%M:%S %z") > datetime.datetime(2014, 8, 9, 7, 36, 46, > tzinfo=datetime.timezone(datetime.timed > elta(-1, 61200))) > >>> datetime.

Re: problem on top-post

2014-08-14 Thread Ben Finney
luofeiyu writes: > the best way is to excerpt only the relevent portions of the parent > message ,not top-post nor bottom-post , right? Correct; you should also interleave your responses in the context of the relevant quoted material. See at the link I provided for this style https://en.wikipedi

Re: problem on top-post

2014-08-14 Thread John Gordon
In luofeiyu writes: > the best way is to excerpt only the relevent portions of the parent > message ,not top-post nor bottom-post , right? The followup text appears underneath the quoted parent message, thus bottom-post. -- John Gordon Imagine what it must be like for a real medical

Re: Captcha identify

2014-08-14 Thread Ben Finney
Denis McMahon writes: > On Tue, 12 Aug 2014 18:36:21 -0700, Wesley wrote: > > > […] > We tried polite, it didn't work, now I'm trying robustness and > profanity. The thread has been inactive for days, so it seems politeness *did* in fact work. Escalating to violent indimidating language (regar

Re: problem on top-post

2014-08-14 Thread Cameron Simpson
On 15Aug2014 09:47, luofeiyu wrote: when i search what top-post mean: top-post: n., v. [common] To put the newly-added portion of an email or Usenet response before the quoted part, as opposed to the more logical sequence of quoted portion first with original following. bottom-post: v. In

timedelta problem

2014-08-14 Thread luofeiyu
In the python doc , https://docs.python.org/3.4/library/datetime.html A timedelta object represents a duration, the difference between two dates or times. /class /datetime.timedelta(/days=0/, /seconds=0/, /microseconds=0/,

problem on top-post

2014-08-14 Thread luofeiyu
when i search what top-post mean: *top-post*: n., v. [common] To put the newly-added portion of an email or Usenet response before the quoted part, as opposed to the more logical sequence of quoted portion first with original following. *bottom-post*: v.In a news or mail reply, to put the resp

Re: get the min date from a list

2014-08-14 Thread Dan Stromberg
On Thu, Aug 14, 2014 at 5:44 PM, Mark Lawrence wrote: > I really don't understand why people here are spoon feeding you when you > still insist on top posting. Ever heard the term "manners"? Oh what a > stupid comment, obviously not. > > *plonk* Getting people to stop top-posting is a losing ba

Re: get the min date from a list

2014-08-14 Thread Mark Lawrence
On 15/08/2014 00:22, luofeiyu wrote: I really don't understand why people here are spoon feeding you when you still insist on top posting. Ever heard the term "manners"? Oh what a stupid comment, obviously not. *plonk* -- My fellow Pythonistas, ask not what our language can do for you, ask

Re: PyMatch Tool.

2014-08-14 Thread Skip Montanaro
On Thu, Aug 14, 2014 at 5:49 PM, Chris Angelico wrote: > > > Tool -> https://github.com/rfunix/PyMatch > > How is this better than GNU sed? I didn't look closely at the program, but I have an idea how I might use it. Back in the dawn of Internet time (before Y2K, Django, V8, etc) I developed and

Re: get the min date from a list

2014-08-14 Thread Ian Kelly
On Thu, Aug 14, 2014 at 5:22 PM, luofeiyu wrote: > I am glad to hear that it is no necessary to create a complicated my > function to change the time string. > But in my computer the timezone offset do not work for me. > I am in win7+python34. > import sys sys.version > '3.4.0 (v3.4.0:0

Re: how to change the time string into number?

2014-08-14 Thread Denis McMahon
On Thu, 14 Aug 2014 09:46:20 +0800, luofeiyu wrote: > s="Aug" > > how can i change it into 8 with some python time module? You don't need a time module for this, just use a dictionary: months = { "Jan" : 1, . , "Dec": 12 } num = months[s] print num Fill in the rest of the months dictionary

Re: get the min date from a list

2014-08-14 Thread luofeiyu
I am glad to hear that it is no necessary to create a complicated my function to change the time string. But in my computer the timezone offset do not work for me. I am in win7+python34. >>> import sys >>> sys.version '3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64 bit (AMD6

Re: Captcha identify

2014-08-14 Thread Denis McMahon
On Tue, 12 Aug 2014 18:36:21 -0700, Wesley wrote: > I just wanna a general suggestion here in the beginning. OK, the general suggestion is that you take your spambot software, print it out on spiky metal sheets and ram it up your rectum. > Why I need to write such program is just having such re

Re: Captcha identify

2014-08-14 Thread Denis McMahon
On Wed, 13 Aug 2014 07:39:20 -0400, Eric S. Johansson wrote: > you are clear but also missing a really good reason to break captchas. > handicapped accessibility. Captchas are a huge barrier to access and in > many cases push disabled users away from using a service with captchas. That's as may

Re: PyMatch Tool.

2014-08-14 Thread Chris Angelico
On Fri, Aug 15, 2014 at 5:50 AM, wrote: > Hello, I created this tool to help me develop on formatting text using > regular expressions. > Any questions, I am available. > Thank you. > > Tool -> https://github.com/rfunix/PyMatch How is this better than GNU sed? ChrisA -- https://mail.python.or

Re: Captcha identify

2014-08-14 Thread Chris Angelico
On Fri, Aug 15, 2014 at 4:37 AM, Peter Pearson wrote: > "Which of the following eight sentences are sarcastic in tone?" "You have a sarcasm sign?" http://www.thinkgeek.com/product/e58f/ ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Captcha identify

2014-08-14 Thread Eric S. Johansson
On 8/14/2014 2:37 PM, Peter Pearson wrote: On Wed, 13 Aug 2014 14:16:02 -0600, Ian Kelly wrote: . . . and as computers get more powerful the intersection of {problems machines can't solve} and {problems humans can reliably solve} grows ever smaller. "Which of the following eight sentences are

PyMatch Tool.

2014-08-14 Thread rafinha . unix
Hello, I created this tool to help me develop on formatting text using regular expressions. Any questions, I am available. Thank you. Tool -> https://github.com/rfunix/PyMatch -- https://mail.python.org/mailman/listinfo/python-list

Re: Captcha identify

2014-08-14 Thread Ian Kelly
On Thu, Aug 14, 2014 at 12:37 PM, Peter Pearson wrote: > On Wed, 13 Aug 2014 14:16:02 -0600, Ian Kelly wrote: >> >> . . . and as computers get more powerful the intersection >> of {problems machines can't solve} and {problems humans can reliably >> solve} grows ever smaller. > > "Which of the fol

Re: Captcha identify

2014-08-14 Thread Peter Pearson
On Wed, 13 Aug 2014 14:16:02 -0600, Ian Kelly wrote: > > . . . and as computers get more powerful the intersection > of {problems machines can't solve} and {problems humans can reliably > solve} grows ever smaller. "Which of the following eight sentences are sarcastic in tone?" -- To email me,

Re: Which OAuth library?

2014-08-14 Thread Chris “Kwpolska” Warrick
On 14 August 2014 18:51 "Richard Prosser" wrote: > > I "need" one for use with Flask, as I don't really have time to implement my own. You should not implement things on your own if there are existing and same implementations. > Initially this will be for the "Two-Legged" case but I may well hav

Re: Odd floor-division corner case

2014-08-14 Thread Ian Kelly
On Thu, Aug 14, 2014 at 11:31 AM, Mark Lawrence wrote: > From http://bugs.python.org/issue22198 > -0.5 // float('inf') > -1.0 Looks like the result is the same for any negative dividend. > What should it be? It's surprising, but I think it's correct. A negative infinitesimal would be less

Odd floor-division corner case

2014-08-14 Thread Mark Lawrence
From http://bugs.python.org/issue22198 >>> -0.5 // float('inf') -1.0 What should it be? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: get the min date from a list

2014-08-14 Thread Ian Kelly
On Thu, Aug 14, 2014 at 8:10 AM, luofeiyu wrote: > I finished it ,but how to make it into more pythonic way such as > > min (dates, key = converter) The converter will be your changeToUnix function, but you'll need to rework it to convert a single, rather than the whole list. > def changeToUnix

Re: get the min date from a list

2014-08-14 Thread Marko Rauhamaa
luofeiyu : > y=time.strptime(time_part,"%a, %d %b %Y %H:%M:%S") As I said, whether that works depends on your locale -- according to the reference documentation. In practice, I couldn't get that to fail in my tests. I would be on my guard, though. That might mean I couldn't use strptime

Re: Matplotlib Contour Plots

2014-08-14 Thread Steven D'Aprano
Jamie Mitchell wrote: > Hello all, > > I want to contour a scatter plot but I don't know how. > > Can anyone help me out? Certainly. Which way did you come in? :-) Sorry, I couldn't resist. It took me literally 20 seconds to find this by googling for "matplotlib contour plot", and it only t

Which OAuth library?

2014-08-14 Thread Richard Prosser
I "need" one for use with Flask, as I don't really have time to implement my own. Initially this will be for the "Two-Legged" case but I may well have to support the "Three-Legged" version later on. "Open ID Connect" may also be an option eventually. The basic idea is to provide an authorizati

Re: Unable to run print('Réussi') on windows and on linux

2014-08-14 Thread Ian Kelly
On Thu, Aug 14, 2014 at 9:21 AM, Steven D'Aprano wrote: > YBM wrote: > >> Le 14/08/2014 16:04, marc.vanhoomis...@gmail.com a écrit : >>> Hello YBM, >>> I tried your suggestions, without improvement. >>> Further, see my answer to Vincent Vande Vyre >>> Thanks anyway. >> >> This is indeed very surpr

Re: Code to Python 27 prompt to access a html file stored on C drive

2014-08-14 Thread Ian Kelly
On Thu, Aug 14, 2014 at 9:33 AM, alister wrote: > On Thu, 14 Aug 2014 08:09:11 -0700, Simon Evans wrote: > >> Dear Programmers, I want to access a html file on my C drive, in the >> >> Python 27 prompt, all the examples I come across seem to require for >> >> access for the html file be on a serv

Re: Unable to run print('Réussi') on windows and on linux

2014-08-14 Thread Peter Otten
marc.vanhoomis...@gmail.com wrote: > Le jeudi 14 août 2014 15:22:52 UTC+2, Vincent Vande Vyvre a écrit : >> Are you really using Python 3 ? >> $ python3 test.py > > Actually, when I try using a terminal, it works: > $ python3 test.py > Réussi > > But when I issue the same command using webmin

Re: Code to Python 27 prompt to access a html file stored on C drive

2014-08-14 Thread alister
On Thu, 14 Aug 2014 08:09:11 -0700, Simon Evans wrote: > Dear Programmers, I want to access a html file on my C drive, in the > > Python 27 prompt, all the examples I come across seem to require for > > access for the html file be on a server, rather than on the same > > computer's C drive. I

Matplotlib Contour Plots

2014-08-14 Thread Jamie Mitchell
Hello all, I want to contour a scatter plot but I don't know how. Can anyone help me out? Cheers, Jamie -- https://mail.python.org/mailman/listinfo/python-list

Re: Unable to run print('Réussi') on windows and on linux

2014-08-14 Thread Steven D'Aprano
YBM wrote: > Le 14/08/2014 16:04, marc.vanhoomis...@gmail.com a écrit : >> Hello YBM, >> I tried your suggestions, without improvement. >> Further, see my answer to Vincent Vande Vyre >> Thanks anyway. > > This is indeed very surprising. Are you sure that you > have *exactly* this line at the fir

Code to Python 27 prompt to access a html file stored on C drive

2014-08-14 Thread Simon Evans
Dear Programmers, I want to access a html file on my C drive, in the Python 27 prompt, all the examples I come across seem to require for access for the html file be on a server, rather than on the same computer's C drive. I want to do this as a prerequisite to writing webscraping code, s

Re: get the min date from a list

2014-08-14 Thread Mark Lawrence
On 14/08/2014 15:10, luofeiyu wrote: How many times do you have to be asked not to top post before the message sinks in? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-

Re: Unable to run print('Réussi') on windows and on linux

2014-08-14 Thread YBM
Le 14/08/2014 16:04, marc.vanhoomis...@gmail.com a écrit : Hello YBM, I tried your suggestions, without improvement. Further, see my answer to Vincent Vande Vyre Thanks anyway. This is indeed very surprising. Are you sure that you have *exactly* this line at the first or second (not later !) li

Re: Unable to run print('Réussi') on windows and on linux

2014-08-14 Thread Vincent Vande Vyvre
Le 14/08/2014 15:31, YBM a écrit : Le 14/08/2014 14:35, marc.vanhoomis...@gmail.com a écrit : Hello, This very simple program runs well on windows 7 # -*- utf8 -*- print('Réussi') But, when I start the vrey same file on Linux (ubuntu 14), I got: Traceback (most recent call last): File "/p

Re: Unable to run print('Réussi') on windows and on linux

2014-08-14 Thread Anssi Saari
marc.vanhoomis...@gmail.com writes: > What should i do to let the same program run on both OS, without changes? You'd want to set the locale on your Ubuntu box to a UTF8 locale. On the command line you'd run sudo dpkg-reconfigure locales and proceed from there, but I guess there might be gooey wa

Re: Unable to run print('Réussi') on windows and on linux

2014-08-14 Thread Mark Lawrence
On 14/08/2014 15:04, marc.vanhoomis...@gmail.com wrote: Hello YBM, I tried your suggestions, without improvement. Further, see my answer to Vincent Vande Vyre Thanks anyway. I'm pleased to see that you have answers. In return would you please quote the context. Could you also access this li

Re: get the min date from a list

2014-08-14 Thread luofeiyu
I finished it ,but how to make it into more pythonic way such as min (dates, key = converter) here is my code times=['Sat, 09 Aug 2014 07:36:46 -0700', 'Fri, 8 Aug 2014 22:25:40 -0400', 'Sat, 9 Aug 2014 12:46:43 +1000', 'Sat, 9 Aug 2014 12:50:52 +1000', 'Sat, 9 Aug 2014 02:51:01 + (UTC)', '

Re: Unable to run print('Réussi') on windows and on linux

2014-08-14 Thread marc . vanhoomissen
Le jeudi 14 août 2014 15:22:52 UTC+2, Vincent Vande Vyvre a écrit : > Le 14/08/2014 14:35, marc.vanhoomis...@gmail.com a �crit : > > > Hello, > > > > > > This very simple program runs well on windows 7 > > > > > > # -*- utf8 -*- > > > print('R�ussi') > > > > > > But, when I start the vr

Re: Unable to run print('Réussi') on windows and on linux

2014-08-14 Thread marc . vanhoomissen
Hello YBM, I tried your suggestions, without improvement. Further, see my answer to Vincent Vande Vyre Thanks anyway. -- https://mail.python.org/mailman/listinfo/python-list

Re: [Q] is 'yield from' syntax sugar for 'for'+'yield'?

2014-08-14 Thread Steven D'Aprano
Makoto Kuwata wrote: > Question about 'yield from'. > > I understand that:: > > yield from xs > > is syntax suger of:: > > for x in xs: > yield x Not quite syntactic sugar. For simple cases, it does exactly the same thing. For more complicated cases, no. Suppose you have a gene

Re: Unable to run print('Réussi') on windows and on linux

2014-08-14 Thread YBM
Le 14/08/2014 14:35, marc.vanhoomis...@gmail.com a écrit : Hello, This very simple program runs well on windows 7 # -*- utf8 -*- print('Réussi') But, when I start the vrey same file on Linux (ubuntu 14), I got: Traceback (most recent call last): File "/partages/bureau/PB/Dev/Python3/test.p

Re: Unable to run print('Réussi') on windows and on linux

2014-08-14 Thread Vincent Vande Vyvre
Le 14/08/2014 14:35, marc.vanhoomis...@gmail.com a écrit : Hello, This very simple program runs well on windows 7 # -*- utf8 -*- print('Réussi') But, when I start the vrey same file on Linux (ubuntu 14), I got: Traceback (most recent call last): File "/partages/bureau/PB/Dev/Python3/test.p

Re: how to change the time string into number?

2014-08-14 Thread Ben Finney
Dennis Lee Bieber writes: > "Android" /is/ the flavor > > Though Google has probably done some things to it that make it > "not-Linux". Android is definitely Linux, since that is the kernel Android runs. Remember that Linux is not an operating system; it is one part, the kernel. Th

Re: how to change the time string into number?

2014-08-14 Thread Roy Smith
In article , Dennis Lee Bieber wrote: > On Thu, 14 Aug 2014 17:47:00 +1000, Cameron Simpson > declaimed the following: > > > > >Your Android phone will be running some flavour of Linux I believe. Someone > >who > >has used one may correct me here. > > > "Android" /is/ the flavor > >

Re: [Q] is 'yield from' syntax sugar for 'for'+'yield'?

2014-08-14 Thread Makoto Kuwata
On Thu, Aug 14, 2014 at 7:02 PM, Chris Angelico wrote: > On Thu, Aug 14, 2014 at 7:59 PM, Makoto Kuwata wrote: > > I understand that 'val = yield from xs' is completely different from:: > > > >for x in xs: > > ret = yield x > >val = x > > > > Return value is propagated by StopItera

Unable to run print('Réussi') on windows and on linux

2014-08-14 Thread marc . vanhoomissen
Hello, This very simple program runs well on windows 7 # -*- utf8 -*- print('Réussi') But, when I start the vrey same file on Linux (ubuntu 14), I got: Traceback (most recent call last): File "/partages/bureau/PB/Dev/Python3/test.py", line 2, in print('R\xe9ussi') UnicodeEncodeError: 'as

Re: newbee

2014-08-14 Thread alister
On Wed, 13 Aug 2014 15:31:37 -0400, Terry Reedy wrote: > On 8/13/2014 7:55 AM, alister wrote: >> >> I am not in the same league as many of the posters here when it comes >> to Python but fortunately i do have two Raspberry Pi's :-) > > Great! We really someone with hands-on experience. I Hope th

Re: Optional static typing

2014-08-14 Thread Skip Montanaro
On Thu, Aug 14, 2014 at 12:02 AM, Steven D'Aprano wrote: > Does anyone here use function annotations? If so, what do you use them > for? I've used them a little when converting Python to Cython, though I readily admit that I have no idea if what Cython accepts as a type declaration is compatible

Re: Captcha identify

2014-08-14 Thread alister
On Wed, 13 Aug 2014 07:39:20 -0400, Eric S. Johansson wrote: > On 8/12/2014 9:46 PM, Chris Angelico wrote: >> On Wed, Aug 13, 2014 at 11:36 AM, Wesley wrote: >>> If my questions make you guys not so happy, I am sorry and please just >>> ignore. >>> I just wanna a general suggestion here in the be

Re: Python Object Systems

2014-08-14 Thread Michele Simionato
Il giorno mercoledì 13 agosto 2014 19:13:16 UTC+2, thequie...@gmail.com ha scritto: > What is the difference between traits and roles? People keep using the same names to mean different concepts. For me traits are the things described here: http://www.iam.unibe.ch/~scg/Archive/Papers/Scha03aTra

Re: [Q] is 'yield from' syntax sugar for 'for'+'yield'?

2014-08-14 Thread Marko Rauhamaa
Makoto Kuwata : > Thank you. It seems too complicated... I recommend you stop trying to associate the "old" yield with the "new" yield. Asyncio coroutines "abuse" "yield from" for a specific effect. The classic purpose of "yield" was to spoonfeed a sequence of return values to the caller. The co

Re: [Q] is 'yield from' syntax sugar for 'for'+'yield'?

2014-08-14 Thread Chris Angelico
On Thu, Aug 14, 2014 at 7:59 PM, Makoto Kuwata wrote: > I understand that 'val = yield from xs' is completely different from:: > >for x in xs: > ret = yield x >val = x > > Return value is propagated by StopIteration, like: > >it = iter(xs) >try: > while 1: >yield

Re: [Q] is 'yield from' syntax sugar for 'for'+'yield'?

2014-08-14 Thread Marko Rauhamaa
Makoto Kuwata : > val = yield from xs > > is same as:: > > for x in xs: > ret = yield x > val = ret > > Is it true? Do I understand correctly? The return value is not one of the yielded values. Instead, it's the value returned by the generator/coroutine. Marko -- https://mail

Re: [Q] is 'yield from' syntax sugar for 'for'+'yield'?

2014-08-14 Thread Makoto Kuwata
On Thu, Aug 14, 2014 at 6:38 PM, Chris Angelico wrote: > On Thu, Aug 14, 2014 at 7:35 PM, Makoto Kuwata wrote: > > I understand that:: > > > > yield from xs > > > > is syntax suger of:: > > > > for x in xs: > > yield x > > Not just. It's like that for simple cases, but there are ed

Re: [Q] is 'yield from' syntax sugar for 'for'+'yield'?

2014-08-14 Thread Chris Angelico
On Thu, Aug 14, 2014 at 7:35 PM, Makoto Kuwata wrote: > I understand that:: > > yield from xs > > is syntax suger of:: > > for x in xs: > yield x Not just. It's like that for simple cases, but there are edge cases that are much more complicated to do manually, and are simply taken c

[Q] is 'yield from' syntax sugar for 'for'+'yield'?

2014-08-14 Thread Makoto Kuwata
Question about 'yield from'. I understand that:: yield from xs is syntax suger of:: for x in xs: yield x And:: val = yield from xs is same as:: for x in xs: ret = yield x val = ret Is it true? Do I understand correctly? quote from https://docs.python.org/3

Re: pexpect - logging input AND output

2014-08-14 Thread Chris Angelico
On Thu, Aug 14, 2014 at 6:59 PM, wrote: > i have a script running a few commands on a network device. i can't seem to > figure out how to log both the input and output of what the pexpect script > initiates and responds to. > > child = pexpect.spawn ('telnet '+ ip) If that's not working for yo

ANN: eGenix pyOpenSSL Distribution 0.13.4.1.0.1.9

2014-08-14 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com pyOpenSSL Distribution Version 0.13.4.1.0.1.9 An easy-to-install and easy-to-use distribution of the pyOpenSSL Python interface fo

pexpect - logging input AND output

2014-08-14 Thread sj . constantine
i have a script running a few commands on a network device. i can't seem to figure out how to log both the input and output of what the pexpect script initiates and responds to. child = pexpect.spawn ('telnet '+ ip) child.expect ('.*:*') child.sendline (user) child.expect ('.*:*') child.sendline

Re: how to write a function to make operation as a argument in the function

2014-08-14 Thread Mark Lawrence
On 14/08/2014 08:32, luofeiyu wrote: I want to write a function to make operation as a argument in the function. |def fun(op,x,y): return(x op y)| it is my target for the funciton: if op ="+" fun(op,3,9) =12 if op ="*" fun(op,3,9) =27 How to write it? With a text editor after you've

Re: what is the "/" mean in __init__(self, /, *args, **kwargs) ?

2014-08-14 Thread Mark Lawrence
On 14/08/2014 03:08, Ben Finney wrote: luofeiyu writes: help(int.__init__) Help on wrapper_descriptor: __init__(self, /, *args, **kwargs) Initialize self. See help(type(self)) for accurate signature. what is the "/" mean in __init__(self, /, *args, **kwargs) ? I don't know, I haven'

Re: how to change the time string into number?

2014-08-14 Thread Mark Lawrence
On 14/08/2014 02:46, luofeiyu wrote: s="Aug" how can i change it into 8 with some python time module? If all else fails, read the instructions, so start here https://docs.python.org/3/library/datetime.html#module-datetime -- My fellow Pythonistas, ask not what our language can do for you, a

Re: a python console in bluestacks

2014-08-14 Thread Chris “Kwpolska” Warrick
On Aug 14, 2014 9:23 AM, "luofeiyu" wrote: > > i want to run python on my android phone ,to install python on bluestacks is to emulate it . In this case, you can install QPython, which supports the SL4A modules and has a console. Or, you can install an app to access sh, like ConnectBot (though be

how to write a function to make operation as a argument in the function

2014-08-14 Thread luofeiyu
I want to write a function to make operation as a argument in the function. |def fun(op,x,y): return(x op y)| it is my target for the funciton: if op ="+" fun(op,3,9) =12 if op ="*" fun(op,3,9) =27 How to write it? -- https://mail.python.org/mailman/listinfo/python-list

Re: how to change the time string into number?

2014-08-14 Thread Cameron Simpson
On 14Aug2014 14:52, luofeiyu wrote: in the manual  https://docs.python.org/3.4/library/time.html ┌──┬──┬─┐ │ │Time zone offset indicating a positive or negative time difference│ │ │%z│from UTC/GMT of the form +HHMM or -HHM

Re: a python console in bluestacks

2014-08-14 Thread Steven D'Aprano
On Thu, 14 Aug 2014 08:25:00 +0200, Chris “Kwpolska” Warrick wrote: > Why are you using an Android emulator to run Python, a PC-first > software?! Just install the Windows version from http://python.org/ and > use that. If the OP's ultimate aim is to run Python under Android, running it under an

Re: how to change the time string into number?

2014-08-14 Thread Cameron Simpson
On 14Aug2014 15:30, luofeiyu wrote: import sys sys.version '3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64 bit (AMD64)]' First, please post in an interleaved style so that we can see your responses underneath the text to which they relate. Thanks. Ok, you have Python 3.4

Re: how to change the time string into number?

2014-08-14 Thread luofeiyu
>>> import sys >>> sys.version '3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64 bit (AMD64)]' >>> import time >>> time.tzname ('China Standard Time', 'China Daylight Time') On 8/14/2014 3:25 PM, Cameron Simpson wrote: On 14Aug2014 14:52, luofeiyu wrote: in the manual http

Re: a python console in bluestacks

2014-08-14 Thread luofeiyu
i want to run python on my android phone ,to install python on bluestacks is to emulate it . On 8/14/2014 2:56 PM, Cameron Simpson wrote: On 14Aug2014 08:25, Chris =?utf-8?B?4oCcS3dwb2xza2HigJ0=?= Warrick wrote: On Aug 14, 2014 4:30 AM, "luofeiyu" wrote: I have installed bluestacks(an andro

Re: how to change the time string into number?

2014-08-14 Thread Ben Finney
Please don't top-post your response. Instead, interleave your response and remove irrelevant quoted material. Use the Interleaved style https://en.wikipedia.org/wiki/Posting_style#Interleaved_style>. luofeiyu writes: > in the manual https://docs.python.org/3.4/library/time.html > > %zTime z

Re: what is the "/" mean in __init__(self, /, *args, **kwargs) ?

2014-08-14 Thread luofeiyu
python3.4 On 8/14/2014 10:12 AM, Tim Chase wrote: On 2014-08-14 10:01, luofeiyu wrote: >>> help(int.__init__) Help on wrapper_descriptor: __init__(self, /, *args, **kwargs) Initialize self. See help(type(self)) for accurate signature. what is the "/" mean in __init__(self, /, *args