Re: Lawrence D'Oliveiro

2016-09-30 Thread Paul Rubin
Chris Angelico writes: >> Why can't you block "PEDOFILO"? > I've no idea who you're talking about That's the weird Italian spam that the newsgroup has been getting for a while. I've been wondering for a while if anyone knows what the story is, i.e. why it's on comp.lang.python but not on other n

Re: Lawrence D'Oliveiro

2016-09-30 Thread Chris Angelico
On Sat, Oct 1, 2016 at 3:19 PM, Bob Martin wrote: > in 765690 20160930 181552 Ethan Furman wrote: >>Lawrence D'Oliveiro is banned from Python List until the new year. >> >>If his posts show up somewhere else (e.g. Usenet), please ignore them. If >>you must respo

Re: Lawrence D'Oliveiro

2016-09-30 Thread Bob Martin
in 765690 20160930 181552 Ethan Furman wrote: >Lawrence D'Oliveiro is banned from Python List until the new year. > >If his posts show up somewhere else (e.g. Usenet), please ignore them. If you >must respond to him p >lease trim out his text so the rest of us don

Re: how to append to list in list comprehension

2016-09-30 Thread Sayth Renshaw
On Saturday, 1 October 2016 14:17:06 UTC+10, Rustom Mody wrote: > On Saturday, October 1, 2016 at 9:08:09 AM UTC+5:30, Sayth Renshaw wrote: > > I do like [(f + ['0'] if len(f) < 5 else f) for f in fups ] Rustom, if > > there are better non list comprehension options I would like to know as > > g

Re: how to append to list in list comprehension

2016-09-30 Thread Sayth Renshaw
On Saturday, 1 October 2016 14:17:06 UTC+10, Rustom Mody wrote: > On Saturday, October 1, 2016 at 9:08:09 AM UTC+5:30, Sayth Renshaw wrote: > > I do like [(f + ['0'] if len(f) < 5 else f) for f in fups ] Rustom, if > > there are better non list comprehension options I would like to know as > > g

Re: unintuitive for-loop behavior

2016-09-30 Thread Rustom Mody
On Saturday, October 1, 2016 at 8:55:19 AM UTC+5:30, Random832 wrote: > On Fri, Sep 30, 2016, at 20:46, Gregory Ewing wrote: > > What *is* necessary and sufficient is to make each iteration > > of the for-loop create a new binding of the loop variable > > (and not any other variable!). > > I don't

Re: Lawrence D'Oliveiro

2016-09-30 Thread Rustom Mody
On Saturday, October 1, 2016 at 10:04:01 AM UTC+5:30, Rustom Mody wrote: > On Friday, September 30, 2016 at 10:45:03 PM UTC+5:30, Ethan Furman wrote: > > Lawrence D'Oliveiro is banned from Python List until the new year. > > > > If his posts show up somewhere else (e.g. Usenet), please ignore them

Re: Lawrence D'Oliveiro

2016-09-30 Thread Rustom Mody
On Friday, September 30, 2016 at 10:45:03 PM UTC+5:30, Ethan Furman wrote: > Lawrence D'Oliveiro is banned from Python List until the new year. > > If his posts show up somewhere else (e.g. Usenet), please ignore them. If > you must respond to him please trim out his text so the rest of us don't

Re: how to append to list in list comprehension

2016-09-30 Thread Rustom Mody
On Saturday, October 1, 2016 at 9:08:09 AM UTC+5:30, Sayth Renshaw wrote: > I do like [(f + ['0'] if len(f) < 5 else f) for f in fups ] Rustom, if there > are better non list comprehension options I would like to know as generally I > find then confusing. Two points here — best taken independent

Re: unintuitive for-loop behavior

2016-09-30 Thread Steve D'Aprano
On Sat, 1 Oct 2016 10:46 am, Gregory Ewing wrote: > Steve D'Aprano wrote: >> Giving for-loops their own namespace is a grossly unintuitive and a very >> weird thing to do. >> >> It would be terribly inconvenient and surprising for if...else blocks to >> be separate namespaces: > > There's an imp

Re: unintuitive for-loop behavior

2016-09-30 Thread Rustom Mody
For the most part you've taken the words out of my mouth! Some more details... On Saturday, October 1, 2016 at 6:16:32 AM UTC+5:30, Gregory Ewing wrote: > Steve D'Aprano wrote: > > Giving for-loops their own namespace is a grossly unintuitive and a very > > weird thing to do. > > > > It would be

Re: how to append to list in list comprehension

2016-09-30 Thread Sayth Renshaw
> > I want to go threw and for each index error at [4] append a 0. > > You want to append 0 if the list does not have at least 5 items? > > > p = re.compile('\d+') > > fups = p.findall(nomattr['firstup']) > > [x[4] for x in fups if IndexError fups.append(0)] > > print(fups) > > > Unsure why I c

Re: how to append to list in list comprehension

2016-09-30 Thread Rustom Mody
On Saturday, October 1, 2016 at 7:48:19 AM UTC+5:30, John Gordon wrote: > In Sayth Renshaw writes: > > > I want to go threw and for each index error at [4] append a 0. > > You want to append 0 if the list does not have at least 5 items? > > > p = re.compile('\d+') > > fups = p.findall(nomattr['

Re: unintuitive for-loop behavior

2016-09-30 Thread Random832
On Fri, Sep 30, 2016, at 20:46, Gregory Ewing wrote: > What *is* necessary and sufficient is to make each iteration > of the for-loop create a new binding of the loop variable > (and not any other variable!). I don't think that's true. I think this is logic that is excessively tied to the toy exam

Re: How to make a foreign function run as fast as possible in Windows?

2016-09-30 Thread Chris Angelico
On Sat, Oct 1, 2016 at 11:27 AM, wrote: > At this moment my interest is how to make it runs at 100% core usage. Windows > task manager shows this function takes only ~70% usage, and the number varies > during its execution, sometimes even drop to 50%. > What's it doing? Not every task can satu

Re: Could find libpython.so after succesfull compilation.

2016-09-30 Thread Steven Truppe
Damn i'm so stupid... the files where in fron on of my eyes and i was just not able to find then .. On 2016-10-01 02:23, Steven Truppe wrote: Hi all, i've compiled python3.5 and all went fine, i find ./python and it works, most of the make test stuff is working my only problem is that i'm

Re: how to append to list in list comprehension

2016-09-30 Thread John Gordon
In <534d5506-1810-4a79-ac8f-95a664d17...@googlegroups.com> Sayth Renshaw writes: > I want to go threw and for each index error at [4] append a 0. You want to append 0 if the list does not have at least 5 items? > p = re.compile('\d+') > fups = p.findall(nomattr['firstup']) > [x[4] for x in fup

Re: Could find libpython.so after succesfull compilation.

2016-09-30 Thread Steven Truppe
I fond this in the ./configuration help: * --enable-shared disable/enable building shared python library* so i tried: $configure --enabled-shard but i can't still find a library inside my build directory. On 2016-10-01 02:23, Steven Truppe wrote: Hi all, i've compiled python3.5

how to append to list in list comprehension

2016-09-30 Thread Sayth Renshaw
I have a list of lists of numbers like this excerpt. ['0', '0', '0', '0'] ['0', '0', '0', '0'] ['0', '0', '0', '0'] ['0', '0', '0', '0'] ['0', '0', '0', '0'] ['0', '0', '0', '0'] ['7', '2', '1', '0', '142647', '00'] ['7', '2', '0', '1', '87080', '00'] ['6', '1', '1', '1', '51700', '00'] ['4', '1',

Re: What is a mechanism equivalent to "trace variable w ..." in Tcl for Python?

2016-09-30 Thread Terry Reedy
On 9/30/2016 2:23 PM, Les Cargill wrote: A really interesting design approach in Tcl is to install a callback when a variable is written to. This affords highly event-driven programming. Example ( sorry; it's Tcl ) : namespace eval events { set preRPM -1 proc handleRPM { args } {

Re: How to make a foreign function run as fast as possible in Windows?

2016-09-30 Thread jfong
Paul Moore at 2016/9/30 7:07:35PM wrote: > OK. So if your Python code only calls the function once, the problem needs to > be fixed in the external code (the assembly routine). But if you can split up > the task at the Python level to make multiple calls to the function, each to > do a part of

Re: unintuitive for-loop behavior

2016-09-30 Thread Gregory Ewing
Steve D'Aprano wrote: What happens if it is *not* a misfeature? Gotchas are not always misfeatures -- sometimes gotchas are gotchas because people's expectations are simply wrong, and pandering to their confused expectations does not actually help them. I haven't made up my mind about *this* spe

Could find libpython.so after succesfull compilation.

2016-09-30 Thread Steven Truppe
Hi all, i've compiled python3.5 and all went fine, i find ./python and it works, most of the make test stuff is working my only problem is that i'm not able to find libpython.so am i missing somehting ? Thianks in advance -- https://mail.python.org/mailman/listinfo/python-list

Re: unintuitive for-loop behavior

2016-09-30 Thread Gregory Ewing
Steve D'Aprano wrote: Giving for-loops their own namespace is a grossly unintuitive and a very weird thing to do. It would be terribly inconvenient and surprising for if...else blocks to be separate namespaces: There's an important difference between a for-loop and an if-statement that's relev

rocket simulation game with just using tkinter

2016-09-30 Thread Irmen de Jong
Hi, I've made a very simple rocket simulation game, inspired by the recent success of SpaceX where they managed to land the Falcon-9 rocket back on a platform. I was curious if you can make a simple graphics animation game with just using Tkinter, instead of using other game libraries such as P

Re: Counting words in a string??

2016-09-30 Thread breamoreboy
On Friday, September 30, 2016 at 8:12:47 PM UTC+1, Jake wrote: > On Friday, 30 September 2016 19:49:57 UTC+1, srinivas devaki wrote: > > On Oct 1, 2016 12:10 AM, "Jake" wrote: > > > > > > Hi, I need a program which: > > > 1) Asks the user for a sentence of their choice (not including > > punctuati

Re: What is a mechanism equivalent to "trace variable w ..." in Tcl for Python?

2016-09-30 Thread breamoreboy
On Friday, September 30, 2016 at 7:16:10 PM UTC+1, Les Cargill wrote: > A really interesting design approach in Tcl is to install a callback > when a variable is written to. This affords highly event-driven > programming. > > Example ( sorry; it's Tcl ) : > > > namespace eval events { >

Re: Counting words in a string??

2016-09-30 Thread mm0fmf
On 30/09/2016 20:12, Jake wrote: On Friday, 30 September 2016 19:49:57 UTC+1, srinivas devaki wrote: On Oct 1, 2016 12:10 AM, "Jake" wrote: Hi, I need a program which: 1) Asks the user for a sentence of their choice (not including punctuation) 2) Ask the user which word they would like to

Re: What is a mechanism equivalent to "trace variable w ..." in Tcl for Python?

2016-09-30 Thread Random832
On Fri, Sep 30, 2016, at 14:42, Ned Batchelder wrote: > On Friday, September 30, 2016 at 2:16:10 PM UTC-4, Les Cargill wrote: > > What is an equivalent mechanism in Python? > > There's no way* to hook into "x = 2", but you could hook into "x.a = 2" > if you wanted do, by defining __setattr__ on x'

Re: Counting words in a string??

2016-09-30 Thread Chris Angelico
On Sat, Oct 1, 2016 at 5:12 AM, Jake wrote: > Could you make the program for me or provide an outline? No. In case you didn't read any of the other responses, this community is not a plagiarism source. If you want to learn to be a programmer, you're going to have to learn some key skills, one of

Re: Counting words in a string??

2016-09-30 Thread Peter Pearson
On Fri, 30 Sep 2016 11:37:19 -0700 (PDT), Jake wrote: > Hi, I need a program which: > 1) Asks the user for a sentence of their choice (not including punctuation) > 2) Ask the user which word they would like to know is repeated > 3) Print out to the user how many times the word came up which they c

Re: Counting words in a string??

2016-09-30 Thread Jake
On Friday, 30 September 2016 19:49:57 UTC+1, srinivas devaki wrote: > On Oct 1, 2016 12:10 AM, "Jake" wrote: > > > > Hi, I need a program which: > > 1) Asks the user for a sentence of their choice (not including > punctuation) > > 2) Ask the user which word they would like to know is repeated > >

Re: Counting words in a string??

2016-09-30 Thread Rob Gaddi
Jake wrote: > Hi, I need a program which: > 1) Asks the user for a sentence of their choice (not including punctuation) > 2) Ask the user which word they would like to know is repeated > 3) Print out to the user how many times the word came up which they chose > from their sentence. > > It would

Re: Counting words in a string??

2016-09-30 Thread srinivas devaki
On Oct 1, 2016 12:10 AM, "Jake" wrote: > > Hi, I need a program which: > 1) Asks the user for a sentence of their choice (not including punctuation) > 2) Ask the user which word they would like to know is repeated > 3) Print out to the user how many times the word came up which they chose from the

Re: What is a mechanism equivalent to "trace variable w ..." in Tcl for Python?

2016-09-30 Thread Ned Batchelder
On Friday, September 30, 2016 at 2:16:10 PM UTC-4, Les Cargill wrote: > A really interesting design approach in Tcl is to install a callback > when a variable is written to. This affords highly event-driven > programming. > > Example ( sorry; it's Tcl ) : > > (I can't read Tcl, sorry) > > W

Counting words in a string??

2016-09-30 Thread Jake
Hi, I need a program which: 1) Asks the user for a sentence of their choice (not including punctuation) 2) Ask the user which word they would like to know is repeated 3) Print out to the user how many times the word came up which they chose from their sentence. It would help if you could comment

Re: unintuitive for-loop behavior

2016-09-30 Thread Steve D'Aprano
On Fri, 30 Sep 2016 11:43 pm, BartC wrote: > It can make sense for 'x' to be local to this for-loop block (everything > else is at it works now), and independent of any x's in outer blocks. It > means being able to do stuff like this: > > for x in a: > for x in b: > pass >

Re: unintuitive for-loop behavior

2016-09-30 Thread Steve D'Aprano
On Fri, 30 Sep 2016 03:06 pm, Rustom Mody wrote: > On Friday, September 30, 2016 at 10:23:31 AM UTC+5:30, Gregory Ewing > wrote: >> namenobodywants wrote: >> > can anyone help to reconcile me to this semantics? >> >> Not really. Most people agree that it's not desirable >> behaviour, but we've e

What is a mechanism equivalent to "trace variable w ..." in Tcl for Python?

2016-09-30 Thread Les Cargill
A really interesting design approach in Tcl is to install a callback when a variable is written to. This affords highly event-driven programming. Example ( sorry; it's Tcl ) : namespace eval events { set preRPM -1 proc handleRPM { args } { # do stuff to handl

Re: Regarding Job Opportunity for the position Python Developer in Mc Lean, VA

2016-09-30 Thread gowri
On Friday, September 30, 2016 at 10:56:14 AM UTC-5, go...@spsolinc.com wrote: > Hi, > > Here we have an immediate opening. Location will be Mc Lean, VA. > Please revert back to us if you are interested. > Need good Python experience. SAS or AWS knowledge is added advantage. > > Thanks, > Gowri Sh

Re: Save Idle Options

2016-09-30 Thread Terry Reedy
On 9/29/2016 9:33 PM, tce...@comcast.net wrote: Win 10 pro 32, Python 3.6 I’m new to Python and installed Python with Idle, which I like as an IDE. But I’m mystified as to how to make interface options stick. Opened Options, Configure Idle. Changed font to Consolas Bold. And stopped dead. There

Lawrence D'Oliveiro

2016-09-30 Thread Ethan Furman
Lawrence D'Oliveiro is banned from Python List until the new year. If his posts show up somewhere else (e.g. Usenet), please ignore them. If you must respond to him please trim out his text so the rest of us don't have to deal with him. -- Python List Moderators -- https://mail.python.org/mai

Re: unintuitive for-loop behavior

2016-09-30 Thread Chris Angelico
On Sat, Oct 1, 2016 at 3:03 AM, Brendan Abel <007bren...@gmail.com> wrote: >> a = 1 > if condition: > print(a) # UnboundLocalError: local 'a' referenced before assignment > a += 1 > > > For-loops are no different. Making them their own namespace is a very > strange thing to do, it would me

Re: unintuitive for-loop behavior

2016-09-30 Thread Brendan Abel
> a = 1 if condition: print(a) # UnboundLocalError: local 'a' referenced before assignment a += 1 For-loops are no different. Making them their own namespace is a very strange thing to do, it would mean you couldn't re-bind a value inside a for-loop: count = 0 for x in sequence: cou

Re: unintuitive for-loop behavior

2016-09-30 Thread Grant Edwards
On 2016-09-30, Grant Edwards wrote: > On 2016-09-30, Steve D'Aprano wrote: > >> To me, "make for-loops be their own scope" sounds like a joke >> feature out of joke languages like INTERCAL. I'm not aware of any >> sensible language that does anything like this. > > In C99 a for loop has its own n

Re: unintuitive for-loop behavior

2016-09-30 Thread Chris Angelico
On Sat, Oct 1, 2016 at 12:36 AM, Grant Edwards wrote: > On 2016-09-30, Steve D'Aprano wrote: > >> To me, "make for-loops be their own scope" sounds like a joke feature out of >> joke languages like INTERCAL. I'm not aware of any sensible language that >> does anything like this. > > In C99 a for

Regarding Job Opportunity for the position Python Developer in Mc Lean, VA

2016-09-30 Thread gowri
Hi, Here we have an immediate opening. Location will be Mc Lean, VA. Please revert back to us if you are interested. Need good Python experience. SAS or AWS knowledge is added advantage. Thanks, Gowri Shekar 972-983-3467 -- https://mail.python.org/mailman/listinfo/python-list

Re: unintuitive for-loop behavior

2016-09-30 Thread BartC
On 30/09/2016 15:01, Chris Angelico wrote: On Fri, Sep 30, 2016 at 10:33 PM, Steve D'Aprano wrote: To me, "make for-loops be their own scope" sounds like a joke feature out of joke languages like INTERCAL. I'm not aware of any sensible language that does anything like this. No, wait a minute,

Re: unintuitive for-loop behavior

2016-09-30 Thread Grant Edwards
On 2016-09-30, Steve D'Aprano wrote: > To me, "make for-loops be their own scope" sounds like a joke feature out of > joke languages like INTERCAL. I'm not aware of any sensible language that > does anything like this. In C99 a for loop has its own namespac: int main(void) { for (int i=

Re: unintuitive for-loop behavior

2016-09-30 Thread Chris Angelico
On Fri, Sep 30, 2016 at 10:33 PM, Steve D'Aprano wrote: > To me, "make for-loops be their own scope" sounds like a joke feature out of > joke languages like INTERCAL. I'm not aware of any sensible language that > does anything like this. > > No, wait a minute, I tell a lie, I recall Chris Angelico

ANN: distlib 0.2.4 released on PyPI

2016-09-30 Thread Vinay Sajip via Python-list
I've just released version 0.2.4 of distlib on PyPI [1]. For newcomers, distlib is a library of packaging functionality which is intended to be usable as the basis for third-party packaging tools. The main changes in this release are as follows: * Updated to not fail during import if SSL is not a

Re: pyicloud: TypeError: 'dict_values' object does not support indexing

2016-09-30 Thread Peter Otten
Adam Funk wrote: > I'm trying to use pyicloud in idle3 (installed by pip3 on Ubuntu). > > > > The basic stuff works, but access to photos (following the > instructions) fails: > > photos = api.photos.all for photo in photos: > print(photo.

Save Idle Options

2016-09-30 Thread tcebob
Win 10 pro 32, Python 3.6 I’m new to Python and installed Python with Idle, which I like as an IDE. But I’m mystified as to how to make interface options stick. Opened Options, Configure Idle. Changed font to Consolas Bold. And stopped dead. There doesn’t seem to be a way to save the changes. Tr

Re: unintuitive for-loop behavior

2016-09-30 Thread BartC
On 30/09/2016 13:33, Steve D'Aprano wrote: On Fri, 30 Sep 2016 05:29 am, namenobodywa...@gmail.com wrote: i've had a nodding acquaintance with python for some time, and all along i assumed that for-loops got a namespace of their own; It would be terribly inconvenient and surprising for if..

pyicloud: TypeError: 'dict_values' object does not support indexing

2016-09-30 Thread Adam Funk
I'm trying to use pyicloud in idle3 (installed by pip3 on Ubuntu). The basic stuff works, but access to photos (following the instructions) fails: >>> photos = api.photos.all >>> for photo in photos: print(photo.filename) Traceback (most recent cal

Re: Using the Windows "embedded" distribution of Python

2016-09-30 Thread Paul Moore
On Friday, 30 September 2016 12:50:45 UTC+1, eryk sun wrote: > On Fri, Sep 30, 2016 at 11:02 AM, Paul Moore wrote: > > When I run ssh.exe, it fails with the message "The program cannot start > > because > > python3.dll is missing from your computer". I tried running it with > > sxstrace active

Re: unintuitive for-loop behavior

2016-09-30 Thread Steve D'Aprano
On Fri, 30 Sep 2016 05:29 am, namenobodywa...@gmail.com wrote: > hello pythonistas > > i've had a nodding acquaintance with python for some time, and all along i > assumed that for-loops got a namespace of their own; Giving for-loops their own namespace is a grossly unintuitive and a very weird

Re: Using the Windows "embedded" distribution of Python

2016-09-30 Thread eryk sun
On Fri, Sep 30, 2016 at 11:02 AM, Paul Moore wrote: > When I run ssh.exe, it fails with the message "The program cannot start > because > python3.dll is missing from your computer". I tried running it with sxstrace > active, > but the resulting log file is empty. A manifest embedded in "ssh.ex

Re: How to make a foreign function run as fast as possible in Windows?

2016-09-30 Thread Paul Moore
On Thursday, 29 September 2016 02:23:13 UTC+1, jf...@ms4.hinet.net wrote: > Paul Moore at 2016/9/28 11:31:50PM wrote: > > Taking a step back from the more detailed answers, would I be right to > > assume that you want to call this external function multiple times from > > Python, and each call

Re: Using the Windows "embedded" distribution of Python

2016-09-30 Thread Paul Moore
On Thursday, 29 September 2016 12:56:28 UTC+1, eryk sun wrote: > In that case you can use an application manifest with a dependent > assembly. Say embedded Python 3.6 is in the "py3embed" subdirectory. > Add the following manifest file to that directory: > > py3embed.manifest: > > > >

Re: Abusive Italian Spam

2016-09-30 Thread Cem Karan
Honestly, I'm impressed by how little spam ever makes it onto the list. Considering the absolute flood of email the lists get, it's impressive work. Thank you for all the hard work you guys do for all the rest of us! Thanks, Cem Karan On Sep 29, 2016, at 11:30 AM, Tim Golden wrote: > You ma

Re: filesystem encoding 'strict' on Windows

2016-09-30 Thread eryk sun
On Fri, Sep 30, 2016 at 5:58 AM, iMath wrote: > the doc of os.fsencode(filename) says Encode filename to the filesystem > encoding 'strict' > on Windows, what does 'strict' mean ? "strict" is the error handler for the encoding. It raises a UnicodeEncodeError for unmapped characters. For exampl