From glen at glenjarvis.com Sat Oct 3 19:03:11 2015 From: glen at glenjarvis.com (Glen Jarvis) Date: Sat, 3 Oct 2015 12:03:11 -0500 Subject: [Baypiggies] Python in the Movies | Decoding an ISBN? Message-ID: I have been watching "Ex Machina" (http://www.imdb.com/title/tt0470752/). [It's worth watching, by the way). When I see a television program and/or movie that has "code," I always pause and look. It's amazing how often a thin veneer of "code" is put up on the screen as the actor hammer at the keyboard and the "code" just flows down the page. I admit, usually I do this exercise only for my family to groan because I usually piss and moan how badly it is done. For example, Criminal Minds once had an IP address similar to: 76.21.58.572. They even had the actors read it in the dialogue.. Arghhh "Ex Machina," at roughly index 1:09:37 has two "windows." One looks like C. And, the second, the foreground window Python. It's not PEP8 compliant, has bad spacing and doesn't win the efficiency award, but it's genuine code and syntactically (but not semantically) correct :) woot! Here is the code below. What grabbed my interest is the "puzzle" included: (An obfuscated way to write "ISBN = "): sys.stdout.write("".join(chr(i) for i in (73,83,66,78,32,61,32))) I expect the rest is an ISBN number. I'm curious what book was intended -- even if their "code" is broken. I believe their "sieve of Eratosthenes" is incorrect. Reference video: https://www.youtube.com/watch?v=V08g_lkKj6Q Can anyone work out which ISBN number they were trying to reference? 1206 isn't prime. And, if I just assume they completely meant to take code[i] - key[i] ignoring prime's completely, I get this `12053003823` -- which isn't an ISBN reference. Hmm... I'm still mildly curious... # BlueBook code decryption import sys def sieve(n): # Compute primes using sieve of Eratosthenes x = [1]*n x[1] = 0 for i in range(2,n/2): j = 2*i while j < n: x[j] = 0 j = j+1 return x def prime(n,x): # Find the nth prime i = 1 j = 1 while j <= n: if x[i] == 1: j = j+1 i = i+1 return i-1 x = sieve(1000) code = [1206,301,384,5] key= [1,1,2,2] sys.stdout.write("".join(chr(i) for i in (73,83,66,78,32,61,32))) for i in range(0,4): sys.stdout.write(str(prime(code[i],x)-key[i])) print -------------- next part -------------- An HTML attachment was scrubbed... URL: From glen at glenjarvis.com Sat Oct 3 19:26:44 2015 From: glen at glenjarvis.com (Glen Jarvis) Date: Sat, 3 Oct 2015 12:26:44 -0500 Subject: [Baypiggies] Python in the Movies | Decoding an ISBN? In-Reply-To: References: Message-ID: On Sat, Oct 3, 2015 at 12:14 PM, Guido van Rossum wrote: > Did you Google it? Others have solved it... > > Sadly I didn't. I should have. Let me do that now. G -------------- next part -------------- An HTML attachment was scrubbed... URL: From glen at glenjarvis.com Sat Oct 3 19:28:29 2015 From: glen at glenjarvis.com (Glen Jarvis) Date: Sat, 3 Oct 2015 12:28:29 -0500 Subject: [Baypiggies] Python in the Movies | Decoding an ISBN? In-Reply-To: References: Message-ID: https://www.reddit.com/r/movies/comments/365f9b/secret_code_in_ex_machina Thanks G On Sat, Oct 3, 2015 at 12:26 PM, Glen Jarvis wrote: > On Sat, Oct 3, 2015 at 12:14 PM, Guido van Rossum > wrote: > >> Did you Google it? Others have solved it... >> >> > Sadly I didn't. I should have. Let me do that now. > > G > -- Machines take me by surprise with great frequency. --Alan Turing +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>++++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.<<<<<<<<<<<<<<<<<< -------------- next part -------------- An HTML attachment was scrubbed... URL: From glen at glenjarvis.com Sat Oct 3 19:45:48 2015 From: glen at glenjarvis.com (Glen Jarvis) Date: Sat, 3 Oct 2015 12:45:48 -0500 Subject: [Baypiggies] Python in the Movies | Decoding an ISBN? In-Reply-To: References: Message-ID: And, for the record, the problem was in sieve. I had mis-read/mis-typed "j = j + 1" and it was intended to be "j = j + i": while j < n: x[j]=0 #j = j+1 My mistake j = j+i Better source of code: https://www.reddit.com/r/movies/comments/365f9b/secret_code_in_ex_machina Cheers, Glen On Sat, Oct 3, 2015 at 12:28 PM, Glen Jarvis wrote: > https://www.reddit.com/r/movies/comments/365f9b/secret_code_in_ex_machina > > Thanks > > > G > > On Sat, Oct 3, 2015 at 12:26 PM, Glen Jarvis wrote: > >> On Sat, Oct 3, 2015 at 12:14 PM, Guido van Rossum >> wrote: >> >>> Did you Google it? Others have solved it... >>> >>> >> Sadly I didn't. I should have. Let me do that now. >> >> G >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From itz at buug.org Sat Oct 3 20:58:07 2015 From: itz at buug.org (Ian Zimmerman) Date: Sat, 3 Oct 2015 11:58:07 -0700 Subject: [Baypiggies] Reading k=v format files Message-ID: <20151003185126.26749.01950064@ahiker.mooo.com> I have a file providing settings for both a shell script and a python program. It looks like this: Foo=bar Foo2=baz and so on. I'm looking for a short snippet (I hope for a one liner) to grok the file and return a dictionary of the settings. Trivial, you say? Yes, but this is not the first time I feel this need, and each time I find myself rewritting basically the same ditty: def grok_auth(authfile): result=dict() with open(authfile) as af: for line in af: k, v = line.strip().split('=', 1) result[k] = v return result There must be a better, batteries based way. Right? -- Please *no* private copies of mailing list or newsgroup messages. Rule 420: All persons more than eight miles high to leave the court. From gvanrossum at gmail.com Sat Oct 3 19:14:16 2015 From: gvanrossum at gmail.com (Guido van Rossum) Date: Sat, 3 Oct 2015 10:14:16 -0700 Subject: [Baypiggies] Python in the Movies | Decoding an ISBN? In-Reply-To: References: Message-ID: Did you Google it? Others have solved it... --Guido (on mobile) On Oct 3, 2015 10:04 AM, "Glen Jarvis" wrote: > I have been watching "Ex Machina" (http://www.imdb.com/title/tt0470752/). > [It's worth watching, by the way). > > When I see a television program and/or movie that has "code," I always > pause and look. It's amazing how often a thin veneer of "code" is put up on > the screen as the actor hammer at the keyboard and the "code" just flows > down the page. > > I admit, usually I do this exercise only for my family to groan because I > usually piss and moan how badly it is done. For example, Criminal Minds > once had an IP address similar to: 76.21.58.572. They even had the actors > read it in the dialogue.. Arghhh > > "Ex Machina," at roughly index 1:09:37 has two "windows." One looks like > C. And, the second, the foreground window Python. It's not PEP8 compliant, > has bad spacing and doesn't win the efficiency award, but it's genuine code > and syntactically (but not semantically) correct :) woot! > > Here is the code below. What grabbed my interest is the "puzzle" included: > (An obfuscated way to write "ISBN = "): > > sys.stdout.write("".join(chr(i) for i in (73,83,66,78,32,61,32))) > > I expect the rest is an ISBN number. I'm curious what book was intended -- > even if their "code" is broken. > > I believe their "sieve of Eratosthenes" is incorrect. Reference video: > https://www.youtube.com/watch?v=V08g_lkKj6Q > > > Can anyone work out which ISBN number they were trying to reference? 1206 > isn't prime. And, if I just assume they completely meant to take code[i] - > key[i] ignoring prime's completely, I get this `12053003823` -- which > isn't an ISBN reference. > > > Hmm... I'm still mildly curious... > > > # BlueBook code decryption > > > import sys > > > def sieve(n): > > # Compute primes using sieve of Eratosthenes > > x = [1]*n > > x[1] = 0 > > for i in range(2,n/2): > > j = 2*i > > while j < n: > > x[j] = 0 > > j = j+1 > > return x > > > def prime(n,x): > > # Find the nth prime > > > i = 1 > > j = 1 > > while j <= n: > > if x[i] == 1: > > j = j+1 > > i = i+1 > > return i-1 > > > > x = sieve(1000) > > > code = [1206,301,384,5] > > key= [1,1,2,2] > > > sys.stdout.write("".join(chr(i) for i in (73,83,66,78,32,61,32))) > > > for i in range(0,4): > > sys.stdout.write(str(prime(code[i],x)-key[i])) > > print > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleax at google.com Sat Oct 3 21:05:09 2015 From: aleax at google.com (Alex Martelli) Date: Sat, 3 Oct 2015 12:05:09 -0700 Subject: [Baypiggies] Reading k=v format files In-Reply-To: <20151003185126.26749.01950064@ahiker.mooo.com> References: <20151003185126.26749.01950064@ahiker.mooo.com> Message-ID: with open(authfile) as af: return dict(line.strip().split('=',1) for line in af) is a 2-liner equivalent. I don't know how to make it a one-liner (except by removing the newline after the ':', but that's not PEP8-y:-). Alex On Sat, Oct 3, 2015 at 11:58 AM, Ian Zimmerman wrote: > I have a file providing settings for both a shell script and a python > program. It looks like this: > > Foo=bar > Foo2=baz > > and so on. I'm looking for a short snippet (I hope for a one liner) to > grok the file and return a dictionary of the settings. Trivial, you > say? Yes, but this is not the first time I feel this need, and each > time I find myself rewritting basically the same ditty: > > def grok_auth(authfile): > result=dict() > with open(authfile) as af: > for line in af: > k, v = line.strip().split('=', 1) > result[k] = v > return result > > There must be a better, batteries based way. Right? > > -- > Please *no* private copies of mailing list or newsgroup messages. > Rule 420: All persons more than eight miles high to leave the court. > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.berthelot at gmail.com Sat Oct 3 21:09:28 2015 From: david.berthelot at gmail.com (David Berthelot) Date: Sat, 3 Oct 2015 12:09:28 -0700 Subject: [Baypiggies] Reading k=v format files In-Reply-To: References: <20151003185126.26749.01950064@ahiker.mooo.com> Message-ID: The module ConfigParser in the standard library could be of help since it seems to do exactly this: https://docs.python.org/2/library/configparser.html On Sat, Oct 3, 2015 at 12:05 PM, Alex Martelli via Baypiggies < baypiggies at python.org> wrote: > with open(authfile) as af: > return dict(line.strip().split('=',1) for line in af) > > is a 2-liner equivalent. I don't know how to make it a one-liner (except > by removing the newline after the ':', but that's not PEP8-y:-). > > Alex > > > On Sat, Oct 3, 2015 at 11:58 AM, Ian Zimmerman wrote: > >> I have a file providing settings for both a shell script and a python >> program. It looks like this: >> >> Foo=bar >> Foo2=baz >> >> and so on. I'm looking for a short snippet (I hope for a one liner) to >> grok the file and return a dictionary of the settings. Trivial, you >> say? Yes, but this is not the first time I feel this need, and each >> time I find myself rewritting basically the same ditty: >> >> def grok_auth(authfile): >> result=dict() >> with open(authfile) as af: >> for line in af: >> k, v = line.strip().split('=', 1) >> result[k] = v >> return result >> >> There must be a better, batteries based way. Right? >> >> -- >> Please *no* private copies of mailing list or newsgroup messages. >> Rule 420: All persons more than eight miles high to leave the court. >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> https://mail.python.org/mailman/listinfo/baypiggies >> > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From contact at jeffquast.com Sat Oct 3 21:06:09 2015 From: contact at jeffquast.com (Jeff Quast) Date: Sat, 3 Oct 2015 12:06:09 -0700 Subject: [Baypiggies] Reading k=v format files In-Reply-To: <20151003185126.26749.01950064@ahiker.mooo.com> References: <20151003185126.26749.01950064@ahiker.mooo.com> Message-ID: <5B484E4E-5011-45CC-B526-7A35923510C2@jeffquast.com> > On Oct 3, 2015, at 11:58 AM, Ian Zimmerman wrote: > > I have a file providing settings for both a shell script and a python > program. It looks like this: > > Foo=bar > Foo2=baz > > and so on. I'm looking for a short snippet (I hope for a one liner) to > grok the file and return a dictionary of the settings. Trivial, you > say? Yes, but this is not the first time I feel this need, and each > time I find myself rewritting basically the same ditty: Just happened to write this a few weeks ago also, # the output format is 'Key=Value\n[...]', parse to dictionary result = dict([line.split('=', 1) for line in stdout.decode('utf8').splitlines()]) From itz at buug.org Sat Oct 3 22:04:35 2015 From: itz at buug.org (Ian Zimmerman) Date: Sat, 3 Oct 2015 13:04:35 -0700 Subject: [Baypiggies] Reading k=v format files In-Reply-To: References: <20151003185126.26749.01950064@ahiker.mooo.com> Message-ID: <20151003200244.27246.081830D5@ahiker.mooo.com> On 2015-10-03 12:09 -0700, David Berthelot wrote: > The module ConfigParser in the standard library could be of help since it > seems to do exactly this: > https://docs.python.org/2/library/configparser.html Sadly, no. $ python Python 2.7.3 (default, Mar 13 2014, 11:03:55) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import ConfigParser as CP >>> p=CP.RawConfigParser() >>> p.read('auth') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/ConfigParser.py", line 305, in read self._read(fp, filename) File "/usr/lib/python2.7/ConfigParser.py", line 512, in _read raise MissingSectionHeaderError(fpname, lineno, line) ConfigParser.MissingSectionHeaderError: File contains no section headers. file: auth, line: 1 -- Please *no* private copies of mailing list or newsgroup messages. Rule 420: All persons more than eight miles high to leave the court. From msabramo at gmail.com Sat Oct 3 21:59:11 2015 From: msabramo at gmail.com (Marc Abramowitz) Date: Sat, 3 Oct 2015 12:59:11 -0700 Subject: [Baypiggies] Reading k=v format files In-Reply-To: <20151003185126.26749.01950064@ahiker.mooo.com> References: <20151003185126.26749.01950064@ahiker.mooo.com> Message-ID: <6893663C-49B9-4445-A38D-255733DD0EA7@gmail.com> You might look at https://pypi.python.org/pypi/jprops I use it to convert Java properties files from TeamCity into bash scripts. https://pypi.python.org/pypi/jprops2bash -Marc http://marc-abramowitz.com > On Oct 3, 2015, at 11:58 AM, Ian Zimmerman wrote: > > I have a file providing settings for both a shell script and a python > program. It looks like this: > > Foo=bar > Foo2=baz > > and so on. I'm looking for a short snippet (I hope for a one liner) to > grok the file and return a dictionary of the settings. Trivial, you > say? Yes, but this is not the first time I feel this need, and each > time I find myself rewritting basically the same ditty: > > def grok_auth(authfile): > result=dict() > with open(authfile) as af: > for line in af: > k, v = line.strip().split('=', 1) > result[k] = v > return result > > There must be a better, batteries based way. Right? > > -- > Please *no* private copies of mailing list or newsgroup messages. > Rule 420: All persons more than eight miles high to leave the court. > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies From malcolm at hoprocker.net Sun Oct 4 00:55:31 2015 From: malcolm at hoprocker.net (malcolm) Date: Sat, 3 Oct 2015 15:55:31 -0700 Subject: [Baypiggies] Reading k=v format files In-Reply-To: <20151003200244.27246.081830D5@ahiker.mooo.com> References: <20151003185126.26749.01950064@ahiker.mooo.com> <20151003200244.27246.081830D5@ahiker.mooo.com> Message-ID: Also, don't forget your friend execfile(, []) -- if the bash settings are already in a format that can be construed as Python values, then you're on your way. On Sat, Oct 3, 2015 at 1:04 PM, Ian Zimmerman wrote: > On 2015-10-03 12:09 -0700, David Berthelot wrote: > > > The module ConfigParser in the standard library could be of help since it > > seems to do exactly this: > > https://docs.python.org/2/library/configparser.html > > Sadly, no. > > $ python > Python 2.7.3 (default, Mar 13 2014, 11:03:55) > [GCC 4.7.2] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import ConfigParser as CP > >>> p=CP.RawConfigParser() > >>> p.read('auth') > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/python2.7/ConfigParser.py", line 305, in read > self._read(fp, filename) > File "/usr/lib/python2.7/ConfigParser.py", line 512, in _read > raise MissingSectionHeaderError(fpname, lineno, line) > ConfigParser.MissingSectionHeaderError: File contains no section > headers. > file: auth, line: 1 > > -- > Please *no* private copies of mailing list or newsgroup messages. > Rule 420: All persons more than eight miles high to leave the court. > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From itz at buug.org Sun Oct 4 06:47:37 2015 From: itz at buug.org (Ian Zimmerman) Date: Sat, 3 Oct 2015 21:47:37 -0700 Subject: [Baypiggies] Reading k=v format files In-Reply-To: References: <20151003185126.26749.01950064@ahiker.mooo.com> <20151003200244.27246.081830D5@ahiker.mooo.com> Message-ID: <20151004044653.28684.3B059932@ahiker.mooo.com> On 2015-10-03 15:55 -0700, malcolm wrote: > Also, don't forget your friend execfile(, > []) -- if the bash settings are already in a format > that can be construed as Python values, then you're on your way. That's what I will do next time. Thanks. -- Please *no* private copies of mailing list or newsgroup messages. Rule 420: All persons more than eight miles high to leave the court. From bryceverdier at gmail.com Mon Oct 5 20:16:26 2015 From: bryceverdier at gmail.com (Bryce Verdier) Date: Mon, 5 Oct 2015 11:16:26 -0700 Subject: [Baypiggies] Reading k=v format files In-Reply-To: <6893663C-49B9-4445-A38D-255733DD0EA7@gmail.com> References: <20151003185126.26749.01950064@ahiker.mooo.com> <6893663C-49B9-4445-A38D-255733DD0EA7@gmail.com> Message-ID: <20151005111626.28816563@work-lappy> Hopefully I'm not too late to chime in on this one, but the csv reader might also work in this case. You should be able to do something like below (not verified and modified from the docs here https://docs.python.org/3/library/csv.html): >>> import csv >>> with open('eggs.csv', newline='') as csvfile: ... spamreader = csv.reader(csvfile, delimiter='=') ... for row in spamreader: ... print(', '.join(row)) Hope that helps, Bryce On Sat, 3 Oct 2015 12:59:11 -0700 Marc Abramowitz wrote: > You might look at https://pypi.python.org/pypi/jprops > > I use it to convert Java properties files from TeamCity into bash > scripts. https://pypi.python.org/pypi/jprops2bash > > -Marc > http://marc-abramowitz.com > > > > On Oct 3, 2015, at 11:58 AM, Ian Zimmerman wrote: > > > > I have a file providing settings for both a shell script and a > > python program. It looks like this: > > > > Foo=bar > > Foo2=baz > > > > and so on. I'm looking for a short snippet (I hope for a one > > liner) to grok the file and return a dictionary of the settings. > > Trivial, you say? Yes, but this is not the first time I feel this > > need, and each time I find myself rewritting basically the same > > ditty: > > > > def grok_auth(authfile): > > result=dict() > > with open(authfile) as af: > > for line in af: > > k, v = line.strip().split('=', 1) > > result[k] = v > > return result > > > > There must be a better, batteries based way. Right? > > > > -- > > Please *no* private copies of mailing list or newsgroup messages. > > Rule 420: All persons more than eight miles high to leave the court. > > _______________________________________________ > > Baypiggies mailing list > > Baypiggies at python.org > > To change your subscription options or unsubscribe: > > https://mail.python.org/mailman/listinfo/baypiggies > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies From aahz at pythoncraft.com Tue Oct 6 18:18:32 2015 From: aahz at pythoncraft.com (Aahz) Date: Tue, 6 Oct 2015 09:18:32 -0700 Subject: [Baypiggies] Should I install brew under /usr/local or /opt/local, on Mac? In-Reply-To: References: Message-ID: <20151006161832.GA21999@panix.com> On Fri, Sep 25, 2015, Stephen wrote: > > Seeking quick opinions on a marginally Python-related question: > > I decided to move from macports to brew.Should I install brew > under /usr/local (default) or /opt/local (said to be better for > separation)?- I'm on MacOS 10.8.x- I want to have multiple installs of > Python 2.x, 3.x and various other libraries and tools (octave, Vowpal > Wabbit, word2vec, Spark etc.)- I don't want any grief from Mac system > libraries, version dependencies, etc.- I read StackOverflow et al. and > there is no clear consensus OSX 10.11 (aka El Capitan) changes the security model of OSX somewhat. /usr/ is now completely off-limits *except* for /usr/local/ -- and my personal preference is to avoid pushing the boundaries, so I would use /opt/local/ https://en.wikipedia.org/wiki/System_Integrity_Protection (The whole subject of SIP is more Python-related than your specific question IMO, at least for anyone who has intentions of distributing applications.) -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ I support the RKAB From jrodman at baypiggies.spamportal.net Thu Oct 8 15:32:39 2015 From: jrodman at baypiggies.spamportal.net (Joshua Rodman) Date: Thu, 8 Oct 2015 06:32:39 -0700 Subject: [Baypiggies] Reading k=v format files In-Reply-To: <20151003200244.27246.081830D5@ahiker.mooo.com> References: <20151003185126.26749.01950064@ahiker.mooo.com> <20151003200244.27246.081830D5@ahiker.mooo.com> Message-ID: <20151008133239.GA5750@joshbook.splunk.com> On Sat, Oct 03, 2015 at 01:04:35PM -0700, Ian Zimmerman wrote: > On 2015-10-03 12:09 -0700, David Berthelot wrote: > > > The module ConfigParser in the standard library could be of help since it > > seems to do exactly this: > > https://docs.python.org/2/library/configparser.html > > Sadly, no. > > $ python ... > ConfigParser.MissingSectionHeaderError: File contains no section > headers. Not really batteries-included, but it seems not altogether difficult to wrangle configparser to do this: http://stackoverflow.com/questions/2819696/parsing-properties-file-in-python/2819788#2819788 which makes me wonder why it doesn't already handle it. In my proprietary world, we put stuff outside a section in [default]. (Before anyone asks, last time I sent in a patch fixing a bug in python it was more painful than I wish to revisit.) -- If simplicity worked, the world would be overrun with insects From itz at buug.org Thu Oct 8 17:04:36 2015 From: itz at buug.org (Ian Zimmerman) Date: Thu, 8 Oct 2015 08:04:36 -0700 Subject: [Baypiggies] Reading k=v format files In-Reply-To: <20151008133239.GA5750@joshbook.splunk.com> References: <20151003185126.26749.01950064@ahiker.mooo.com> <20151003200244.27246.081830D5@ahiker.mooo.com> <20151008133239.GA5750@joshbook.splunk.com> Message-ID: <20151008145950.25210.0C3CE896@ahiker.mooo.com> On 2015-10-08 06:32 -0700, Joshua Rodman wrote: > http://stackoverflow.com/questions/2819696/parsing-properties-file-in-python/2819788#2819788 That would work, but is really more complicated than what I already do. Perhaps I could stick it in a local library ... but then I would have to create one :-) > In my proprietary world, we put stuff outside a section in [default]. Not possible for me because it has to be shell syntax (see OP). -- Please *no* private copies of mailing list or newsgroup messages. Rule 420: All persons more than eight miles high to leave the court. From jrodman at splunk.com Thu Oct 8 17:19:48 2015 From: jrodman at splunk.com (Joshua Rodman) Date: Thu, 8 Oct 2015 08:19:48 -0700 Subject: [Baypiggies] Reading k=v format files In-Reply-To: <20151008145950.25210.0C3CE896@ahiker.mooo.com> References: <20151003185126.26749.01950064@ahiker.mooo.com> <20151003200244.27246.081830D5@ahiker.mooo.com> <20151008133239.GA5750@joshbook.splunk.com> <20151008145950.25210.0C3CE896@ahiker.mooo.com> Message-ID: <20151008151948.GD5750@joshbook.splunk.com> On Thu, Oct 08, 2015 at 08:04:36AM -0700, Ian Zimmerman wrote: > On 2015-10-08 06:32 -0700, Joshua Rodman wrote: > > > http://stackoverflow.com/questions/2819696/parsing-properties-file-in-python/2819788#2819788 > > That would work, but is really more complicated than what I already do. > Perhaps I could stick it in a local library ... but then I would have to > create one :-) Agreed. > > In my proprietary world, we put stuff outside a section in [default]. > > Not possible for me because it has to be shell syntax (see OP). I meant our ini parser considers these files identical: file1: [default] pie=apple swingset=4seats file2: pie=apple swingset=4seats It seems an obvious dialect which would cover the the common case of "I don't care about these sections." It would also make them shell-compatible, modulo whitespace, quoting, booleans, etc. -- O O_/ O_/ Splunk. /|\/ /\ \/\ _ / / |\ / |\ | \ \ / / /o _/__|_ _/__|_ _/____ O__\/ /o o o o o o o \/ From motoom at xs4all.nl Fri Oct 9 10:09:39 2015 From: motoom at xs4all.nl (Michiel Overtoom) Date: Fri, 9 Oct 2015 10:09:39 +0200 Subject: [Baypiggies] Reading k=v format files In-Reply-To: <20151003185126.26749.01950064@ahiker.mooo.com> References: <20151003185126.26749.01950064@ahiker.mooo.com> Message-ID: <3E80D7D3-73BB-44A8-9330-DA1DF1154AC1@xs4all.nl> Hi, > On 03 Oct 2015, at 20:58, Ian Zimmerman wrote: > > I have a file providing settings [...] It looks like this: > > Foo=bar > Foo2=baz > > I'm looking for a short snippet to grok the file [...] Instead of writing your own parser, you could feed ConfigParser a doctored version of your INI file. ConfigParser doesn't have to be fed a filename, it can read a file-like object such as a StringIO 'in-memory file'. So I first create an in-memory version of the INI file with a [configuration] section prepended to it, then feed that to ConfigParser. import ConfigParser import StringIO ini = open("cfgparse.ini").read() print "Original INI file:" print ini sect = StringIO.StringIO("[configuration]\n" + ini) print "Sectioned INI file:" print sect.getvalue() c = ConfigParser.ConfigParser() c.readfp(sect) print "Foo is '%s'" % c.get("configuration", "Foo") print "Foo2 is '%s'" % c.get("configuration", "Foo2") The output is: Original INI file: Foo=bar Foo2=baz Sectioned INI file: [configuration] Foo=bar Foo2=baz Foo is 'bar' Foo2 is 'baz' Greetings, From rodrigc at FreeBSD.org Fri Oct 9 20:28:23 2015 From: rodrigc at FreeBSD.org (Craig Rodrigues) Date: Fri, 9 Oct 2015 11:28:23 -0700 Subject: [Baypiggies] Companies moving to Python 3? Message-ID: Hi, Are people seeing that any companies in the Bay Area are moving to Python 3 in a major way? Recently, I have been porting some code from Python 2 to Python 3. >From a language purist perspective, I see that Python 3 is technically a better language. Some of the new keywords in Python 3.5 like async/await look pretty cool for making it easier to do asyncio programming. However, from an end-user's perspective, the differences between Python 2 and Python 3 are annoying. Although certain features, like asyncio are interesting, for most major use cases, there doesn't seem to be any "killer feature" or performance boost to justify the effort of going to Python 3. While many major packages have been ported to Python 3, there are still quite a few major packages which are still stuck on Python 2. Despite these problems, I still like Python 3, and want to focus on writing new code which works with it. I was just curious if people are seeing the move to Python 3 in production. -- Craig -------------- next part -------------- An HTML attachment was scrubbed... URL: From shaleh at speakeasy.net Fri Oct 9 20:43:30 2015 From: shaleh at speakeasy.net (shaleh at speakeasy.net) Date: Fri, 09 Oct 2015 11:43:30 -0700 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: References: Message-ID: <20151009114330.eh4i49sogs8w84c0@mail.speakeasy.net> > On Fri, 9 Oct 2015 11:28:23 -0700, Craig Rodrigues > wrote: > Hi, > > Are people seeing that any companies in the Bay Area are movingto > Python 3 in a major way? What I am seeing is a standardization on 2.7 and 3.4 using the six package. The Py2 stragglers are being cleared up. From jrc.csus at gmail.com Fri Oct 9 21:12:33 2015 From: jrc.csus at gmail.com (Justin Carroll) Date: Fri, 9 Oct 2015 15:12:33 -0400 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: References: Message-ID: Hi Craig, If you haven't already watched (or attended), have a look at Guido's 2015 PyCon Keynot RE: making the switch to Python3 (it's the first 20 min or so). https://www.youtube.com/watch?v=G-uKNd5TSBw&feature=youtu.be I'd summarize his message as "all hands on deck - we've waited long enough for people to make the switch to python3 - it's time to make the jump". I work in the medical/embedded space, and everything moves at a snails pace where I am at. We are still on Python 2.6. But there are a few members of my group, myself included, that are seriously considering making strong efforts to make the move to Python 3. Python 2.6/2.7+ has served us well, and has kept food on my table, and there are many reasons NOT to make the change to Python3, but none of those reasons are good enough to prevent evolution of the language (and I don't want to be left behind!). I know Guido watches this list (yO Guido) and if we're lucky he'll provide additional insights beyond his keynote. On a side note, I have side projects that I have started in Python3 (as have my coworkers) so they can learn/familiarize themselves with the latest changes. -j --- Justin Carroll Software Engineer (Embedded Systems and Advanced Data Analytics/BigData) Full Stack Developer (Python | HTML5; Twisted | Dojo) (650) 776-6613 www.jrcresearch.net On Fri, Oct 9, 2015 at 2:28 PM, Craig Rodrigues wrote: > Hi, > > Are people seeing that any companies in the Bay Area are moving > to Python 3 in a major way? > > Recently, I have been porting some code from Python 2 to Python 3. > From a language purist perspective, I see that Python 3 is technically a > better > language. Some of the new keywords in Python 3.5 like async/await look > pretty > cool for making it easier to do asyncio programming. > > However, from an end-user's perspective, the differences between Python 2 > and Python 3 are annoying. Although certain features, like asyncio are > interesting, for most major use cases, there doesn't seem to be any > "killer feature" > or performance boost to justify the effort of going to Python 3. > While many major packages have been ported to Python 3, there are still > quite a few major packages which are still stuck on Python 2. > > Despite these problems, I still like Python 3, and want to focus on > writing new > code which works with it. I was just curious if people are seeing the > move to Python 3 in production. > > -- > Craig > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rodrigc at FreeBSD.org Fri Oct 9 22:01:33 2015 From: rodrigc at FreeBSD.org (Craig Rodrigues) Date: Fri, 9 Oct 2015 13:01:33 -0700 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: References: Message-ID: On Fri, Oct 9, 2015 at 12:12 PM, Justin Carroll wrote: > > I work in the medical/embedded space, and everything moves at a snails > pace where I am at. We are still on Python 2.6. But there are a few > members of my group, myself included, that are seriously considering making > strong efforts to make the move to Python 3. > Justin, Thanks for the response and feedback. It is useful to get the perspectives from real users such as yourself. Your e-mail jives with my experience, in that Python 3 is technically a better language, but for existing projects, it is sometimes hard to justify the effort to upgrade. In one of my projects, I made heavy use of Fabric ( http://fabfile.org ) for remote execution via SSH. Fabric is stuck on Python 2.5-2.7 and the author of Fabric is not accepting patches to add Python 3 support, because he is working on a rewrite. I took an initial whack at porting Fabric to python 3, by using 2to3 and reading various blogs. As I fixed problems one by one, I read up on the various PEP's to see what things changed in Python. It was a very interesting learning exercise: https://github.com/rodrigc/fabric/commits/python3 In the middle of my learning exercise, I found that Mathias Ertl actually has a more functional working port of Fabric to Python 3: https://github.com/fabric/fabric/issues/1378 so I abandoned my effort and am now using his port. So based on my learning exercise, I just wanted to get a feel for the rate of adoption of Python 3 in companies in the Bay Area. :) -- Craig -------------- next part -------------- An HTML attachment was scrubbed... URL: From tungwaiyip at yahoo.com Fri Oct 9 22:39:52 2015 From: tungwaiyip at yahoo.com (Wai Yip Tung (Yahoo)) Date: Fri, 09 Oct 2015 13:39:52 -0700 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: References: Message-ID: <56182618.2070305@yahoo.com> I'm going to say the unpopular thing. Python 3 to Python is Perl 6 to Perl. Upgrading to Python 3 is not inevitable. The probability for a company to move its development from Python 2 to Python 3 is a lot lower than moving to a different language altogether. When you are building your next product, there are lots of worthy alternative to choose from, Scala, Node, Ruby, Go, etc. Not one time have I heard anyone proposed Python 3. The decision to fork Python is an unfortunate one. Most of the new features have nothing specific to Python 3 and could have just as well port to Python 2. Had there forking decision be not made, we will be using all these shinny new features rather than stuck with the same five years old version. I am hoping people would wake up from this bewildering dream and keep Python 2 relevant. Wai Yip > Craig Rodrigues > Friday, October 09, 2015 1:01 PM > On Fri, Oct 9, 2015 at 12:12 PM, Justin Carroll > wrote: > > > I work in the medical/embedded space, and everything moves at a > snails pace where I am at. We are still on Python 2.6. But there > are a few members of my group, myself included, that are seriously > considering making strong efforts to make the move to Python 3. > > > > Justin, > > Thanks for the response and feedback. It is useful to > get the perspectives from real users such as yourself. > Your e-mail jives with my experience, in that Python 3 is technically > a better language, but for existing projects, it is sometimes hard > to justify the effort to upgrade. > > In one of my projects, I made heavy use of Fabric ( http://fabfile.org ) > for remote execution via SSH. Fabric is stuck on Python 2.5-2.7 > and the author of Fabric is not accepting patches to add Python 3 support, > because he is working on a rewrite. > > I took an initial whack at porting Fabric to python 3, by using > 2to3 and reading various blogs. As I fixed problems one by one, > I read up on the various PEP's to see what things changed in Python. > It was a very interesting learning exercise: > > https://github.com/rodrigc/fabric/commits/python3 > > In the middle of my learning exercise, I found that Mathias Ertl actually > has a more functional working port of Fabric to Python 3: > > https://github.com/fabric/fabric/issues/1378 > > so I abandoned my effort and am now using his port. > > So based on my learning exercise, I just wanted to get a feel > for the rate of adoption of Python 3 in companies in the Bay Area. :) > -- > Craig > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: postbox-contact.jpg Type: image/jpeg Size: 1143 bytes Desc: not available URL: From shaleh at speakeasy.net Fri Oct 9 22:52:24 2015 From: shaleh at speakeasy.net (shaleh at speakeasy.net) Date: Fri, 09 Oct 2015 13:52:24 -0700 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: <56182618.2070305@yahoo.com> References: <56182618.2070305@yahoo.com> Message-ID: <20151009135224.lykfgopbtc84c0g0@mail.speakeasy.net> Which is why I said I see most people targeting 2.7 and 3.4. Best of both worlds. Once you learn the issues there is very little work in keeping both working. Tools like tox go a long way too. Python people aren't leaving because of it. ? Perl 6 was an attempt to bring Perl from the ancients to the modern and the community decided they liked the ancient. Python3 is still Python. On Fri, 09 Oct 2015 13:39:52 -0700, "Wai Yip Tung (Yahoo) via Baypiggies" wrote: I'm going to say the unpopular thing. Python 3 to Python is Perl 6 to Perl. Upgrading to Python 3 is not inevitable. The probability for a company to move its development from Python 2 to Python 3 is a lot lower than moving to a different language altogether. When you are building your next product, there are lots of worthy alternative to choose from, Scala, Node, Ruby, Go, etc. Not one time have I heard anyone proposed Python 3. The decision to fork Python is an unfortunate one. Most of the new features have nothing specific to Python 3 and could have just as well port to Python 2. Had there forking decision be not made, we will be using all these shinny new features rather than stuck with the same five years old version. I am hoping people would wake up from this bewildering dream and keep Python 2 relevant. Wai Yip Craig Rodrigues Friday, October 09, 2015 1:01 PM On Fri, Oct 9, 2015 at 12:12 PM, Justin Carroll wrote: I work in the medical/embedded space, and everything moves at a snails pace where I am at.? We are still on Python 2.6.? But there are a few members of my group, myself included, that are seriously considering making strong efforts to make the move to Python 3. Justin, Thanks for the response and feedback.? It is useful toget the perspectives from real users such as yourself. Your e-mail jives with my experience, in that Python 3 is technically a better language, but for existing projects, it is sometimes hard to justify the effort to upgrade. ? In one of my projects, I made heavy use of Fabric ( http://fabfile.org ) for remote execution via SSH.? Fabric is stuck on Python 2.5-2.7 and the author of Fabric is not accepting patches to add Python 3 support, because he is working on a rewrite. I took an initial whack at porting Fabric to python 3, by using 2to3 and reading various blogs.? As I? fixed problems one by one, I read up on the various PEP's to see what things changed in Python. It was a very interesting learning exercise: https://github.com/rodrigc/fabric/commits/python3 In the middle of my learning exercise, I found that Mathias Ertl actually has a more functional working port of Fabric to Python 3: https://github.com/fabric/fabric/issues/1378 so I abandoned my effort and am now using his port. So based on my learning exercise, I just wanted to get a feel for the rate of adoption of Python 3 in companies in the Bay Area. :) -- Craig _______________________________________________ Baypiggies mailing list Baypiggies at python.org To change your subscription options or unsubscribe: https://mail.python.org/mailman/listinfo/baypiggies ------------------------- _______________________________________________ Baypiggies mailing list Baypiggies at python.org To change your subscription options or unsubscribe: https://mail.python.org/mailman/listinfo/baypiggies -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: postbox-contact.jpg Type: image/jpeg Size: 1143 bytes Desc: not available URL: From fahhem at google.com Fri Oct 9 23:00:46 2015 From: fahhem at google.com (Fahrzin Hemmati) Date: Fri, 9 Oct 2015 14:00:46 -0700 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: <56182618.2070305@yahoo.com> References: <56182618.2070305@yahoo.com> Message-ID: We've seen something similar with 3.1 -> 3.5, as some breaking changes were undone, like % formatting. Eventually, it should be possible to just run 2to3 on a reasonably written codebase and get code that works on 3.5+ automatically. We also need a 2to3 for c extensions (maybe based on Clang, like a clang-format) to deal with the C API changes. But, until it's that easy and you can up-convert all your dependencies, I agree that no company with real work to do will switch. I've seen plenty of startups start with 3, but that required a ton of work around dependency choosing and eventually they regretted the decision and some even switched back. A few had little enough to do in python that they stuck with it. On Oct 9, 2015 1:43 PM, "Wai Yip Tung (Yahoo) via Baypiggies" < baypiggies at python.org> wrote: > I'm going to say the unpopular thing. Python 3 to Python is Perl 6 to > Perl. Upgrading to Python 3 is not inevitable. The probability for a > company to move its development from Python 2 to Python 3 is a lot lower > than moving to a different language altogether. When you are building your > next product, there are lots of worthy alternative to choose from, Scala, > Node, Ruby, Go, etc. Not one time have I heard anyone proposed Python 3. > > The decision to fork Python is an unfortunate one. Most of the new > features have nothing specific to Python 3 and could have just as well port > to Python 2. Had there forking decision be not made, we will be using all > these shinny new features rather than stuck with the same five years old > version. I am hoping people would wake up from this bewildering dream and > keep Python 2 relevant. > > Wai Yip > > > Craig Rodrigues > Friday, October 09, 2015 1:01 PM > On Fri, Oct 9, 2015 at 12:12 PM, Justin Carroll > wrote: > >> >> I work in the medical/embedded space, and everything moves at a snails >> pace where I am at. We are still on Python 2.6. But there are a few >> members of my group, myself included, that are seriously considering making >> strong efforts to make the move to Python 3. >> > > > Justin, > > Thanks for the response and feedback. It is useful to > get the perspectives from real users such as yourself. > Your e-mail jives with my experience, in that Python 3 is technically > a better language, but for existing projects, it is sometimes hard > to justify the effort to upgrade. > > In one of my projects, I made heavy use of Fabric ( http://fabfile.org ) > for remote execution via SSH. Fabric is stuck on Python 2.5-2.7 > and the author of Fabric is not accepting patches to add Python 3 support, > because he is working on a rewrite. > > I took an initial whack at porting Fabric to python 3, by using > 2to3 and reading various blogs. As I fixed problems one by one, > I read up on the various PEP's to see what things changed in Python. > It was a very interesting learning exercise: > > https://github.com/rodrigc/fabric/commits/python3 > > In the middle of my learning exercise, I found that Mathias Ertl actually > has a more functional working port of Fabric to Python 3: > > https://github.com/fabric/fabric/issues/1378 > > so I abandoned my effort and am now using his port. > > So based on my learning exercise, I just wanted to get a feel > for the rate of adoption of Python 3 in companies in the Bay Area. :) > -- > Craig > > _______________________________________________ > Baypiggies mailing listBaypiggies at python.org > To change your subscription options or unsubscribe:https://mail.python.org/mailman/listinfo/baypiggies > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: postbox-contact.jpg Type: image/jpeg Size: 1143 bytes Desc: not available URL: From wescpy at gmail.com Sat Oct 10 08:26:36 2015 From: wescpy at gmail.com (wesley chun) Date: Fri, 9 Oct 2015 23:26:36 -0700 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: References: <56182618.2070305@yahoo.com> Message-ID: Larger organizations take more time to move. The backwards-incompatibility is unfortunate but necessary. As more and more large, well-known packages, i.e., Django, migrate to 3.x, so will users. However, as Wai Yip mentioned, if you're not motivated to move (everything "works as intended"), then you won't. Remember SCons ? That was invented using 1.5 and stayed that way until recently. They were backporting 2.x patches to their 1.x system for the longest time. With regards to the OP, at Google, we're still using 2.x, however there are efforts internally that are moving forward with 3.x and preparing the shift. I even wrote recently that even the Google APIs Client Library is now available for Python 3 users. Cheers, -- Wesley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "A computer never does what you want... only what you tell it." +wesley chun : wescpy at gmail : @wescpy Python training & consulting : http://CyberwebConsulting.com "Core Python" books : http://CorePython.com Python blog: http://wescpy.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.berthelot at gmail.com Sat Oct 10 15:34:59 2015 From: david.berthelot at gmail.com (David Berthelot) Date: Sat, 10 Oct 2015 06:34:59 -0700 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: References: <56182618.2070305@yahoo.com> Message-ID: In terms of killer feature, having a JIT in Python 3 and NOT back-porting it to 2.x could be the must have feature to drive user migration. In machine learning, tools are divided between LUA and Python, and people use LUA just because it has a JIT and is fast (and easy to embed from what they claim). So may be if Python 3 had that, it would allow to reclaim the lost ground, it's definitely a feature I'd love to have. I hope I didn't hijack the thread or anything but CPU performance (and the GIL) is a complaint I hear frequently in my work environment. On Fri, Oct 9, 2015 at 11:26 PM, wesley chun wrote: > Larger organizations take more time to move. The backwards-incompatibility > is unfortunate but necessary. As more and more large, well-known packages, > i.e., Django, migrate to 3.x, so will users. However, as Wai Yip mentioned, > if you're not motivated to move (everything "works as intended"), then you > won't. > > Remember SCons ? That was invented using 1.5 and stayed > that way until recently. They were backporting 2.x patches to their 1.x > system for the longest time. > > With regards to the OP, at Google, we're still using 2.x, however there > are efforts internally that are moving forward with 3.x and preparing the > shift. I even wrote recently > > that even the Google APIs Client Library is now available for Python 3 > users. > > Cheers, > -- Wesley > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > "A computer never does what you want... only what you tell it." > +wesley chun : wescpy at gmail : > @wescpy > Python training & consulting : http://CyberwebConsulting.com > "Core Python" books : http://CorePython.com > Python blog: http://wescpy.blogspot.com > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From send2md at gmail.com Sat Oct 10 18:48:59 2015 From: send2md at gmail.com (Marilyn Davis) Date: Sat, 10 Oct 2015 09:48:59 -0700 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: References: <56182618.2070305@yahoo.com> Message-ID: In my classes, I am not seeing much movement toward 3. Companies still seem to be on 2. There are a few engineers who want 3 for their own curiosity, I think, from the responses I get when I ask why. >From my point of view, 2 is a teaching language, a joy to teach. Python 3, not as much. I don't how I'm going to teach classes (blueprints for objects) when I have to skip classic classes. I thought the killer app is Unicode. I wonder if this list wasn't in English, in an English-speaking (mostly) country, if we'd be seeing more Python 3 in action? Unicode is real important outside of our culture, isn't it? Marilyn Davis On Sat, Oct 10, 2015 at 6:34 AM, David Berthelot wrote: > In terms of killer feature, having a JIT in Python 3 and NOT back-porting > it to 2.x could be the must have feature to drive user migration. > > In machine learning, tools are divided between LUA and Python, and people > use LUA just because it has a JIT and is fast (and easy to embed from what > they claim). So may be if Python 3 had that, it would allow to reclaim the > lost ground, it's definitely a feature I'd love to have. > > I hope I didn't hijack the thread or anything but CPU performance (and the > GIL) is a complaint I hear frequently in my work environment. > > On Fri, Oct 9, 2015 at 11:26 PM, wesley chun wrote: > >> Larger organizations take more time to move. The >> backwards-incompatibility is unfortunate but necessary. As more and more >> large, well-known packages, i.e., Django, migrate to 3.x, so will users. >> However, as Wai Yip mentioned, if you're not motivated to move (everything >> "works as intended"), then you won't. >> >> Remember SCons ? That was invented using 1.5 and >> stayed that way until recently. They were backporting 2.x patches to their >> 1.x system for the longest time. >> >> With regards to the OP, at Google, we're still using 2.x, however there >> are efforts internally that are moving forward with 3.x and preparing the >> shift. I even wrote recently >> >> that even the Google APIs Client Library is now available for Python 3 >> users. >> >> Cheers, >> -- Wesley >> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >> "A computer never does what you want... only what you tell it." >> +wesley chun : wescpy at gmail : >> @wescpy >> Python training & consulting : http://CyberwebConsulting.com >> "Core Python" books : http://CorePython.com >> Python blog: http://wescpy.blogspot.com >> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> https://mail.python.org/mailman/listinfo/baypiggies >> > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bdbaddog at gmail.com Sat Oct 10 22:45:07 2015 From: bdbaddog at gmail.com (William Deegan) Date: Sat, 10 Oct 2015 13:45:07 -0700 Subject: [Baypiggies] Fwd: Companies moving to Python 3? In-Reply-To: References: <56182618.2070305@yahoo.com> Message-ID: Thanks for the shout out! SCons is alive and kicking, and we just dropped pre-2.7 support. We expect to port the code to run 2.7 and 3.x in the (hopefully) not too distant future. We have a couple feature additions to merge and release first though. -Bill Deegan Co-Manager, SCons project On Fri, Oct 9, 2015 at 11:26 PM, wesley chun wrote: > Larger organizations take more time to move. The backwards-incompatibility > is unfortunate but necessary. As more and more large, well-known packages, > i.e., Django, migrate to 3.x, so will users. However, as Wai Yip mentioned, > if you're not motivated to move (everything "works as intended"), then you > won't. > > Remember SCons ? That was invented using 1.5 and stayed > that way until recently. They were backporting 2.x patches to their 1.x > system for the longest time. > > With regards to the OP, at Google, we're still using 2.x, however there > are efforts internally that are moving forward with 3.x and preparing the > shift. I even wrote recently > > that even the Google APIs Client Library is now available for Python 3 > users. > > Cheers, > -- Wesley > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > "A computer never does what you want... only what you tell it." > +wesley chun : wescpy at gmail : > @wescpy > Python training & consulting : http://CyberwebConsulting.com > "Core Python" books : http://CorePython.com > Python blog: http://wescpy.blogspot.com > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Web at StevePiercy.com Mon Oct 12 01:12:01 2015 From: Web at StevePiercy.com (Steve Piercy - Website Builder) Date: Sun, 11 Oct 2015 16:12:01 -0700 Subject: [Baypiggies] Santa Cruz Python Meetup Tue, Oct 13 - Django app case study; Math Tutor with Kivy Message-ID: We are pleased to announce the program for the next Santa Cruz Python meetup on Tuesday, October 13, 6:00 PM - 8:00 PM, in the Atrium Classroom at Cruzio,?877 Cedar Street, Santa Cruz, CA. View details and RSVP for the meetup: Regular monthly Santa Cruz Python meetups are now held on the second Tuesday of the month at Cruzio. PROGRAM Announcements: 6:00 - 6:15 PM Django app case study: 6:15 - 6:30 PM Tan? Tachyon will present and demonstrate a Django app she recently did for a local car dealer. ?She will discuss the business practices it was intended to replace, show how it works, and then open things up to questions.?http://tachyonlabs.com/ Math Tutor for Kivy: 6:30 - 7:15 PM With just around 500 lines of code, you can build a math tutor application that does arithmetic and can easily be deployed to Android, iOS, Windows, Mac OS X, and Linux. Thanks to the beautiful Kivy library, the process is really straight forward, and building the interface with the Kivy language is amazingly pain free and easy to start with. Bring your laptop and join us as we hack through and build your own Math Tutor app with Kivy! Daniel Gopar is a Software Engineering student at CSUMB, who enjoys hacking on Emacs (the one *true* editor!) and learning all things Python. http://www.pygopar.com/ Open forum: 7:15 - 8:00 PM During this time, we may have a spontaneous and informal presentation, including topics on web frameworks (Pyramid, Flask, Django), tools we use (Fabric, buildout, Ansible), editors (Emacs, vim, PyCharm), events and conferences, or anything else that may interest the group. Sponsors Please refer potential sponsors for food, tasty beverages, or room rental fees to the program hosts, Chris or Steve. Through a generous grant from the Python Software Foundation , our first six months of room rental fees are paid, so that we can deliver our program to Santa Cruz County. The PSF is a 501(c)(3) non-profit organization that?promotes, protects, and advances the Python programming language and community.?The PSF is supported by its members, donors, volunteers, and sponsors. Please support the PSF and its mission by becoming a member . Future Programs Please contact the organizers to suggest topics for future programs for the Santa Cruz Python meetup. ? Lightning talks. Five-minute presentations of Python topics. ? Presentations. Longer presentations of broader Python-related topics and demonstrations of projects. ? Hacking. Make use of the blazing fast wi-fi network at Cruzio to hack on projects, work through tutorials, or do some pair programming. ? Socializing. What's happening? Other local meetups, PyCon 2016 in Portland, OR. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Steve Piercy Website Builder Soquel, CA From jjinux at gmail.com Wed Oct 14 05:22:28 2015 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Wed, 14 Oct 2015 03:22:28 +0000 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: References: Message-ID: When I got to Udemy, I was quite surprised that they had fully migrated to 3.4 :-D Twitter was still on 2.7. On Fri, Oct 9, 2015 at 11:28 AM Craig Rodrigues wrote: > Hi, > > Are people seeing that any companies in the Bay Area are moving > to Python 3 in a major way? > > Recently, I have been porting some code from Python 2 to Python 3. > From a language purist perspective, I see that Python 3 is technically a > better > language. Some of the new keywords in Python 3.5 like async/await look > pretty > cool for making it easier to do asyncio programming. > > However, from an end-user's perspective, the differences between Python 2 > and Python 3 are annoying. Although certain features, like asyncio are > interesting, for most major use cases, there doesn't seem to be any > "killer feature" > or performance boost to justify the effort of going to Python 3. > While many major packages have been ported to Python 3, there are still > quite a few major packages which are still stuck on Python 2. > > Despite these problems, I still like Python 3, and want to focus on > writing new > code which works with it. I was just curious if people are seeing the > move to Python 3 in production. > > -- > Craig > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin at falatic.com Wed Oct 14 07:02:47 2015 From: martin at falatic.com (Martin Falatic) Date: Tue, 13 Oct 2015 22:02:47 -0700 (PDT) Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: References: Message-ID: <38481.24.7.60.89.1444798967.squirrel@martin-wwwss5.ssl.supercp.com> That's pretty cool! I currently work on OpenStack, which has been steadily working on Python 3 compatibility (something I'm proud to see - and for me it's one of many examples of why Python3 is NOT Perl6!) https://wiki.openstack.org/wiki/Python3 - Marty https://www.linkedin.com/in/martinfalatic On Tue, October 13, 2015 20:22, Shannon -jj Behrens wrote: > When I got to Udemy, I was quite surprised that they had fully migrated > to 3.4 :-D Twitter was still on 2.7. > > > On Fri, Oct 9, 2015 at 11:28 AM Craig Rodrigues > wrote: > > >> Hi, >> >> >> Are people seeing that any companies in the Bay Area are moving >> to Python 3 in a major way? >> >> Recently, I have been porting some code from Python 2 to Python 3. >> From a language purist perspective, I see that Python 3 is technically a >> better language. Some of the new keywords in Python 3.5 like >> async/await look pretty cool for making it easier to do asyncio >> programming. >> >> However, from an end-user's perspective, the differences between Python >> 2 >> and Python 3 are annoying. Although certain features, like asyncio are >> interesting, for most major use cases, there doesn't seem to be any >> "killer feature" >> or performance boost to justify the effort of going to Python 3. While >> many major packages have been ported to Python 3, there are still quite >> a few major packages which are still stuck on Python 2. >> >> Despite these problems, I still like Python 3, and want to focus on >> writing new code which works with it. I was just curious if people are >> seeing the move to Python 3 in production. >> >> -- >> Craig >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> https://mail.python.org/mailman/listinfo/baypiggies >> > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies From jjinux at gmail.com Fri Oct 16 03:00:27 2015 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Fri, 16 Oct 2015 01:00:27 +0000 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: References: Message-ID: > I'm going to say the unpopular thing. Python 3 to Python is Perl 6 to Perl. Perl 6 is *very* different than Perl. The syntax is different, and the implementation is entirely redone. It also took a really long time to come out. None of those things are particularly true of Python 3. There are only a few syntactic differences, it didn't take that long to come out, and it's not an entirely new implementation. > From my point of view, 2 is a teaching language, a joy to teach. Python 3, not as much. I really can't think of any reasons why Python 3 isn't a teaching language. I've seen several books teaching kids to program that use Python 3. > I don't how I'm going to teach classes (blueprints for objects) when I have to skip classic classes. I don't understand that either. Classes, methods, objects, etc. are all available in new style classes. Actually, when you're teaching OOP from scratch new style vs. old style classes just don't matter that much. > I thought the killer app is Unicode. I wonder if this list wasn't in English, in an English-speaking (mostly) country, if we'd be seeing more Python 3 in action? Python 2 has Unicode support, so you can't call that the killer feature. The closest things that Python 3 has to a killer feature are "yield from", asyncio (which was somewhat backported), and the ability to annotate parameters, etc. so that you can use a nice static type annotation checker. > Unicode is real important outside of our culture, isn't it? Yes, but it's humorous to remember that some cultures, like Japan, resent Unicode for fairly esoteric reasons ;) -------------- next part -------------- An HTML attachment was scrubbed... URL: From send2md at gmail.com Fri Oct 16 23:31:02 2015 From: send2md at gmail.com (Marilyn Davis) Date: Fri, 16 Oct 2015 14:31:02 -0700 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: References: Message-ID: Hi Shannon, Thanks for the discussion. Availability isn't the issue; it's about finding a smooth order for teaching the concepts. My teaching style is to teach a concept, give exercises; teach a concept, give exercises, ... until we plow through everything. I try to structure the order of topics so that we build knowledge of Python in curiosity-order. I like to teach a lab on classes, exercises; then a lab on inheritance. Both are big concepts to new engineers. I take them one at a time. In 3, I'll have to apologize for the "(object)", which they don't yet understand because they don't know yet about inheritance. I don't see a way to teach "inheritance" before teaching "class". I really really hate to ask students to do something that they don't understand. And I hate to apologize for what I am teaching, or not quite teaching. Those are my thoughts. Any advice? Marilyn On Thu, Oct 15, 2015 at 6:00 PM, Shannon -jj Behrens wrote: > > I'm going to say the unpopular thing. Python 3 to Python is Perl 6 to > Perl. > > Perl 6 is *very* different than Perl. The syntax is different, and the > implementation is entirely redone. It also took a really long time to come > out. None of those things are particularly true of Python 3. There are only > a few syntactic differences, it didn't take that long to come out, and it's > not an entirely new implementation. > > > From my point of view, 2 is a teaching language, a joy to teach. > Python 3, not as much. > > I really can't think of any reasons why Python 3 isn't a teaching > language. I've seen several books teaching kids to program that use Python > 3. > > > I don't how I'm going to teach classes (blueprints for objects) when I > have to skip classic classes. > > I don't understand that either. Classes, methods, objects, etc. are all > available in new style classes. Actually, when you're teaching OOP from > scratch new style vs. old style classes just don't matter that much. > > > I thought the killer app is Unicode. I wonder if this list wasn't in > English, in an English-speaking (mostly) country, if we'd be seeing more > Python 3 in action? > > Python 2 has Unicode support, so you can't call that the killer feature. > The closest things that Python 3 has to a killer feature are "yield from", > asyncio (which was somewhat backported), and the ability to annotate > parameters, etc. so that you can use a nice static type annotation checker. > > > Unicode is real important outside of our culture, isn't it? > > Yes, but it's humorous to remember that some cultures, like Japan, resent > Unicode for fairly esoteric reasons ;) > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aahz at pythoncraft.com Fri Oct 16 23:39:45 2015 From: aahz at pythoncraft.com (Aahz) Date: Fri, 16 Oct 2015 14:39:45 -0700 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: References: Message-ID: <20151016213945.GA14534@panix.com> On Fri, Oct 16, 2015, Marilyn Davis wrote: > > In 3, I'll have to apologize for the "(object)", which they don't yet > understand because they don't know yet about inheritance. What "object"? Here's code that works perfectly well in both Python2 and Python3, modulo the print: class SimpleBunch: def __init__(self, **kwargs): self.__dict__.update(kwargs) x = SimpleBunch(a='foo', x='bar') print(x.a) I don't see any "object" there.... -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ import antigravity From hasan.diwan at gmail.com Fri Oct 16 23:45:57 2015 From: hasan.diwan at gmail.com (Hasan Diwan) Date: Fri, 16 Oct 2015 14:45:57 -0700 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: References: Message-ID: Marilyn, On 16 October 2015 at 14:31, Marilyn Davis wrote: > Hi Shannon, > > Thanks for the discussion. > > Availability isn't the issue; it's about finding a smooth order for > teaching the concepts. > > My teaching style is to teach a concept, give exercises; teach a concept, > give exercises, ... until we plow through everything. I try to structure > the order of topics so that we build knowledge of Python in curiosity-order. > > I like to teach a lab on classes, exercises; then a lab on inheritance. > Both are big concepts to new engineers. I take them one at a time. > > In 3, I'll have to apologize for the "(object)", which they don't yet > understand because they don't know yet about inheritance. > > I don't see a way to teach "inheritance" before teaching "class". > > I really really hate to ask students to do something that they don't > understand. And I hate to apologize for what I am teaching, or not quite > teaching. > > Those are my thoughts. Any advice? > What you could do is show the python class hierarchy and add a user-created class in the right place, I suppose? -- H > > Marilyn > > > > > > > On Thu, Oct 15, 2015 at 6:00 PM, Shannon -jj Behrens > wrote: > >> > I'm going to say the unpopular thing. Python 3 to Python is Perl 6 to >> Perl. >> >> Perl 6 is *very* different than Perl. The syntax is different, and the >> implementation is entirely redone. It also took a really long time to come >> out. None of those things are particularly true of Python 3. There are only >> a few syntactic differences, it didn't take that long to come out, and it's >> not an entirely new implementation. >> >> > From my point of view, 2 is a teaching language, a joy to teach. >> Python 3, not as much. >> >> I really can't think of any reasons why Python 3 isn't a teaching >> language. I've seen several books teaching kids to program that use Python >> 3. >> >> > I don't how I'm going to teach classes (blueprints for objects) when I >> have to skip classic classes. >> >> I don't understand that either. Classes, methods, objects, etc. are all >> available in new style classes. Actually, when you're teaching OOP from >> scratch new style vs. old style classes just don't matter that much. >> >> > I thought the killer app is Unicode. I wonder if this list wasn't in >> English, in an English-speaking (mostly) country, if we'd be seeing more >> Python 3 in action? >> >> Python 2 has Unicode support, so you can't call that the killer feature. >> The closest things that Python 3 has to a killer feature are "yield from", >> asyncio (which was somewhat backported), and the ability to annotate >> parameters, etc. so that you can use a nice static type annotation checker. >> >> > Unicode is real important outside of our culture, isn't it? >> >> Yes, but it's humorous to remember that some cultures, like Japan, resent >> Unicode for fairly esoteric reasons ;) >> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> https://mail.python.org/mailman/listinfo/baypiggies >> > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -- OpenPGP: https://hasan.d8u.us/gpg.key Sent from my mobile device Envoy? de mon portable -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjumbewu at gmail.com Sat Oct 17 00:39:45 2015 From: mjumbewu at gmail.com (Mjumbe Poe) Date: Fri, 16 Oct 2015 22:39:45 +0000 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: <20151016213945.GA14534@panix.com> References: <20151016213945.GA14534@panix.com> Message-ID: Hi Marilyn, I think the important point in Aahz's reply is that all classes in Python 3 are "new-style" classes. You don't actually have to use the explicit (object) inheritance. In my experience, that's made teaching classes with Python 3 easier because I don't find myself apologizing for the different types of classes. When you start covering inheritance, you can just say "by default, a class derives from object, but if you want to change that, blah blah blah." Hope that helps :). - Mjumbe On Fri, Oct 16, 2015 at 5:40 PM Aahz wrote: > On Fri, Oct 16, 2015, Marilyn Davis wrote: > > > > In 3, I'll have to apologize for the "(object)", which they don't yet > > understand because they don't know yet about inheritance. > > What "object"? Here's code that works perfectly well in both Python2 > and Python3, modulo the print: > > class SimpleBunch: > def __init__(self, **kwargs): > self.__dict__.update(kwargs) > > x = SimpleBunch(a='foo', x='bar') > print(x.a) > > I don't see any "object" there.... > -- > Aahz (aahz at pythoncraft.com) <*> > http://www.pythoncraft.com/ > > import antigravity > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wescpy at gmail.com Sat Oct 17 00:47:26 2015 From: wescpy at gmail.com (wesley chun) Date: Fri, 16 Oct 2015 15:47:26 -0700 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: <20151016213945.GA14534@panix.com> References: <20151016213945.GA14534@panix.com> Message-ID: I agree with Aahz & JJ: On Thu, Oct 15, 2015 at 6:00 PM, Shannon -jj Behrens wrote: > > I'm going to say the unpopular thing. Python 3 to Python is Perl 6 to > Perl. > > Perl 6 is *very* different than Perl. The syntax is different, and the > implementation is entirely redone. It also took a really long time to come > out. None of those things are particularly true of Python 3. There are only > a few syntactic differences, it didn't take that long to come out, and it's > not an entirely new implementation. > I get where Wai-Yip is coming from, and it's okay to have that perspective, but the future really is Python 3, or at least PyPy. The comparisons don't work because as JJ mentioned, it's not an entirely new implementation. Broad adoption has been hampered mainly by package availability (you're not going to port if your dependencies haven't), and that gap is narrowing every day. Here's a graph representing the # of Python 3 packages in the Cheeseshop up to the end of 2014Q1.... while it's not current, you can extrapolate the trend (to arrive at today's count, which is ~12,400[!]): [image: Inline image 1] Django, Flask, various MySQL adapters, NumPy, and SciPy were pretty big milestones. Even the Google APIs Client Library is now available for Python 3 users (and I didn't expect *that* to happen in 2015). >> From my point of view, 2 is a teaching language, a joy to teach. Python 3, not as much. > > >I really can't think of any reasons why Python 3 isn't a teaching language. I've seen several books teaching kids to program that use Python 3. > >> I don't how I'm going to teach classes (blueprints for objects) when I have to skip classic classes. > > I don't understand that either. Classes, methods, objects, etc. are all available in new style classes. Actually, when you're teaching OOP from scratch new style vs. old style classes just don't matter that much. There should be no real stark differences b/w teaching 2.x or 3.x... at least not until you hit the network. The only minor thing to include is how some functions/methods that previously returned lists now return iterators. When you get to networking or text processing, you'll have to talk about massaging bytes into strings. Aahz' example code snippet emphasizes that the "classic class" syntax creates new-style classes in 3.x, meaning you don't need to talk about "(object)" until the time is right. As a result, all my Python courses are both 2.x & 3.x at the same time, and the same is true of my books. In fact, many of my code snippets will run unmodified on 2.x & 3.x interpreters since they're so short, without the use of a 3rd-party library like six, python-modernize, or future, although using packages like those is a good practice moving forward. When 3.0 was released in 2008, its backwards-compatibility and my sense of how fast the software industry moves made me call "a decade" before everyone has migrated to 3.x. We've got 3 years left, so I think we're "on track." > I thought the killer app is Unicode. I wonder if this list wasn't in > English, in an English-speaking (mostly) country, if we'd be seeing more > Python 3 in action? > > Python 2 has Unicode support, so you can't call that the killer feature. > The closest things that Python 3 has to a killer feature are "yield from", > asyncio (which was somewhat backported), and the ability to annotate > parameters, etc. so that you can use a nice static type annotation checker. > > > Unicode is real important outside of our culture, isn't it? > > Yes, but it's humorous to remember that some cultures, like Japan, resent > Unicode for fairly esoteric reasons ;) > Correct. Unicode is just another string type. Yes, it so happens to be the default type in 3.x, but that's for the better. It's not a "killer app," but a feature that needed to happen to help Python evolve and opens the doors globally. There *is* no culture in software engineering... just the need to write code that can handle well more data than the narrow world of 7-bit ASCII. Remember, it's not "Unicode vs. ASCII," but "text vs. data." (I have to admit that it's a bit more troublesome working with data that comes from and goes to the network in 3.x though.) Cheers, -- Wesley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "A computer never does what you want... only what you tell it." +wesley chun : wescpy at gmail : @wescpy Python training & consulting : http://CyberwebConsulting.com "Core Python" books : http://CorePython.com Python blog: http://wescpy.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: py3pkgs.png Type: image/png Size: 1390 bytes Desc: not available URL: From wescpy at gmail.com Sat Oct 17 00:51:33 2015 From: wescpy at gmail.com (wesley chun) Date: Fri, 16 Oct 2015 15:51:33 -0700 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: References: <20151016213945.GA14534@panix.com> Message-ID: One more thought. I remember when the Python 3 porting wall of superpowers was mostly red and a "wall of shame," but now, it's almost all green. Cheers, --Wesley -------------- next part -------------- An HTML attachment was scrubbed... URL: From send2md at gmail.com Sat Oct 17 00:37:51 2015 From: send2md at gmail.com (Marilyn Davis) Date: Fri, 16 Oct 2015 15:37:51 -0700 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: References: Message-ID: OMG. I read that only New Style was supported in Python and you had to inherit from object! Thank you so much Hasan and Aahz. I am relieved. Now I look forward to teaching it one day. Marilyn On Fri, Oct 16, 2015 at 2:45 PM, Hasan Diwan wrote: > Marilyn, > > On 16 October 2015 at 14:31, Marilyn Davis wrote: > >> Hi Shannon, >> >> Thanks for the discussion. >> >> Availability isn't the issue; it's about finding a smooth order for >> teaching the concepts. >> >> My teaching style is to teach a concept, give exercises; teach a concept, >> give exercises, ... until we plow through everything. I try to structure >> the order of topics so that we build knowledge of Python in curiosity-order. >> >> I like to teach a lab on classes, exercises; then a lab on inheritance. >> Both are big concepts to new engineers. I take them one at a time. >> >> In 3, I'll have to apologize for the "(object)", which they don't yet >> understand because they don't know yet about inheritance. >> >> I don't see a way to teach "inheritance" before teaching "class". >> >> I really really hate to ask students to do something that they don't >> understand. And I hate to apologize for what I am teaching, or not quite >> teaching. >> >> Those are my thoughts. Any advice? >> > > What you could do is show the python class hierarchy and add a > user-created class in the right place, I suppose? -- H > >> >> Marilyn >> >> >> >> >> >> >> On Thu, Oct 15, 2015 at 6:00 PM, Shannon -jj Behrens >> wrote: >> >>> > I'm going to say the unpopular thing. Python 3 to Python is Perl 6 to >>> Perl. >>> >>> Perl 6 is *very* different than Perl. The syntax is different, and the >>> implementation is entirely redone. It also took a really long time to come >>> out. None of those things are particularly true of Python 3. There are only >>> a few syntactic differences, it didn't take that long to come out, and it's >>> not an entirely new implementation. >>> >>> > From my point of view, 2 is a teaching language, a joy to teach. >>> Python 3, not as much. >>> >>> I really can't think of any reasons why Python 3 isn't a teaching >>> language. I've seen several books teaching kids to program that use Python >>> 3. >>> >>> > I don't how I'm going to teach classes (blueprints for objects) when >>> I have to skip classic classes. >>> >>> I don't understand that either. Classes, methods, objects, etc. are all >>> available in new style classes. Actually, when you're teaching OOP from >>> scratch new style vs. old style classes just don't matter that much. >>> >>> > I thought the killer app is Unicode. I wonder if this list wasn't in >>> English, in an English-speaking (mostly) country, if we'd be seeing more >>> Python 3 in action? >>> >>> Python 2 has Unicode support, so you can't call that the killer feature. >>> The closest things that Python 3 has to a killer feature are "yield from", >>> asyncio (which was somewhat backported), and the ability to annotate >>> parameters, etc. so that you can use a nice static type annotation checker. >>> >>> > Unicode is real important outside of our culture, isn't it? >>> >>> Yes, but it's humorous to remember that some cultures, like Japan, >>> resent Unicode for fairly esoteric reasons ;) >>> >>> _______________________________________________ >>> Baypiggies mailing list >>> Baypiggies at python.org >>> To change your subscription options or unsubscribe: >>> https://mail.python.org/mailman/listinfo/baypiggies >>> >> >> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> https://mail.python.org/mailman/listinfo/baypiggies >> > > > > -- > OpenPGP: https://hasan.d8u.us/gpg.key > Sent from my mobile device > Envoy? de mon portable > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aahz at pythoncraft.com Sat Oct 17 15:30:14 2015 From: aahz at pythoncraft.com (Aahz) Date: Sat, 17 Oct 2015 06:30:14 -0700 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: References: Message-ID: <20151017133014.GA28167@panix.com> [warning: rant ahead] On Fri, Oct 16, 2015, Marilyn Davis wrote: > > OMG. I read that only New Style was supported in Python and you had to > inherit from object! Anyone who has preconceptions or hearsay about Python3 should try actually using it. There are IMO still plenty of reasons for sticking with Python2, but Python3 is absolutely the future, Python 3.4.3 (combined with the preceding releases) removes several blocking factors that existed in 3.0, and it really doesn't take that much time to learn Python3. (Yeah, I'm discounting Python 3.5 because I always wait for the .1 release.) There are now two and only two categories of reasons for sticking with Python2 for new projects: infrastructure and package availability (Actually, there's always laziness, but that's not a good reason. ;-) Keep in mind that Python3 is in the end a smaller leap than going from Python 1.5.1 (where I started) to Python 2.7.... It just involves a bit more backwards incompatibility (and not that much more, in the end, given all the new keywords from Python 1.6 through 2.7). Note that I myself still haven't used Python3 for anything other than sample code (and for various reasons I've written less than a hundred lines of Python code in the last three years -- even that code I posted just happened to be lying around), but I believe it's absolutely essential for every serious Python programmer and *EVERYONE* who teaches Python to be able to refute mistakes like the one you made without having to think about it. Failing to learn at least the basics of Python3 is IMO irresponsible to the Python community. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ import antigravity From mdavis2 at ucsc.edu Sun Oct 25 15:02:44 2015 From: mdavis2 at ucsc.edu (Marilyn Davis) Date: Sun, 25 Oct 2015 12:02:44 -0700 Subject: [Baypiggies] Classes starting at UCSC Extension Message-ID: Hi Python People, We have a "Software Engineering For Novices" in the daytime starting Nov 2, 4, and 6: MWF. 9-4 at our lab at UCSC-Extension in Santa Clara, right across 101 from the Great America sign: http://course.ucsc-extension.edu/modules/shop/index.html?action=section&OfferingID=3576274&SectionID=5277302 There we will practice some basic engineering mechanisms so that you can take the programmers' class at a later time, or a programmers' class in a different language. To join this class you need no prior experience with programming. However, if you are truely new to programming, it is better to start with an evening class so that you have more time for practice and sleep. There are many at UCSC-Extension. All are listed here: http://course.ucsc-extension.edu/modules/shop/index.html?action=courseSearch If you have programming experience in any language skip the novice class and join a programmers' class. The next daytime Python Retreat for well-seasoned programmers is Mon through Thur, Nov 30 - Dec 3, 9-5: http://course.ucsc-extension.edu/modules/shop/index.html?action=section&OfferingID=1531625&SectionID=5277312 The course is low-pressure, but fast-paced, where students learn and practice core concepts and Pythonic thinking. To join this class, you should be well-practiced at programming in some other language. No beginning programmers please, but you can certainly be new to Python. ONLINE CLASS: If you would prefer an online class, you will enjoy: http://course.ucsc-extension.edu/modules/shop/index.html?action=section&OfferingID=1531625&SectionID=5277233 Nov 10 - Feb 9. ---- All our Python courses are hands-on with short lectures, and lots of exercises where we study the solutions after some lab time. Questions are always welcome; discussion and pair-programming are encouraged. Please come, and send students! --- And, the first quarter of the professional course is available for $20 at Udemy.Com! I'm so busy that I can't say when the rest of the course will be there, but I'm working on it. https://www.udemy.com/pythonic-python-part-i-the-basics/ I hope you find one of these classes useful to your schedule and your taste. Marilyn Davis, Ph.D. Python Instructor http:www.pythontrainer.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mahmoud at hatnote.com Tue Oct 27 17:45:29 2015 From: mahmoud at hatnote.com (Mahmoud Hashemi) Date: Tue, 27 Oct 2015 14:45:29 -0700 Subject: [Baypiggies] PayPal Staff Security Engineer Message-ID: Hey all, Long-time reader, first-time ad poster, doing my best to comply with http://baypiggies.net/job-listings, too. At PayPal, multiple new cryptographic core services are Python. These are high-performance, high-security components, so POSIX/systems/network experience is a must. We have a broad Python community within the company, supported by a compact but very experienced dedicated Python team. This position is within that team. If you're intrigued by Python at scale, check out the job listing for a full description (https://www.python.org/jobs/734/) and get in touch! Mahmoud Hashemi mahmoud at paypal.com github.com/mahmoud -------------- next part -------------- An HTML attachment was scrubbed... URL: From rodrigc at FreeBSD.org Fri Oct 30 18:58:04 2015 From: rodrigc at FreeBSD.org (Craig Rodrigues) Date: Fri, 30 Oct 2015 15:58:04 -0700 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: References: Message-ID: Thanks to all who responded to my question about companies using Python 3. I did not mean to cause a ruckus. :) I actually got a lot of nice and friendly responses on and off the list. The Python 3 transition is a pain in the neck right now, but eventually it will be the mainstream. Despite these transition pains, of all the languages I work with, I actually feel *happy* when I work with Python. :) -- Craig -------------- next part -------------- An HTML attachment was scrubbed... URL: From aahz at pythoncraft.com Fri Oct 30 19:37:56 2015 From: aahz at pythoncraft.com (Aahz) Date: Fri, 30 Oct 2015 16:37:56 -0700 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: References: Message-ID: <20151030233756.GA10226@panix.com> On Fri, Oct 30, 2015, Craig Rodrigues wrote: > > Despite these transition pains, of all the languages I work with, I > actually feel *happy* when I work with Python. :) Next year will be my fortieth anniversary of writing programs. However, until I learned Python (a little over fifteen years ago), I hated programming and I rarely called myself a programmer. Thanks, Guido! -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "The more you drive, the less intelligent you are." --_Repo Man_ From wescpy at gmail.com Sat Oct 31 02:19:48 2015 From: wescpy at gmail.com (wesley chun) Date: Fri, 30 Oct 2015 23:19:48 -0700 Subject: [Baypiggies] Companies moving to Python 3? In-Reply-To: <20151030233756.GA10226@panix.com> References: <20151030233756.GA10226@panix.com> Message-ID: On Fri, Oct 30, 2015 at 4:37 PM, Aahz wrote: > On Fri, Oct 30, 2015, Craig Rodrigues wrote: > > Thanks to all who responded to my question about companies using Python > 3. I did not mean to cause a ruckus. :) No, I think your question was quite warranted, and rather than a "ruckus," you brought about discussion/dialogue that needed to happen. The audio isn't great, but we had nearly the same 2 vs. 3 discussion at the SF Python Meetup last summer, although there were more against-3 attendees & panel members. :-) > > Despite these transition pains, of all the languages I work with, I > > actually feel *happy* when I work with Python. :) > > Next year will be my fortieth anniversary of writing programs. However, > until I learned Python (a little over fifteen years ago), I hated > programming and I rarely called myself a programmer. > > Thanks, Guido! > I too blame Guido for my career. ;-) Cheers, -- Wesley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "A computer never does what you want... only what you tell it." +wesley chun : wescpy at gmail : @wescpy Python training & consulting : http://CyberwebConsulting.com "Core Python" books : http://CorePython.com Python blog: http://wescpy.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From rodrigc at FreeBSD.org Sat Oct 31 19:25:01 2015 From: rodrigc at FreeBSD.org (Craig Rodrigues) Date: Sat, 31 Oct 2015 16:25:01 -0700 Subject: [Baypiggies] Alternatives to Python Fabric for SSH remote execution for Python 3? Message-ID: Hi, I was recently doing QA work at a startup, and extensively used Fabric ( http://fabfile.org ) for execute commands remotely over SSH. I used only a few functions from this library, such as fabric.api.run() , fabric.api.cd(), fabric.api.put(), fabric.api.get(). This allowed me to run a remote command, change to a remote directory, put a file, and get a file, all over SSH. For my uses, this worked out quite well. I really liked this library a lot. The only downside is the library does not work with Python 3. I've tried this patch to add Python 3 support: https://github.com/fabric/fabric/issues/1378 and it works. However, the author of Fabric is not accepting this patch because he does not want to drop support for Python 2.5. The author is working on a rewrite called Pyinvoke ( http://www.pyinvoke.org/ ) which will support Python 3, but that is very early pre-alpha stuff. Can anyone recommend an alternate library for doing SSH remote execution, which works on Python 2 and Python 3, and is simple to use? Since Fabric layers on top of the Paramiko ( http://paramiko.org ) SSH library, is using that directly the best way to go? -- Craig -------------- next part -------------- An HTML attachment was scrubbed... URL: From tiejli at yahoo.com Sat Oct 31 19:38:04 2015 From: tiejli at yahoo.com (Tiejun Li) Date: Sat, 31 Oct 2015 16:38:04 -0700 Subject: [Baypiggies] Alternatives to Python Fabric for SSH remote execution for Python 3? Message-ID: <1446334684.79761.YahooMailAndroidMobile@web142606.mail.bf1.yahoo.com> There is none. Fabric is the best. Sent from Yahoo Mail on Android From:"Craig Rodrigues" Date:Sat, Oct 31, 2015 at 4:25 PM Subject:[Baypiggies] Alternatives to Python Fabric for SSH remote execution for Python 3? Hi, I was recently doing QA work at a startup, and extensively used Fabric ( http://fabfile.org ) for execute commands remotely over SSH. I used only a few functions from this library, such as fabric.api.run() , fabric.api.cd(), fabric.api.put(), fabric.api.get(). This allowed me to run a remote command, change to a remote directory, put a file, and get a file, all over SSH. For my uses, this worked out quite well.? I really liked this library a lot. The only downside is the library does not work with Python 3. I've tried this patch to add Python 3 support: https://github.com/fabric/fabric/issues/1378 and it works.? However, the author of Fabric is not accepting this patch because he does not want to drop support for Python 2.5. The author is working on a rewrite called Pyinvoke ( http://www.pyinvoke.org/ ) which will support Python 3, but that is very early pre-alpha stuff. Can anyone recommend an alternate library for doing SSH remote execution, which works on Python 2 and Python 3, and is simple to use? Since Fabric layers on top of the Paramiko ( http://paramiko.org ) SSH library, is using that directly the best way to go? -- Craig _______________________________________________ Baypiggies mailing list Baypiggies at python.org To change your subscription options or unsubscribe: https://mail.python.org/mailman/listinfo/baypiggies -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.berthelot at gmail.com Sat Oct 31 20:25:33 2015 From: david.berthelot at gmail.com (David Berthelot) Date: Sat, 31 Oct 2015 17:25:33 -0700 Subject: [Baypiggies] Alternatives to Python Fabric for SSH remote execution for Python 3? In-Reply-To: <1446334684.79761.YahooMailAndroidMobile@web142606.mail.bf1.yahoo.com> References: <1446334684.79761.YahooMailAndroidMobile@web142606.mail.bf1.yahoo.com> Message-ID: You can use python 2.7.x for fabfile.py since it's just a single file independent of the rest of your project. On Sat, Oct 31, 2015 at 4:38 PM, Tiejun Li via Baypiggies < baypiggies at python.org> wrote: > There is none. Fabric is the best. > > Sent from Yahoo Mail on Android > > ------------------------------ > *From*:"Craig Rodrigues" > *Date*:Sat, Oct 31, 2015 at 4:25 PM > *Subject*:[Baypiggies] Alternatives to Python Fabric for SSH remote > execution for Python 3? > > Hi, > > I was recently doing QA work at a startup, and extensively used > Fabric ( http://fabfile.org ) for execute commands remotely over SSH. > > I used only a few functions from this library, such as > fabric.api.run() , fabric.api.cd(), fabric.api.put(), fabric.api.get(). > This allowed me to run a remote command, change to a remote directory, > put a file, and get a file, all over SSH. > > For my uses, this worked out quite well. I really liked this library a > lot. > > The only downside is the library does not work with Python 3. > I've tried this patch to add Python 3 support: > https://github.com/fabric/fabric/issues/1378 > and it works. However, the author of Fabric is not accepting this patch > because he does not want to drop support for Python 2.5. > The author is working on a rewrite called Pyinvoke ( > http://www.pyinvoke.org/ ) > which will support Python 3, but that is very early pre-alpha stuff. > > Can anyone recommend an alternate library for doing SSH remote > execution, which works on Python 2 and Python 3, and is simple to use? > > Since Fabric layers on top of the Paramiko ( http://paramiko.org ) SSH > library, > is using that directly the best way to go? > > -- > Craig > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From harlowja at gmail.com Sat Oct 31 20:46:41 2015 From: harlowja at gmail.com (Joshua Harlow) Date: Sat, 31 Oct 2015 17:46:41 -0700 Subject: [Baypiggies] Alternatives to Python Fabric for SSH remote execution for Python 3? In-Reply-To: References: <1446334684.79761.YahooMailAndroidMobile@web142606.mail.bf1.yahoo.com> Message-ID: Or https://pypi.python.org/pypi/plumbum That is similar to fabric (imho it's better); may work for u... On Saturday, October 31, 2015, David Berthelot wrote: > You can use python 2.7.x for fabfile.py since it's just a single file > independent of the rest of your project. > > On Sat, Oct 31, 2015 at 4:38 PM, Tiejun Li via Baypiggies < > baypiggies at python.org > > wrote: > >> There is none. Fabric is the best. >> >> Sent from Yahoo Mail on Android >> >> ------------------------------ >> *From*:"Craig Rodrigues" >> *Date*:Sat, Oct 31, 2015 at 4:25 PM >> *Subject*:[Baypiggies] Alternatives to Python Fabric for SSH remote >> execution for Python 3? >> >> Hi, >> >> I was recently doing QA work at a startup, and extensively used >> Fabric ( http://fabfile.org ) for execute commands remotely over SSH. >> >> I used only a few functions from this library, such as >> fabric.api.run() , fabric.api.cd(), fabric.api.put(), fabric.api.get(). >> This allowed me to run a remote command, change to a remote directory, >> put a file, and get a file, all over SSH. >> >> For my uses, this worked out quite well. I really liked this library a >> lot. >> >> The only downside is the library does not work with Python 3. >> I've tried this patch to add Python 3 support: >> https://github.com/fabric/fabric/issues/1378 >> and it works. However, the author of Fabric is not accepting this patch >> because he does not want to drop support for Python 2.5. >> The author is working on a rewrite called Pyinvoke ( >> http://www.pyinvoke.org/ ) >> which will support Python 3, but that is very early pre-alpha stuff. >> >> Can anyone recommend an alternate library for doing SSH remote >> execution, which works on Python 2 and Python 3, and is simple to use? >> >> Since Fabric layers on top of the Paramiko ( http://paramiko.org ) SSH >> library, >> is using that directly the best way to go? >> >> -- >> Craig >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> https://mail.python.org/mailman/listinfo/baypiggies >> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> >> To change your subscription options or unsubscribe: >> https://mail.python.org/mailman/listinfo/baypiggies >> > > -- -- facebook.com/jshharlow flickr.com/jshharlow YIM: jshharlow -------------- next part -------------- An HTML attachment was scrubbed... URL: