Re: Pyvenv puts both Python 2 and Python 3 in the same environment. Shocked!

2016-12-20 Thread Paul Rudin
Malik Rumi writes: > I just created a new venv using pyvenv from a 2.7 install. Now I am shocked to > see that I can get both 2.7 and 3.4 in this same venv: > > (memory) malikarumi@Tetuoan2:~/Projects/cannon/New2.7Projects/memory$ python > Python 2.7.12 (default, Nov 19 2016, 06:48:10) > [GCC 5.

Re: topology rules in python

2016-12-20 Thread Bernd Nawothnig
On 2016-12-20, Xristos Xristoou wrote: > I have a PostGIS database with shapefiles lines, polygons and points > and I want to create a topology rules with python. Any idea how to do > that ?some packages ? http://www.gdal.org/ or: pip install gdal Bernd -- no time toulouse -- https://mail

Re: Pyvenv puts both Python 2 and Python 3 in the same environment. Shocked!

2016-12-20 Thread Cameron Simpson
On 20Dec2016 18:37, Malik Rumi wrote: I just created a new venv using pyvenv from a 2.7 install. Now I am shocked to see that I can get both 2.7 and 3.4 in this same venv: (memory) malikarumi@Tetuoan2:~/Projects/cannon/New2.7Projects/memory$ python Python 2.7.12 (default, Nov 19 2016, 06:48:10

Re: Pyvenv puts both Python 2 and Python 3 in the same environment. Shocked!

2016-12-20 Thread Steven D'Aprano
On Wednesday 21 December 2016 13:37, Malik Rumi wrote: > I just created a new venv using pyvenv from a 2.7 install. Now I am shocked > to see that I can get both 2.7 and 3.4 in this same venv: I'm not an expert on pyvenv, but my guess is this: Would you expect a command like "ls" or "grep" to co

Pyvenv puts both Python 2 and Python 3 in the same environment. Shocked!

2016-12-20 Thread Malik Rumi
I just created a new venv using pyvenv from a 2.7 install. Now I am shocked to see that I can get both 2.7 and 3.4 in this same venv: (memory) malikarumi@Tetuoan2:~/Projects/cannon/New2.7Projects/memory$ python Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609] on linux2 Type "h

Re: Metaclasses - magic functions

2016-12-20 Thread Ethan Furman
On 12/20/2016 03:39 PM, Ben Finney wrote: "Mr. Wrobel" writes: Quick question, can anybody tell me when to use __init__ instead of __new__ in meta programming? Use ‘__new__’ to do the work of *creating* one instance from nothing; allocating the storage, determining the type, etc. — anything

Re: Metaclasses - magic functions

2016-12-20 Thread Ethan Furman
On 12/20/2016 03:26 PM, Ian Kelly wrote: ... The latter is interesting mostly because it allows you to set the __slots__ or do something interesting with the __prepare__ hook (although the only interesting thing I've ever seen done with __prepare__ is to use an OrderedDict to preserve the the de

Re: Metaclasses - magic functions

2016-12-20 Thread Ben Finney
"Mr. Wrobel" writes: > Quick question, can anybody tell me when to use __init__ instead of > __new__ in meta programming? Use ‘__new__’ to do the work of *creating* one instance from nothing; allocating the storage, determining the type, etc. — anything that will be *the same* for every instance

Re: Metaclasses - magic functions

2016-12-20 Thread Ian Kelly
On Tue, Dec 20, 2016 at 2:04 PM, Mr. Wrobel wrote: > Hi, > > Quick question, can anybody tell me when to use __init__ instead of __new__ > in meta programming? > > I see that __new__ can be used mostly when I want to manipulate with class > variables that are stored into dictionary. > > But when t

topology rules in python

2016-12-20 Thread Xristos Xristoou
I have a PostGIS database with shapefiles lines, polygons and points and I want to create a topology rules with python. Any idea how to do that ?some packages ? I like some easy way to do that because I am newbie but its OK. Some topology rules when I want. shapefile must not have gaps shapefile

Metaclasses - magic functions

2016-12-20 Thread Mr. Wrobel
Hi, Quick question, can anybody tell me when to use __init__ instead of __new__ in meta programming? I see that __new__ can be used mostly when I want to manipulate with class variables that are stored into dictionary. But when to use __init__? Any example? Thanx, M -- https://mail.python.

windows utf8 & lxml

2016-12-20 Thread Sayth Renshaw
Possibly i will have to use a different method from lxml like this. http://stackoverflow.com/a/29057244/461887 Sayth -- https://mail.python.org/mailman/listinfo/python-list

Re: ImportError: The ``fake-factory`` package is now called ``Faker``.

2016-12-20 Thread William Mayor
I came across this error this morning. In my case I was running a script that did this: “pip install fake-factory” The install worked properly but then I couldn’t import the library (with the same error message as you). I had to update the pip install command to say “pip install Faker” and then

ImportError: The ``fake-factory`` package is now called ``Faker``.

2016-12-20 Thread Uri Even-Chen
Hi, we get this error with Python 3.4 and 3.5: https://travis-ci.org/urievenchen/speedy-net/jobs/185497863 -- ImportError: Failed to import test module: speedy.net.accounts.tests.test_factories Traceback (most recent call last)

Re: Geting error using python 3.5 : a_token = r.json() mention below

2016-12-20 Thread Ned Batchelder
On Tuesday, December 20, 2016 at 7:28:47 AM UTC-5, Akbar Shaikh wrote: > import io > import csv > import glob > import os.path > import requests > import subprocess > import urllib.request > import json > import time > import xlwt > import xlrd > import datetime > from datetime import date, timedel

Geting error using python 3.5 : a_token = r.json() mention below

2016-12-20 Thread Akbar Shaikh
import io import csv import glob import os.path import requests import subprocess import urllib.request import json import time import xlwt import xlrd import datetime from datetime import date, timedelta def main(): """ Run the whole toolchain for all accounts. """ _clean()

Re: Can't see numpy etc after upgrading Python on Ubuntu

2016-12-20 Thread ozpeterballard
OK thanks both of you. I didn't realise there was a distinction between system python and other (user/personal) python. Yes, python2.7.3 is still there in /usr/bin/python . /usr/bin/python appears to be getting numpy and scipy from /usr/lib/python2.7/dist-packages . So I added that to PYTHONPAT

windows utf8 & lxml

2016-12-20 Thread Sayth Renshaw
Hi I have been trying to get a script to work on windows that works on mint. The key blocker has been utf8 errors, most of which I have solved. Now however the last error I am trying to overcome, the solution appears to be to use the .decode('windows-1252') to correct an ascii error. I am usi

Re: python list index - an easy question

2016-12-20 Thread BartC
On 20/12/2016 00:49, Steve D'Aprano wrote: On Mon, 19 Dec 2016 03:21 am, BartC wrote: On 18/12/2016 10:59, Paul Götze wrote: Hi John, there is a nice short article by E. W. Dijkstra about why it makes sense to start numbering at zero (and exclude the upper given bound) while slicing a list. M

Re: Can't see numpy etc after upgrading Python on Ubuntu

2016-12-20 Thread Chris Angelico
On Tue, Dec 20, 2016 at 8:28 PM, Vincent Vande Vyvre wrote: >>> The link /usr/bin/python *MUST* point to the 2.7.3 version, if not, >>> restore >>> it. >> >> It does. When he installs pip via apt, it manages his original 2.7.3. >> Anything that explicitly shebangs to /usr/bin/python will be >> una

Re: Can't see numpy etc after upgrading Python on Ubuntu

2016-12-20 Thread Vincent Vande Vyvre
Le 20/12/16 à 10:13, Chris Angelico a écrit : On Tue, Dec 20, 2016 at 7:36 PM, Vincent Vande Vyvre wrote: It seems you have shadowed your default python2 with the new one. A very bad idea. Only because /usr/local/bin is ahead of /usr/bin in PATH. That's the problem. The link /usr/bin/pytho

Re: Can't see numpy etc after upgrading Python on Ubuntu

2016-12-20 Thread Chris Angelico
On Tue, Dec 20, 2016 at 7:36 PM, Vincent Vande Vyvre wrote: > It seems you have shadowed your default python2 with the new one. A very bad > idea. Only because /usr/local/bin is ahead of /usr/bin in PATH. > The link /usr/bin/python *MUST* point to the 2.7.3 version, if not, restore > it. It doe

Re: Can't see numpy etc after upgrading Python on Ubuntu

2016-12-20 Thread Vincent Vande Vyvre
Le 20/12/16 à 08:45, Chris Angelico a écrit : On Tue, Dec 20, 2016 at 5:19 PM, wrote: Thanks Chris for replying, but it didn't work. The upgrade happened, but still python can't see numpy! So it seems to be a path problem. The numpy (and scipy and matplotlib) files are there, so surely in pr