Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread Marko Rauhamaa
Gregory Ewing : > bartc wrote: >> Most of my loops start off as endless loops, until I can determine >> the actual terminating condition, and where it best goes. > > Interesting. My experience is quite different. Most of the loops I > write start off with me thinking "Now I want to do this for eac

Re: Merging multiple sorted sequences.

2017-04-17 Thread Andre Müller
Hi, when you have lists with different lengths and want to zip them, you should look at itertools.zip_longest Greetings Andre -- https://mail.python.org/mailman/listinfo/python-list

Re: Moderating the list [was: Python and the need for speed]

2017-04-17 Thread breamoreboy
On Thursday, April 13, 2017 at 10:31:22 AM UTC+1, Tim Golden wrote: > On 13/04/2017 03:39, Jason Friedman wrote: > >> > >> However, it's simply a technical fact: the thing which we moderate is the > >>> mailing list. We can control which posts make it through from the > >>> newsgroup > >>> by bloc

Re: Swiss Ephemeris

2017-04-17 Thread Peter Henry
Hi I hired a programmer to help to extract data for windows 10 64 Bit system You will be able generate data and use for your models, the idea is to eventually get Swiss Ephemeris working as phython file Create folder and use and drop Swedll64.dll and Swetest64.exe into same folder as spreadshe

Re: Python Command Line Arguments

2017-04-17 Thread breamoreboy
On Friday, April 14, 2017 at 2:44:09 PM UTC+1, Bernd Nawothnig wrote: > On 2017-04-13, Jason Friedman wrote: > >> I have this code which I got from https://www.tutorialspoint. > >> com/python/python_command_line_arguments.htm The example works fine but > >> when I modify it to what I need, it only

Announcing SCM Workbench 0.8.6 for Git, Mercurial and Subversion

2017-04-17 Thread Barry Scott
SCM Workbench features • Support Subversion (svn), Mercurial (hg) and Git projects. • Easy to learn and use • Builtin User Guide describes the operation and features of the application. • Add project wizard can scan for all your existing projects. • All sub

Re: Python Command Line Arguments

2017-04-17 Thread breamoreboy
On Saturday, April 15, 2017 at 6:45:51 PM UTC+1, Grant Edwards wrote: > On 2017-04-14, Bernd Nawothnig wrote: > > > He should switch to argparse in any case because getopt is no longer > > supported and does only receive bugfixes. > > In my book, "receiving bug fixes" means it's still supported.

Re: write arrays to disk

2017-04-17 Thread Andre Müller
Hi, there are many possible solutions. You'll need a serialiser to convert the Python object into bytes. If you wan't to access the data from other applications, you can use json, xml or other well known formats. Json and XML is in the Python standard library. You can also use a database. As jso

Re: Hi! i need some help with a program in python on Raspberry pi3.

2017-04-17 Thread breamoreboy
On Friday, April 14, 2017 at 3:27:29 PM UTC+1, Kasper wrote: > every time i run the program i get this messeage: > > Traceback (most recent call last): > File "smartmirror.py", line 159, in get_weather > temprature2 = "%S%S" % (str(int(weather_obj['currently']['temperature'])), > degree_sign

Re: Regular Expressions, Speed, Python, and NFA

2017-04-17 Thread breamoreboy
On Friday, April 14, 2017 at 4:12:27 PM UTC+1, Malik Rumi wrote: > I am running some tests using the site regex101 to figure out the correct > regexs to use for a project. I was surprised at how slow it was, constantly > needing to increase the timeouts. I went Googling for a reason, and solution

Python's help() function is awesome

2017-04-17 Thread Steve D'Aprano
If you're not using the help() command in the interactive interpreter, you're missing out on a lot. I recently discovered that help() is even cleverer than I knew. I knew it picked up on objects' doc strings, but what happens if the object doesn't have a doc string? Let's find out! Here's a tiny

Bigotry and hate speech on the python mailing list

2017-04-17 Thread Rurpy via Python-list
A couple weeks ago a frequent poster here (Steve D'Aprano ) called another participant an "ugly american" [*1]. This was followed just a couple weeks later with another post from Mr. D'Aprano attacking a participant as "an old man" who can't understand new technology, a blatant example of agei

Re: Bigotry and hate speech on the python mailing list

2017-04-17 Thread Marko Rauhamaa
Rurpy : > If I posted a remark about "dirty Chinese" (c.f. "ugly American") I > would be (justifiably) slammed and likely ejected from the list. Or if > claims that not understanding new tech is a product of age are ok, > then why can't I say disparagingly that someone "programs like a > girl"? Wh

Re: Bigotry and hate speech on the python mailing list

2017-04-17 Thread Ben Finney
Rurpy via Python-list writes: > A couple weeks ago a frequent poster here (Steve D'Aprano > ) called another participant an "ugly > american" [*1]. He gave no explicit reference, and so I can see why you would think he did what you describe. In fact, though, Steven in the message you link to st

Re: Static typing [was Re: Python and the need for speed]

2017-04-17 Thread Steve D'Aprano
On Sun, 16 Apr 2017 02:27 pm, Steve D'Aprano wrote: > Are you aware that optional static typing CANNOT be used for optimization? I think I've over-stated that. Considerably. In other words, I was wrong. As Steve Yegge points out, dynamic languages like Smalltalk and Lisp were, back in the 1980s,

Re: Static typing [was Re: Python and the need for speed]

2017-04-17 Thread Steve D'Aprano
On Mon, 17 Apr 2017 04:18 pm, Paul Rubin wrote: > Steve D'Aprano writes: >> Since it is *optional*, it is only a hint, not a fact. You can tell the >> compiler that you believe that n will be an int, but it's not guaranteed. > > The runtime could check at the entry to the function that n is an i

Re: Bigotry and hate speech on the python mailing list

2017-04-17 Thread Rustom Mody
On Monday, April 17, 2017 at 4:09:34 PM UTC+5:30, Ben Finney wrote: > The charge of bigotry is a strong one here, rightly so, and I think you > for taking it seriously. Will you drop that charge now? If you won't, I > think you need to show how this analysis is incorrect. On the same day that (I s

Re: Bigotry and hate speech on the python mailing list

2017-04-17 Thread Rustom Mody
On Monday, April 17, 2017 at 3:09:44 PM UTC+5:30, Marko Rauhamaa wrote: > Rurpy : > > > If I posted a remark about "dirty Chinese" (c.f. "ugly American") I > > would be (justifiably) slammed and likely ejected from the list. Or if > > claims that not understanding new tech is a product of age are

Re: Python's help() function is awesome

2017-04-17 Thread Terry Reedy
On 4/17/2017 5:31 AM, Steve D'Aprano wrote: If you're not using the help() command in the interactive interpreter, you're missing out on a lot. I recently discovered that help() is even cleverer than I knew. I knew it picked up on objects' doc strings, but what happens if the object doesn't have

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread Terry Reedy
On 4/17/2017 3:11 AM, Marko Rauhamaa wrote: Gregory Ewing : bartc wrote: Most of my loops start off as endless loops, until I can determine the actual terminating condition, and where it best goes. Interesting. My experience is quite different. Most of the loops I write start off with me thi

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread Marko Rauhamaa
Terry Reedy : > On 4/17/2017 3:11 AM, Marko Rauhamaa wrote: >> Here's statistics from a medium-sized project of mine: >> >>while True:34 >>while : 39 >>for ... in ...: 158 > > As I posted previously, the ratio of for-loops in the stdlib is about 7 > to 1. What I

creating vector from df.intertuples

2017-04-17 Thread Richard Medina
I want to create a vector from a dataframe in a loop. Then I want to create a new column from this vector. for row in df.itertuples(): mm = str(row.t) #selecting "t" column nn = get_sec(mm) #this function converts time to seconds df["s"] = nn #I want to add my new ve

[ANN] kubetop 17.4.17.1

2017-04-17 Thread Jean-Paul Calderone
Hello all, I'm pleased to announce the initial release of kubetop, a command-line tool in the style of top(1) for displaying current usage and activity of a Kubernetes cluster. kubetop 17.4.17.1 will format information about your Kubernetes cluster like this: kubetop - 13:02:57 Node 0 CPU% 9.8

Re: creating vector from df.intertuples

2017-04-17 Thread Peter Otten
Richard Medina wrote: > I want to create a vector from a dataframe in a loop. Then I want to > create a new column from this vector. > > for row in df.itertuples(): > mm = str(row.t) #selecting "t" column > nn = get_sec(mm) #this function converts time to seconds > d

Buffers and pointers (Py3.4)

2017-04-17 Thread Rob Gaddi
So long as we're all feeling so concerned about speed lately... I've got a piece of hardware that allows me to call a C library that calls an ioctl() that kicks off a DMA transfer and moves data between process memory and external hardware. I would like a way to turn an arbitrary object imple

GPUs with various tools

2017-04-17 Thread Jeffrey Layton
Good afternoon, Since I just got a nice GTX 1050 card, I would like to exercise it with Python. In particular, I'm curious about tools such as SciPy, Pandas, Numpy, etc., that can take advantage of GPUs so I don't have to write any GPU code. For example, can I solve an A X = B linear problem o

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread Ben Bacarisse
Marko Rauhamaa writes: > Terry Reedy : > >> On 4/17/2017 3:11 AM, Marko Rauhamaa wrote: >>> Here's statistics from a medium-sized project of mine: >>> >>>while True:34 >>>while : 39 >>>for ... in ...: 158 >> >> As I posted previously, the ratio of for-loops in th

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread bartc
On 17/04/2017 19:02, Ben Bacarisse wrote: Marko Rauhamaa writes: Terry Reedy : On 4/17/2017 3:11 AM, Marko Rauhamaa wrote: Here's statistics from a medium-sized project of mine: while True:34 while : 39 for ... in ...: 158 As I posted previously, the ratio

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread Marko Rauhamaa
Ben Bacarisse : > Marko Rauhamaa writes: >> What I notice in my numbers is that about one half of my while loops >> are "while True", and about a third of my loops are while loops. > > I fo[u]nd the proportion on while True: loops surprising. Is there > something about Python that encourages that

Re: Buffers and pointers (Py3.4)

2017-04-17 Thread Chris Angelico
On Tue, Apr 18, 2017 at 3:58 AM, Rob Gaddi wrote: > If I were writing this as a C extension, getting that information from any > buffer object would be trivial, but that changes my project from a pure > Python wrapper using ctypes to a mixed language project with compile > dependencies and mental

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread Mikhail V
On 17 April 2017 at 04:00, Steve D'Aprano wrote: > On Mon, 17 Apr 2017 05:49 am, Dennis Lee Bieber wrote: > >> On Mon, 17 Apr 2017 02:48:08 +1000, Steve D'Aprano >> declaimed the following: >> >>>On Sun, 16 Apr 2017 11:57 pm, bartc wrote: >>> But people just don't want it. >>> >>>Damn straig

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread Grant Edwards
On 2017-04-17, Ben Bacarisse wrote: > Marko Rauhamaa writes: > >> Terry Reedy : >> >>> On 4/17/2017 3:11 AM, Marko Rauhamaa wrote: Here's statistics from a medium-sized project of mine: while True:34 while : 39 for ... in ...: 158 >>> >>> As

Re: Bigotry and hate speech on the python mailing list

2017-04-17 Thread Paul Rubin
Rurpy writes: > A couple weeks ago a frequent poster here (Steve D'Aprano > ) called another participant an "ugly > american" Oh stop trolling. Ugly American was a 1950s thing, now just amusing. And context matters. Steven, please try to be a little more attentive to people's delicate feefees i

Re: Static typing [was Re: Python and the need for speed]

2017-04-17 Thread Paul Rubin
Steve D'Aprano writes: > On the other hand, there's Cython. Cython claims *not* to be a JIT compiler, One of the uses of "JIT compiler" these days is what's sometimes called a tracing JIT, like PyPy or LuaJIT or the Javascript flavor-of-the-week. That means it interprets the program while collect

Re: GPUs with various tools

2017-04-17 Thread Paul Rubin
Jeffrey Layton writes: > I'm working with Continuum's Accelerate and I'm slowly learning PyCUDA > but I'm looking for something that's already coded. TensorFlow has good Python bindings. That's probably the best way to get started. -- https://mail.python.org/mailman/listinfo/python-list

Unable to use Python IDLE after downloading the application

2017-04-17 Thread ASHISH A
Hi Team, I have a 64 bit system with Windows 801 Pro OS. I tried to install Python 3.6.1 from the below link : https://www.python.org/downloads/ It automatically downloaded that 32 bit Python application and tried to launch IDLE (32 bit). I could not launch IDLE and it gave me an error saying DLL

Re: Unable to use Python IDLE after downloading the application

2017-04-17 Thread ASHISH A
PFA the snapshot of the error message.. Regards Ashish On Mon, Apr 17, 2017 at 11:06 PM, ASHISH A wrote: > Hi Team, > > I have a 64 bit system with Windows 801 Pro OS. I tried to install Python > 3.6.1 from the below link : > https://www.python.org/downloads/ > > It automatically downloaded th

Re: Unable to use Python IDLE after downloading the application

2017-04-17 Thread ASHISH A
Hi Team, I also tried installing the 64 bit Python and now i get the attached snapshot as error message, Regards Ashish On Mon, Apr 17, 2017 at 11:06 PM, ASHISH A wrote: > Hi Team, > > I have a 64 bit system with Windows 801 Pro OS. I tried to install Python > 3.6.1 from the below link : > h

Re: Buffers and pointers (Py3.4)

2017-04-17 Thread eryk sun
On Mon, Apr 17, 2017 at 5:58 PM, Rob Gaddi wrote: > buffertype = c_uint8 * size > return addressof(buffertype.from_buffer(buf, offset)) > > works but is inefficient and woefully inelegant. A lot of the cost there is in creating buffertype, but why do you need that? You can use c_char.from_buffer

Re: Unable to use Python IDLE after downloading the application

2017-04-17 Thread eryk sun
On Mon, Apr 17, 2017 at 9:06 PM, ASHISH A wrote: > > I could not launch IDLE and it gave me an error saying DLL file missing > (attached snapshot). python-list doesn't send attachments. Please do your best to paraphrase error messages that can't be pasted as plain text. > I have downloaded the D

Re: Bigotry and hate speech on the python mailing list

2017-04-17 Thread Ben Finney
Paul Rubin writes: > Rurpy writes: > > A couple weeks ago a frequent poster here (Steve D'Aprano > > ) called another participant an "ugly > > american" > > Oh stop trolling. Paul, that is uncalled for. The charge of bigotry is not to be lightly dismissed, and we do want to foster an environmen

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread Gregory Ewing
Marko Rauhamaa wrote: What I notice in my numbers is that about one half of my while loops are "while True", and about a third of my loops are while loops. Out of curiosity, what proportion of your 'while True' loops are infinite? (I.e. no break, return or raise in the loop.) -- Greg -- https:

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread Paul Rubin
Ben Bacarisse writes: > c = sys.stdin.read(1) > while c == ' ': > c = sys.stdin.read(1) c = itertools.dropwhile( lambda c: c==' ', iter(lambda: sys.stdin.read(1),None) ).next() -- https://mail.python.org/mailman/listinfo/python-list

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread Ben Bacarisse
Marko Rauhamaa writes: > Ben Bacarisse : > >> Marko Rauhamaa writes: >>> What I notice in my numbers is that about one half of my while loops >>> are "while True", and about a third of my loops are while loops. >> >> I fo[u]nd the proportion on while True: loops surprising. Is there >> something

Re: Bigotry and hate speech on the python mailing list

2017-04-17 Thread Ethan Furman
On 04/17/2017 03:23 PM, Ben Finney wrote: Paul Rubin writes: Rurpy writes: A couple weeks ago a frequent poster here (Steve D'Aprano) called another participant an "ugly american" Oh stop trolling. Paul, that is uncalled for. The charge of bigotry is not to be lightly dismissed, and we do

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread bartc
On 18/04/2017 01:23, Paul Rubin wrote: Ben Bacarisse writes: c = sys.stdin.read(1) while c == ' ': c = sys.stdin.read(1) c = itertools.dropwhile( lambda c: c==' ', iter(lambda: sys.stdin.read(1),None) ).next() I tried this but it doesn't like the .next. I wanted t

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread Ben Bacarisse
Paul Rubin writes: > Ben Bacarisse writes: >> c = sys.stdin.read(1) >> while c == ' ': >> c = sys.stdin.read(1) (for the record: I was not suggesting this was how you'd do it but how you'd be forced to do it in some languages) > c = itertools.dropwhile( > lambda c: c==' ', >

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread Paul Rubin
Ben Bacarisse writes: > ? I get "AttributeError: 'itertools.dropwhile' object has no attribute > 'next'" from your example. Hmm, .next() worked ok for me in Python 2.7.5. Not sure what happened. Maybe something went wrong with my paste. Oh well. > Coming from the lazy language Haskell, I find

Re: Buffers and pointers (Py3.4)

2017-04-17 Thread Rob Gaddi
On 04/17/2017 02:49 PM, eryk sun wrote: On Mon, Apr 17, 2017 at 5:58 PM, Rob Gaddi wrote: buffertype = c_uint8 * size return addressof(buffertype.from_buffer(buf, offset)) works but is inefficient and woefully inelegant. A lot of the cost there is in creating buffertype, but why do you need

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread MRAB
On 2017-04-18 02:09, Paul Rubin wrote: Ben Bacarisse writes: ? I get "AttributeError: 'itertools.dropwhile' object has no attribute 'next'" from your example. Hmm, .next() worked ok for me in Python 2.7.5. Not sure what happened. Maybe something went wrong with my paste. Oh well. Coming

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread eryk sun
On Tue, Apr 18, 2017 at 1:37 AM, MRAB wrote: > In Python 3 it's: > > c = next(itertools.dropwhile( > lambda c: c==' ', > iter(lambda: sys.stdin.read(1),None) > )) iter's sentinel should be an empty string. -- https://mail.python.org/mailman/listinfo/python-list

Re: Bigotry and hate speech on the python mailing list

2017-04-17 Thread Wildman via Python-list
On Tue, 18 Apr 2017 08:23:34 +1000, Ben Finney wrote: > Paul Rubin writes: > >> Rurpy writes: >> > A couple weeks ago a frequent poster here (Steve D'Aprano >> > ) called another participant an "ugly >> > american" >> >> Oh stop trolling. > > Paul, that is uncalled for. The charge of bigotry i

Re: Unable to use Python IDLE after downloading the application

2017-04-17 Thread Terry Reedy
On 4/17/2017 5:06 PM, ASHISH A wrote: Hi Team, I have a 64 bit system with Windows 801 Pro OS. I tried to install Python 3.6.1 from the below link : https://www.python.org/downloads/ It automatically downloaded that 32 bit Python application and tried to launch IDLE (32 bit). I could not launch

Re: Bigotry and hate speech on the python mailing list

2017-04-17 Thread Rurpy via Python-list
On 04/17/2017 04:38 AM, Ben Finney wrote: > Rurpy via Python-list writes: > >> A couple weeks ago a frequent poster here (Steve D'Aprano >> ) called another participant an "ugly >> american" [*1]. > > He gave no explicit reference, and so I can see why you would think he > did what you describe.

Re: Unable to use Python IDLE after downloading the application

2017-04-17 Thread Nathan Ernst
Off topic, but I find it a little annoying that the default Windows installer links to the 32-bit installer (and there's no adjacent 64-bit installer link) - you have to dive into various links to get the 64-bit installer. Seeing as 64-bit Windows is now the norm, it should be the default. (It is p

Re: Bigotry and hate speech on the python mailing list

2017-04-17 Thread Rurpy via Python-list
On 04/17/2017 08:19 PM, Wildman via Python-list wrote: > On Tue, 18 Apr 2017 08:23:34 +1000, Ben Finney wrote: >> Paul Rubin writes: >>> Rurpy writes: A couple weeks ago a frequent poster here (Steve D'Aprano ) called another participant an "ugly american" >>> >>> Oh stop trolling.

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread Marko Rauhamaa
Gregory Ewing : > Marko Rauhamaa wrote: >> What I notice in my numbers is that about one half of my while loops >> are "while True", and about a third of my loops are while loops. > > Out of curiosity, what proportion of your 'while True' loops are > infinite? (I.e. no break, return or raise in th

Re: Static typing [was Re: Python and the need for speed]

2017-04-17 Thread Steve D'Aprano
On Mon, 17 Apr 2017 08:52 pm, Steve D'Aprano wrote: > but research does continue into using gradual typing for optimizations: > > http://dl.acm.org/citation.cfm?id=2069175 Another interesting research project into speeding up Jython using type hints: http://scholar.colorado.edu/ecen_gradetds/57

Re: Bigotry and hate speech on the python mailing list

2017-04-17 Thread Rustom Mody
On Tuesday, April 18, 2017 at 6:18:06 AM UTC+5:30, Ethan Furman wrote: > On 04/17/2017 03:23 PM, Ben Finney wrote: > > Paul Rubin writes: > >> Rurpy writes: > > >>> A couple weeks ago a frequent poster here (Steve D'Aprano) > >>> called another participant an "ugly american" > >> > >> Oh stop trol

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread Marko Rauhamaa
Ben Bacarisse : > Python opts for > > while True: > c = sys.stdin.read(1) > if c != ' ': break I opt for that in C and bash as well. In fact, when I start writing a loop, I first type: while True: Once it is done, I might notice that the loop begins: while True:

Re: Bigotry and hate speech on the python mailing list

2017-04-17 Thread Marko Rauhamaa
Rustom Mody : > On Tuesday, April 18, 2017 at 6:18:06 AM UTC+5:30, Ethan Furman wrote: >> You mean all the non-religious people? >> >> Because some of your signatures don't feel welcoming to people of >> faith: > > Thanks Ethan for bullseyeing the problem to the leftie-libbie lie > called 'secula

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread breamoreboy
On Tuesday, April 18, 2017 at 2:09:19 AM UTC+1, Paul Rubin wrote: > Ben Bacarisse writes: > > ? I get "AttributeError: 'itertools.dropwhile' object has no attribute > > 'next'" from your example. > > Hmm, .next() worked ok for me in Python 2.7.5. Not sure what happened. > Maybe something went wr

Re: Bigotry and hate speech on the python mailing list

2017-04-17 Thread breamoreboy
On Monday, April 17, 2017 at 10:11:58 AM UTC+1, Rurpy wrote: > A couple weeks ago a frequent poster here (Steve D'Aprano) called another > participant an "ugly american" [*1]. This was followed just a couple weeks > later with another post from Mr. D'Aprano attacking a participant as "an old >

Re: Bigotry and hate speech on the python mailing list

2017-04-17 Thread Ben Finney
Ethan Furman writes: > You mean all the non-religious people? No, I don't mean that. > So you're okay with respectfully making people of faith feel > unwelcome? No, I'm not okay with that. As I said privately to you, the examples you cite do not demonstrate disrespect to *people*. They are di

Re: Static typing [was Re: Python and the need for speed]

2017-04-17 Thread Gregory Ewing
Steve D'Aprano wrote: I'm not sure why the Cython devs maintain this is not a JIT compiler. Perhaps I misunderstand something. A JIT compiler works by observing the actual values taken on by variables at run time, and if it notices that a particular variable seems to always have a particular ty

Re: Bigotry and hate speech on the python mailing list

2017-04-17 Thread Ben Finney
Wildman via Python-list writes: > "The seriousness of the charge mandates that we investigate > this. Even though there is no evidence, the seriousness of > the charge is what matters." > --Tom Foley (D) Speaker of the House That sounds right to me, provided one reads “there is no evidence” as

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread Christian Gollwitzer
Am 18.04.17 um 02:18 schrieb Ben Bacarisse: Thanks (and to Grant). IO seems to be the canonical example. Where some languages would force one to write c = sys.stdin.read(1) while c == ' ': c = sys.stdin.read(1) Python opts for while True: c = sys.stdin.read(1) if c !=

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread Chris Angelico
On Tue, Apr 18, 2017 at 4:06 PM, Christian Gollwitzer wrote: > Am 18.04.17 um 02:18 schrieb Ben Bacarisse: > >> Thanks (and to Grant). IO seems to be the canonical example. Where >> some languages would force one to write >> >> c = sys.stdin.read(1) >> while c == ' ': >> c = sys.stdin.

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread Marko Rauhamaa
Christian Gollwitzer : > Am 18.04.17 um 02:18 schrieb Ben Bacarisse: >> Python opts for >> >> while True: >> c = sys.stdin.read(1) >> if c != ' ': break > > This loop would be the archetypical do..while or repeat...until to me. > > do > c = sys.stdin.read(1) > while c== ' ' No,