Re: New to Python and setting up

2015-10-18 Thread dieter
Glenn Schultz writes: > ... > Following the example of Ivan I have setup A folder structure. My > understand is that if each folder has an __init__.py From what it is > considered a module. Have I set this up correctly? An "__init__.py" in a folder used to indicate that this folder is a

Re: teacher need help!

2015-10-18 Thread Chris Angelico
On Mon, Oct 19, 2015 at 12:32 PM, Storey, Geneva wrote: > Same issue! See attached. > Thanks! I can't really read it in the image. Can you copy and paste the text into the body of the email, please? But I think you still have a file called turtle.py. Avoid that name and you should be fine. Chr

Re: Converting tuple of lists of variable length into dictionary

2015-10-18 Thread Erik
On 18/10/15 21:38, Denis McMahon wrote: I'm not sure I understand why after m = deepcopy(l); m.remove(i); m is a different value to that which it as after m = deepcopy(l).remove(i). It's because list.remove() returns None, not 'self'. E. -- https://mail.python.org/mailman/listinfo/python-list

Re: teacher need help!

2015-10-18 Thread Storey, Geneva
Same issue! See attached. Thanks! Geneva Storey Fulton High School Spanish, Mathematics Bulldog Academy From: Jason Friedman Sent: Sunday, October 18, 2015 7:50 PM To: Tim Golden Cc: Storey, Geneva; python-list@python.org Subject: Re: teach

Re: teacher need help!

2015-10-18 Thread Michael Torrie
On 10/17/2015 05:46 PM, Storey, Geneva wrote: > I am teaching a coding class to students grades 7-12. We have been > using Python, which seems to be a perfect fit. Everything was going > great until this week when I began teaching turtle. Suddenly, of the > 13 computers that I have, 3 began givi

Re: Where is the menu bar for 3.5?

2015-10-18 Thread Michael Torrie
On 10/17/2015 09:27 PM, Peachy Keen wrote: > I am learning to code and I downloaded Python 3.5 32bit. But I can't > find the menu bar and after much frustration I uninstalled the > program. I would like to get started again so if you could assist it > would be appreciated. Python itself is in inte

Re: teacher need help!

2015-10-18 Thread Chris Angelico
On Mon, Oct 19, 2015 at 11:50 AM, Jason Friedman wrote: >> Can I suggest you find the turtle.py module in c:\windows\system32, move it >> to somewhere more suitable and try the code again? > > Or, copy it, rather than move it? > It may be that for some students turtle.py is in a terrific place alr

Re: teacher need help!

2015-10-18 Thread Jason Friedman
> Can I suggest you find the turtle.py module in c:\windows\system32, move it > to somewhere more suitable and try the code again? Or, copy it, rather than move it? It may be that for some students turtle.py is in a terrific place already. -- https://mail.python.org/mailman/listinfo/python-list

Re: string class variable to sqlite3

2015-10-18 Thread Chris Angelico
On Mon, Oct 19, 2015 at 3:10 AM, andybrookestar--- via Python-list wrote: > I acknowledge the security points & also by the way I omitted using any Try > Catch statements , because at this stage coming from PHP I was more focused > on getting a select statement to actually work in python. > Th

Re: Converting tuple of lists of variable length into dictionary

2015-10-18 Thread Denis McMahon
On Sun, 18 Oct 2015 20:38:26 +, Denis McMahon wrote: > On Sun, 18 Oct 2015 03:17:18 -0700, Beppe wrote: > >> hi to everybody, I must turn a tuple of lists into a dictionary. > > I went down a different path to Peter, and discovered something > perplexing: I just realised staring at it again

Re: Converting tuple of lists of variable length into dictionary

2015-10-18 Thread Denis McMahon
On Sun, 18 Oct 2015 03:17:18 -0700, Beppe wrote: > hi to everybody, I must turn a tuple of lists into a dictionary. I went down a different path to Peter, and discovered something perplexing: This failed: d = { i: deepcopy(l).remove(i) for l in t for i in l } So I tried to expand it out to se

Re: Problem with copy.deepcopy and multiprocessing.Queue

2015-10-18 Thread James DeVincentis
The problem isn’t with multiprocess.Queue. The problem is that socketserver.ForkingMixIn calls os._exit() after the request is handled by the forked process. Which I did not know until I dug into the internals of socket server.ForkingMixIn. This causes the Finalize() hooks inside of multiproces

PyCon Namibia 2016 (was: PyCon Namibia 2015)

2015-10-18 Thread D.M. Procida
D.M. Procida wrote: > PyCon Namibia 2016 will be held in Windhoek, at the University of > Namibia, 24th-29th January. > > for more information. Subject: corrected, sorry. Daniele -- https://mail.python.org/mailman/listinfo/python-list

PyCon Namibia 2015

2015-10-18 Thread D.M. Procida
PyCon Namibia 2016 will be held in Windhoek, at the University of Namibia, 24th-29th January. for more information. Regards, Daniele -- https://mail.python.org/mailman/listinfo/python-list

Re: string class variable to sqlite3

2015-10-18 Thread andybrookestar--- via Python-list
I acknowledge the security points & also by the way I omitted using any Try Catch statements , because at this stage coming from PHP I was more focused on getting a select statement to actually work in python. Also I know the end use will be off line and is part of a python & kivy project to a

Re: Trying to build Python

2015-10-18 Thread Jeff Archer
On Sun, Oct 18, 2015 at 5:15 AM, Tim Golden wrote: > On 17/10/2015 17:25, Jeff Archer wrote: > >> I am trying to build Python on windows. I have gotten the source in >> compressed form, Python-3.5.0.tgz. Attempting to follow >> PCBuild\readme.txt >> >> Ran the get_externals.bat in the PCBuild f

Re: Problem with copy.deepcopy and multiprocessing.Queue

2015-10-18 Thread Ian Kelly
On Sun, Oct 18, 2015 at 2:46 AM, James DeVincentis wrote: > > I see, looks like I’ll have to use Queue.close() > > Didn’t think it would be necessary since I was assuming it would be garbage collected. Sigh. Bug, fixed. I'm not really following what the issue is here -- it sounds like it runs pre

Re: string class variable to sqlite3

2015-10-18 Thread Marko Rauhamaa
andybrookes...@googlemail.com: > cursor = self.conn.execute("SELECT * from wiki WHERE one LIKE '%s' "% >self.myString1) That's really dangerous. See: http://stackoverflow.com/questions/309945/how-to-quote-a-strin g-value-explicitly-python-db-api-psycopg2> Now,

Re: string class variable to sqlite3

2015-10-18 Thread andybrookestar--- via Python-list
cheers Mark, it was the syntax that was foxing me; I don't like the example of the select statement via the insecure approach because the writer is adding an element of ambiguity since the table has a field called and a variable also called #modifying my class to import sqlite3 class do:

Re: Converting tuple of lists of variable length into dictionary

2015-10-18 Thread Beppe
Il giorno domenica 18 ottobre 2015 14:47:34 UTC+2, Peter Otten ha scritto: > Beppe wrote: > > > Il giorno domenica 18 ottobre 2015 13:00:44 UTC+2, Peter Otten ha scritto: > >> Beppe wrote: > >> > >> > hi to everybody, I must turn a tuple of lists into a dictionary. > >> > > >> > something like >

Re: Converting tuple of lists of variable length into dictionary

2015-10-18 Thread Peter Otten
Beppe wrote: > Il giorno domenica 18 ottobre 2015 13:00:44 UTC+2, Peter Otten ha scritto: >> Beppe wrote: >> >> > hi to everybody, I must turn a tuple of lists into a dictionary. >> > >> > something like >> > >> > (['a', 'b', 'c', 'd', 'e', 'f'], ['g', 'h', 'i'], ['l', 'm', 'n', 'o']) >> > >>

Re: Converting tuple of lists of variable length into dictionary

2015-10-18 Thread Beppe
Il giorno domenica 18 ottobre 2015 14:35:53 UTC+2, Chris Angelico ha scritto: > On Sun, Oct 18, 2015 at 11:23 PM, Beppe wrote: > > hi Peter, you are right, no duplicates are admitted between lists, > > anyway your solution,works on python 3 but not on 2. > > however beautiful list comprehension so

Re: Converting tuple of lists of variable length into dictionary

2015-10-18 Thread Chris Angelico
On Sun, Oct 18, 2015 at 11:23 PM, Beppe wrote: > hi Peter, you are right, no duplicates are admitted between lists, > anyway your solution,works on python 3 but not on 2. > however beautiful list comprehension solution. > I will try to suit it for the python version i need Should work fine on 2.7

Re: Converting tuple of lists of variable length into dictionary

2015-10-18 Thread Beppe
Il giorno domenica 18 ottobre 2015 13:00:44 UTC+2, Peter Otten ha scritto: > Beppe wrote: > > > hi to everybody, I must turn a tuple of lists into a dictionary. > > > > something like > > > > (['a', 'b', 'c', 'd', 'e', 'f'], ['g', 'h', 'i'], ['l', 'm', 'n', 'o']) > > > > note that the length af

Re: Converting tuple of lists of variable length into dictionary

2015-10-18 Thread Peter Otten
Beppe wrote: > hi to everybody, I must turn a tuple of lists into a dictionary. > > something like > > (['a', 'b', 'c', 'd', 'e', 'f'], ['g', 'h', 'i'], ['l', 'm', 'n', 'o']) > > note that the length af each list is variable > > must return > > a ['b', 'c', 'd', 'e', 'f'] > b ['a', 'c', 'd',

Converting tuple of lists of variable length into dictionary

2015-10-18 Thread Beppe
hi to everybody, I must turn a tuple of lists into a dictionary. something like (['a', 'b', 'c', 'd', 'e', 'f'], ['g', 'h', 'i'], ['l', 'm', 'n', 'o']) note that the length af each list is variable must return a ['b', 'c', 'd', 'e', 'f'] b ['a', 'c', 'd', 'e', 'f'] c ['a', 'b', 'd', 'e', 'f']

Re: Trying to build Python

2015-10-18 Thread Tim Golden
On 17/10/2015 17:25, Jeff Archer wrote: I am trying to build Python on windows. I have gotten the source in compressed form, Python-3.5.0.tgz. Attempting to follow PCBuild\readme.txt Ran the get_externals.bat in the PCBuild folder. No apparent errors. Trying to build and getting errors: 1>

Re: Problem with copy.deepcopy and multiprocessing.Queue

2015-10-18 Thread James DeVincentis
I’ve managed to partially confirm this theory. I switched the HTTPServer to use the ThreadingMixIn instead of the ForkingMixIn. This causes the queue to behave correctly. The queue is created before any items are forked, then all of the processes are forked out that support the HTTPServer. It a

Re: Problem with copy.deepcopy and multiprocessing.Queue

2015-10-18 Thread James DeVincentis
I see, looks like I’ll have to use Queue.close() Didn’t think it would be necessary since I was assuming it would be garbage collected. Sigh. Bug, fixed. Thanks everyone! > On Oct 18, 2015, at 3:41 AM, James DeVincentis wrote: > > I get why it needs to be called, but this looks like a serious

Re: Problem with copy.deepcopy and multiprocessing.Queue

2015-10-18 Thread James DeVincentis
I get why it needs to be called, but this looks like a serious annoyance. Now I need help figuring this out. socketserver.ForkingMixIn needs to use os._exit() so that the process never makes it past handling the request. However, if there is a thread running inside that process that manages a m

Re: Problem with copy.deepcopy and multiprocessing.Queue

2015-10-18 Thread James DeVincentis
Seems I found the cause. os._exit() is used in ForkingMixIn for SocketServer and it’s child classes. Since os._exit() doesn’t flush buffers or clean anything up (hence not running the Finalize hooks that multiprocess.Queue use to make sure data gets flushed), this breaks multiprocess.Queue. ht

Re: Python 3.5.0 Feedback

2015-10-18 Thread Christian Gollwitzer
Am 17.10.15 um 15:23 schrieb Nils-Hero Lindemann: Hallo, Zuerst mal, ein dickes Danke an alle, die an Python mitarbeiten! This is an English speaking newsgroup. If you want discussion in German, post to de.comp.lang.python I'm not on Windows myself, so I can't comment on many of your points.