Re: [gettext] How to change language at run-time

2017-06-15 Thread dieter
pozz writes: > I know I can load multiple gettext.translation: > > it = gettext.translation('test', localedir="locale", languages=["it"]) > es = gettext.translation('test', localedir="locale", languages=["es"]) > > and install one translation at run-time when I want at a later time > (when the

Re: [OT] is JSON all that great? - was Re: API Help

2017-06-15 Thread Ben Finney
alister writes: > Json is designed to be legal Javascript code & therefore directly > executable so no parser is posible. JSON is designed to be *a strictly limited subset* of legal JavaScript that only defines data structures. The explicit goal is that it is statically parseable as non-executab

Re: Customise the virtualenv `activate` script

2017-06-15 Thread Ben Finney
Cameron Simpson writes: > I must admit my initial preference would be the differently named > wrapper. Surely users of the codebase will be invoking stuff via > something opaque which sources the requisite things? That “something opaque” is the ‘$VENV/bin/activate’ script; many people who join t

Re: Developers Who Use Spaces Make More Money!

2017-06-15 Thread Ian Kelly
On Thu, Jun 15, 2017 at 8:51 PM, Larry Martell wrote: > On Thu, Jun 15, 2017 at 6:35 PM, Christopher Reimer > wrote: >> One commentator on a tech website admonished programmers for wasting time by >> pressing the space bar four times instead of using tab. O_o > > Not in vi with > > set autoinden

Re: Developers Who Use Spaces Make More Money!

2017-06-15 Thread Larry Martell
On Thu, Jun 15, 2017 at 6:35 PM, Christopher Reimer wrote: >> On Jun 15, 2017, at 3:24 PM, jlada...@itu.edu wrote: >> >> This is hilarious, I have to share: >> >> https://stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/ >> >> Thanks to Guido for making us all richer! > > On

Re: Developers Who Use Spaces Make More Money!

2017-06-15 Thread Steve D'Aprano
On Fri, 16 Jun 2017 08:42 am, Chris Angelico wrote: > On Fri, Jun 16, 2017 at 8:24 AM, wrote: >> This is hilarious, I have to share: >> >> https://stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/ >> >> Thanks to Guido for making us all richer! > > Bah, that's just noise.

Re: Developers Who Use Spaces Make More Money!

2017-06-15 Thread Christopher Reimer
> On Jun 15, 2017, at 3:24 PM, jlada...@itu.edu wrote: > > This is hilarious, I have to share: > > https://stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/ > > Thanks to Guido for making us all richer! One commentator on a tech website admonished programmers for wasting

Re: Developers Who Use Spaces Make More Money!

2017-06-15 Thread Chris Angelico
On Fri, Jun 16, 2017 at 8:24 AM, wrote: > This is hilarious, I have to share: > > https://stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/ > > Thanks to Guido for making us all richer! Bah, that's just noise. There may appear to be a small difference between those who use

Developers Who Use Spaces Make More Money!

2017-06-15 Thread jladasky
This is hilarious, I have to share: https://stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/ Thanks to Guido for making us all richer! -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT] is JSON all that great? - was Re: API Help

2017-06-15 Thread Chris Angelico
On Fri, Jun 16, 2017 at 6:58 AM, Grant Edwards wrote: > On 2017-06-15, Erik wrote: >> On 15/06/17 15:10, Chris Angelico wrote: >>> On Fri, Jun 16, 2017 at 12:00 AM, alister wrote: Json is designed to be legal Javascript code & therefore directly executable so no parser is posible.

Re: [OT] is JSON all that great? - was Re: API Help

2017-06-15 Thread Chris Angelico
On Fri, Jun 16, 2017 at 6:17 AM, Erik wrote: > On 15/06/17 15:10, Chris Angelico wrote: >> >> On Fri, Jun 16, 2017 at 12:00 AM, alister >> wrote: >>> >>> Json is designed to be legal Javascript code & therefore directly >>> executable so no parser is posible. >>> >> >> "no parser is possible"???

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Larry Martell
On Thu, Jun 15, 2017 at 1:44 PM, Kushal Kumaran wrote: > Your python was built without sqlite3 support. If your yum repo > provider is unable to rebuild with sqlite3, you can do so yourself. > Make sure the sqlite-devel package is installed so your python build > will use it. Decided to do this

Re: [OT] is JSON all that great? - was Re: API Help

2017-06-15 Thread Grant Edwards
On 2017-06-15, Erik wrote: > On 15/06/17 15:10, Chris Angelico wrote: >> On Fri, Jun 16, 2017 at 12:00 AM, alister wrote: >>> Json is designed to be legal Javascript code & therefore directly >>> executable so no parser is posible. >>> >> >> "no parser is possible"??? > > I *think* alister meant

Re: [OT] is JSON all that great? - was Re: API Help

2017-06-15 Thread Erik
On 15/06/17 15:10, Chris Angelico wrote: On Fri, Jun 16, 2017 at 12:00 AM, alister wrote: Json is designed to be legal Javascript code & therefore directly executable so no parser is posible. "no parser is possible"??? I *think* alister meant "so it is possible to not use a parser [librar

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Kushal Kumaran
Larry Martell writes: > On Thu, Jun 15, 2017 at 12:20 PM, Kushal Kumaran wrote: >> Larry Martell writes: >> >>> On Thu, Jun 15, 2017 at 10:35 AM, Peter Otten <__pete...@web.de> wrote: Larry Martell wrote: >> On linux the system sqlite3 is used. > > I tried building and ins

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Larry Martell
On Thu, Jun 15, 2017 at 12:20 PM, Kushal Kumaran wrote: > Larry Martell writes: > >> On Thu, Jun 15, 2017 at 10:35 AM, Peter Otten <__pete...@web.de> wrote: >>> Larry Martell wrote: >>> > On linux the system sqlite3 is used. I tried building and installing sqlite from source and tha

Re: [gettext] How to change language at run-time

2017-06-15 Thread Peter Otten
pozz wrote: > Il 15/06/2017 15:22, Peter Otten ha scritto: >> pozz wrote: >> >>> I know I can load multiple gettext.translation: >>> >>> it = gettext.translation('test', localedir="locale", >>> languages=["it"]) es = gettext.translation('test', >>> localedir="locale", languages=["es"]

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Kushal Kumaran
Larry Martell writes: > On Thu, Jun 15, 2017 at 10:35 AM, Peter Otten <__pete...@web.de> wrote: >> Larry Martell wrote: >> On linux the system sqlite3 is used. >>> >>> I tried building and installing sqlite from source and that did not >>> solve the problem. >> >> You misunderstood: the prob

Re: [gettext] How to change language at run-time

2017-06-15 Thread pozz
Il 15/06/2017 15:22, Peter Otten ha scritto: pozz wrote: I know I can load multiple gettext.translation: it = gettext.translation('test', localedir="locale", languages=["it"]) es = gettext.translation('test', localedir="locale", languages=["es"]) and install one translation at run-tim

Re: [OT] is JSON all that great? - was Re: API Help

2017-06-15 Thread Gene Heskett
On Thursday 15 June 2017 01:10:26 Marko Rauhamaa wrote: > Chris Angelico : > > XML is thus poorly suited to *most* forms of data, > > Correct. > > > > > > > aa > > qq > > qw > > qe > > as > > > > > > What does this represent? A generic XML parser has to cope with it. > > I gave this t

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Peter Otten
Larry Martell wrote: > Sorry I mistyped - it wasn't pip it was yum. OK, I'm out then. Looks like what works for Debian derivatives is not easily transferable to Redhead... -- https://mail.python.org/mailman/listinfo/python-list

Re: Does Python need Javascript?

2017-06-15 Thread Ned Batchelder
On Thursday, June 15, 2017 at 5:55:07 AM UTC-4, Gregory Ewing wrote: > Chris Angelico wrote: > > There've been a number of attempts, over the years, to make a > > sandboxed Python interpreter, where you can run untrusted code. But if > > Python came with a JS interpreter, it would be possible to ru

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Larry Martell
On Thu, Jun 15, 2017 at 10:35 AM, Peter Otten <__pete...@web.de> wrote: > Larry Martell wrote: > >>> On linux the system sqlite3 is used. >> >> I tried building and installing sqlite from source and that did not >> solve the problem. > > You misunderstood: the problem is not sqlite3 it's that pytho

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Peter Otten
Larry Martell wrote: >> On linux the system sqlite3 is used. > > I tried building and installing sqlite from source and that did not > solve the problem. You misunderstood: the problem is not sqlite3 it's that python needs sqlite3's header files. >> Is that a Python version that you compiled y

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Larry Martell
On Thu, Jun 15, 2017 at 9:55 AM, Peter Otten <__pete...@web.de> wrote: > Larry Martell wrote: > >> On Thu, Jun 15, 2017 at 8:56 AM, Mark Summerfield via Python-list >> wrote: >>> On Thursday, June 15, 2017 at 1:47:00 PM UTC+1, larry@gmail.com >>> wrote: I am trying to use sqlite

Re: [OT] is JSON all that great? - was Re: API Help

2017-06-15 Thread Chris Angelico
On Fri, Jun 16, 2017 at 12:00 AM, alister wrote: > On Thu, 15 Jun 2017 22:27:40 +1000, Chris Angelico wrote: > >> On Thu, Jun 15, 2017 at 9:47 PM, Rhodri James >> wrote: 1) It is not secure. Check this out: https://stackoverflow.com/questions/1906927/xml- > vulnerabilities#1907500 >>> X

Re: [OT] is JSON all that great? - was Re: API Help

2017-06-15 Thread alister
On Thu, 15 Jun 2017 22:27:40 +1000, Chris Angelico wrote: > On Thu, Jun 15, 2017 at 9:47 PM, Rhodri James > wrote: >>> 1) It is not secure. Check this out: >>> https://stackoverflow.com/questions/1906927/xml- vulnerabilities#1907500 >> XML and JSON share the vulnerabilities that come from having

Re: Bug or intended behavior?

2017-06-15 Thread Chris Angelico
On Thu, Jun 15, 2017 at 11:37 PM, bob gailer wrote: > Slight OT digression: The language that is best for me is APL in which there > is no operator precedence to worry about. Execution is strictly > right-to-left. () are used when the order of evaluation needs to be altered. > I recall one person

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Peter Otten
Larry Martell wrote: > On Thu, Jun 15, 2017 at 8:56 AM, Mark Summerfield via Python-list > wrote: >> On Thursday, June 15, 2017 at 1:47:00 PM UTC+1, larry@gmail.com >> wrote: >>> I am trying to use sqlite >>> >>> $ python2.7 >>> Python 2.7.10 (default, Feb 22 2016, 12:13:36) >>> [GCC 4.4.7 20

Re: Bug or intended behavior?

2017-06-15 Thread bob gailer
Sending this to docs in hopes of improving documentation of % formatting and operator precedence. Perhaps add "see 6:16 Operator precedence." On 6/3/2017 5:59 PM, Sean DiZazzo wrote: On Friday, June 2, 2017 at 10:46:03 AM UTC-7, bob gailer wrote: On 6/2/2017 1:28 PM, Jussi Piitulainen wrote:

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Larry Martell
On Thu, Jun 15, 2017 at 8:56 AM, Mark Summerfield via Python-list wrote: > On Thursday, June 15, 2017 at 1:47:00 PM UTC+1, larry@gmail.com wrote: >> I am trying to use sqlite >> >> $ python2.7 >> Python 2.7.10 (default, Feb 22 2016, 12:13:36) >> [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux

Re: [gettext] How to change language at run-time

2017-06-15 Thread Peter Otten
pozz wrote: > I know I can load multiple gettext.translation: > >it = gettext.translation('test', localedir="locale", languages=["it"]) >es = gettext.translation('test', localedir="locale", languages=["es"]) > > and install one translation at run-time when I want at a later time > (when

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Mark Summerfield via Python-list
On Thursday, June 15, 2017 at 1:47:00 PM UTC+1, larry@gmail.com wrote: > I am trying to use sqlite > > $ python2.7 > Python 2.7.10 (default, Feb 22 2016, 12:13:36) > [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>

Re: data structure

2017-06-15 Thread Andrew Zyman
Paul Thank you. In my case all "members" of a data structure are classes (except of the id). I showed the classes to highlight the requirement to access their methods as vs simple data types. I think dict of lists should work. Ideally , I hoped to access by name ( vs index), but list will do for n

sqlite in 2.7 on redhat 6

2017-06-15 Thread Larry Martell
I am trying to use sqlite $ python2.7 Python 2.7.10 (default, Feb 22 2016, 12:13:36) [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import _sqlite3 Traceback (most recent call last): File "", line 1, in ImportError: N

Re: [OT] is JSON all that great? - was Re: API Help

2017-06-15 Thread Chris Angelico
On Thu, Jun 15, 2017 at 9:47 PM, Rhodri James wrote: >> 1) It is not secure. Check this out: >> https://stackoverflow.com/questions/1906927/xml-vulnerabilities#1907500 > XML and JSON share the vulnerabilities that come from having to parse > untrusted external input. XML then has some extra since

Re: API Help

2017-06-15 Thread Bradley Cooper
On Wednesday, June 14, 2017 at 6:10:55 PM UTC-4, Andre Müller wrote: > Am 14.06.2017 um 22:33 schrieb Bradley Cooper: > > I am working with an API and I get a return response in this format. > > > > > > [{"itemNumber":"75-5044","inventory":[{"warehouseCode":"UT-1-US","quantityAvailable":0.000

Re: [OT] is JSON all that great? - was Re: API Help

2017-06-15 Thread Rhodri James
People seem to be having fun bashing XML, so I thought I'd wade in on its behalf. On 15/06/17 03:46, justin walters wrote: There are 2 main issues with XML: 1) It is not secure. Check this out: https://stackoverflow.com/questions/1906927/xml-vulnerabilities#1907500 XML and JSON share the vul

[gettext] How to change language at run-time

2017-06-15 Thread pozz
I know I can load multiple gettext.translation: it = gettext.translation('test', localedir="locale", languages=["it"]) es = gettext.translation('test', localedir="locale", languages=["es"]) and install one translation at run-time when I want at a later time (when the user selects a new lang

Ciphers in SSL Library

2017-06-15 Thread Kacy Night
OS: Windows 7 Home Basic Python: ver. 3.6.0 Hey, I need to use SSLv3 with RC4-SHA (0x05) (Yes I know those are unsecured) but my client is using it and I'm writing a server from scratch in Python. My problem is following, when I try to select cipher it doesn't raise any error, but when client tri

Re: Does Python need Javascript?

2017-06-15 Thread Gregory Ewing
Chris Angelico wrote: There've been a number of attempts, over the years, to make a sandboxed Python interpreter, where you can run untrusted code. But if Python came with a JS interpreter, it would be possible to run untrusted JS code, with Python functioning as a gatekeeper. If that would pro

Re: sqlite3 is non-transactional??

2017-06-15 Thread Mark Summerfield via Python-list
On Thursday, June 15, 2017 at 9:50:18 AM UTC+1, Michele Simionato wrote: > Thanks. I suspected the culprit was executescript, but I did not see it > documented in > https://docs.python.org/3/library/sqlite3.html#connection-objects. Although the standard library's sqlite3 module is useful, person

Re: sqlite3 is non-transactional??

2017-06-15 Thread Michele Simionato
Thanks. I suspected the culprit was executescript, but I did not see it documented in https://docs.python.org/3/library/sqlite3.html#connection-objects. -- https://mail.python.org/mailman/listinfo/python-list

Re: sqlite3 is non-transactional??

2017-06-15 Thread Peter Otten
Michele Simionato wrote: > I know that CREATE queries are non-transactional in sqlite, as documented, > but I finding something really strange in INSERT queries. > > Consider this example: > > $ cat example.py > import os > import shutil > import sqlite3 > > script0 = '''\ > CREATE TABLE test (

Re: Does Python need Javascript?

2017-06-15 Thread Steven D'Aprano
On Thu, 15 Jun 2017 17:42:12 +1000, Chris Angelico wrote: > Load up PyPyJS and run Python inside JavaScript inside Python. I'm reminded of a demo I saw once, of a BeOS system running a classic Mac emulator (sheepshaver, I believe it was), then running a Windows emulator inside the Mac emulato

Re: Does Python need Javascript?

2017-06-15 Thread Chris Angelico
On Thu, Jun 15, 2017 at 5:14 PM, Steven D'Aprano wrote: > Now that Java 8 includes a Javascript interpreter (Nashorn) as part of > the JDK, and since Javascript is The Future™, does Python need a > Javascript interpreter in the standard library? > > If Python came with a Javascript interpreter, wh

Re: API Help

2017-06-15 Thread Erik
On 15/06/17 01:30, Ray Cote wrote: On Wed, Jun 14, 2017 at 6:14 PM, Erik > wrote: If that makes it definitely JSON, then this makes it definitely Python ;) : >>> [{"itemNumber":"75-5044","inventory":[{"warehouseCode":"UT-1-US","quantityAvailable

sqlite3 is non-transactional??

2017-06-15 Thread Michele Simionato
I know that CREATE queries are non-transactional in sqlite, as documented, but I finding something really strange in INSERT queries. Consider this example: $ cat example.py import os import shutil import sqlite3 script0 = '''\ CREATE TABLE test ( id SERIAL PRIMARY KEY, description TEXT NO

Re: Does Python need Javascript?

2017-06-15 Thread Paul Barry
Life is too short... 😉 On 15 Jun 2017 08:17, "Steven D'Aprano" wrote: Now that Java 8 includes a Javascript interpreter (Nashorn) as part of the JDK, and since Javascript is The Future™, does Python need a Javascript interpreter in the standard library? If Python came with a Javascript interpre

Re: Does Python need Javascript?

2017-06-15 Thread Chris Angelico
On Thu, Jun 15, 2017 at 5:14 PM, Steven D'Aprano wrote: > Now that Java 8 includes a Javascript interpreter (Nashorn) as part of > the JDK, and since Javascript is The Future™, does Python need a > Javascript interpreter in the standard library? > > If Python came with a Javascript interpreter, wh

Does Python need Javascript?

2017-06-15 Thread Steven D'Aprano
Now that Java 8 includes a Javascript interpreter (Nashorn) as part of the JDK, and since Javascript is The Future™, does Python need a Javascript interpreter in the standard library? If Python came with a Javascript interpreter, what would you do with it? (Serious question, but humorous answ

Re: data structure

2017-06-15 Thread Paul Barry
Hi Andrew. You start by talking about a data structure, then show code that uses "class". Not everything in Python needs to be in a class. I'd look at using a simple Dictionary of lists, indexed on your ID. A list can contain anything, so you can add your objects in there dynamically as needed.