Re: Iterator, modify data in loop body

2014-09-13 Thread Chris Angelico
On Sat, Sep 13, 2014 at 5:01 PM, Michael Welle wrote: > ideed, this works for the minimal example. In a real application list > comprehension might be a bit unhandy, because there is a lot of code > involved. Sure. Sometimes, cutting something down for posting makes a completely different solutio

Re: Iterator, modify data in loop body

2014-09-13 Thread Peter Otten
Michael Welle wrote: > I want to create an iterator it=iter(list) and control a for-loop with > it. Is it save to append elements to the list in the body of the > for-loop or is the behaviour undefined then? PEP234 notes that once the > iterator has signaled exhaustion, subsequent calls of next()

Re: Thread-ID - how much could be?

2014-09-13 Thread Peter Otten
dieter wrote: > Ervin Hegedüs writes: >> ... > What is used as thread id is platform dependent. Likely, it depends > on the thread support of the underlying C libary (i.e. the > operating system thread support). > > Under Linux, thread ids seem to be addresses - i.e. very large > integers. $ gr

Re: Pyston 0.2 released

2014-09-13 Thread Heinz Schmitz
serge Guelton wrote: >> Hi all, we're excited to announce the existence of Pyston 0.2, a >> much-improved version of our new Python JIT. Every reason to get excited: http://www.pyston.com/ Regards, H. -- https://mail.python.org/mailman/listinfo/python-list

Re: Global indent

2014-09-13 Thread Albert van der Horst
In article , Anders Wegge Keller wrote: >On Sun, 24 Aug 2014 00:56:11 +1000 >Steven D'Aprano wrote: > >> Despite my comments, I don't actually have any objection to people who >> choose to use Emacs, or Vim, or edit their text files by poking the hard >> drive platter with a magnetised needle if

Re: Thread-ID - how much could be?

2014-09-13 Thread Martin Skjöldebrand
Unfortunately we will never know 😢 Sent from Blue Mail On 12 Sep 2014 07:43, at 07:43, Chris Angelico wrote: >On Fri, Sep 12, 2014 at 1:41 PM, Cameron Simpson wrote: >> On 12Sep2014 11:29, Steven D'Aprano > >> wrote: >>> >>> [...]maxint. I know that some Linux >>> systems can have an uptime o

Re: Thread-ID - how much could be?

2014-09-13 Thread Ervin Hegedüs
On Sat, Sep 13, 2014 at 12:09:28PM +0200, Martin Skjöldebrand wrote: > Unfortunately we will never know 😢 hehe :), joke of the day :) thanks, a. -- I � UTF-8 -- https://mail.python.org/mailman/listinfo/python-list

Re: Newer Debian versions of python on older Debian distros?

2014-09-13 Thread Antoine Pitrou
Hi, Chris Angelico gmail.com> writes: > > On Tue, Sep 9, 2014 at 5:04 AM, Travis Griggs gmail.com> wrote: > > Does anyone have experience with using newer versions of python debian packages (in particular, python3 > and python3-bson-ext from ‘testing’) on older stable versions (‘wheezy’ in thi

Re: very lightweight gui for win32 + python 3.4

2014-09-13 Thread Thomas Heller
Am 13.09.2014 03:19, schrieb Grant Edwards: On 2014-09-12, Thomas Heller wrote: Am 12.09.2014 18:38, schrieb Chris Angelico: Does Tkinter really work well with cx_Freeze? I doubt it (from my experiences with py2exe). I never had any problems with Tkinter and py2exe, but you do get a conside

Re: Iterator, modify data in loop body

2014-09-13 Thread Ian Kelly
On Sat, Sep 13, 2014 at 1:39 AM, Michael Welle wrote: >> In that case, don't iterate over the list at all. Do something like this: >> >> while lst: >> element = lst.pop(0) >> # work with element >> lst.append(new_element) >> >> There's no mutation-while-iterating here, and it's clear t

Re: Iterator, modify data in loop body

2014-09-13 Thread Chris Angelico
On Sun, Sep 14, 2014 at 1:27 AM, Ian Kelly wrote: > On Sat, Sep 13, 2014 at 1:39 AM, Michael Welle wrote: >>> In that case, don't iterate over the list at all. Do something like this: >>> >>> while lst: >>> element = lst.pop(0) >>> # work with element >>> lst.append(new_element) >>> >

Re: find the error

2014-09-13 Thread Denis McMahon
On Fri, 12 Sep 2014 22:47:57 -0700, daoudimca wrote: > Dear friends when i used import urllib, re, sys > > symbol = sys.argv[1] >>> this function is show -->> symbol = sys.argv[1] > IndexError: list index out of range > > kindly find the solution of this You are trying to reference more element

Re:find the error

2014-09-13 Thread Dave Angel
daoudi...@gmail.com Wrote in message: > Dear friends when i used > import urllib, re, sys > > symbol = sys.argv[1] >>> this function is show -->> symbol = sys.argv[1] > IndexError: list index out of range > > kindly find the solution of this > sys.argv is filled in from the command line argum

Shuffle

2014-09-13 Thread Seymore4Head
Here is a screenshot of me trying Dave Briccetti's quiz program from the shell and it (the shuffle command) works. https://www.youtube.com/watch?v=VR-yNEpGk3g http://i.imgur.com/vlpVa5i.jpg Two questions If you import random, do you need to "from random import shuffle"? Why does shuffle work from

Re: Shuffle

2014-09-13 Thread Chris Angelico
On Sun, Sep 14, 2014 at 9:47 AM, Seymore4Head wrote: > Two questions > If you import random, do you need to "from random import shuffle"? > > Why does shuffle work from the command line and not when I add it to > this program? > > import random > import shuffle To understand this, you need to und

Re: Shuffle

2014-09-13 Thread Michael Torrie
On 09/13/2014 05:47 PM, Seymore4Head wrote: > Here is a screenshot of me trying Dave Briccetti's quiz program from > the shell and it (the shuffle command) works. > https://www.youtube.com/watch?v=VR-yNEpGk3g > http://i.imgur.com/vlpVa5i.jpg > > Two questions > If you import random, do you need to

Re: Shuffle

2014-09-13 Thread Seymore4Head
On Sat, 13 Sep 2014 19:32:55 -0600, Michael Torrie wrote: >On 09/13/2014 05:47 PM, Seymore4Head wrote: >> Here is a screenshot of me trying Dave Briccetti's quiz program from >> the shell and it (the shuffle command) works. >> https://www.youtube.com/watch?v=VR-yNEpGk3g >> http://i.imgur.com/vlpV

Re: CSV methodology

2014-09-13 Thread kjs
je...@newsguy.com wrote: > > Hello. Back in the '80s, I wrote a fractal generator, which, over the years, > I've modified/etc to run under Windows. I've been an Assembly Language > programmer for decades. Recently, I decided to learn a new language, > and decided on Python, and I just love it

Why captured match is displayed as part of pexpect ".after" ?

2014-09-13 Thread Viet Nguyen
Hi, If any is familiar with pexpect, please help to point out why my script seems to fail to capture the desired text. Here, I want to log into a server 172.27.161.19. Once I see "Username: ", I will type in my userid "admin". The problem here is I have a list of keywords for pexpect to match

protocol.py, brine.py, and compat.py causing trouble

2014-09-13 Thread Josh English
I do not know what these three filesare doing, but suddenly they have caught in a loop every time I try to run some code. I grabbed the trace decorator from the python library and this is the last bit of the output: trollvictims.py(129): if self.current_attack: trollvictims.py(130):