'Swampy' installation through 'pip'

2014-05-20 Thread Ronak Dhakan
I have just started learning python from How to Think Like a Computer 
Scientist. It requires me to install 'swampy'   
(http://www.greenteapress.com/thinkpython/swampy/install.html)   which requires 
me to install 'pip'   (https://pip.pypa.io/en/latest/installing.html).   I 
think I was able to somehow install pip, but am unable to install swampy.

When i run   'pip install swampy'   in windows command prompt, I get an error:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Ronak>E:

E:\>pip install swampy
Fatal error in launcher: Unable to create process using '""E:\Program Files\Pyth
on 2.7.6\pythonw.exe"" "E:\Program Files\Python 2.7.6\Scripts\pip.exe" install s
wampy'

When I run   'pip install swampy'   in IDLE (Python 2.7.6 Shell), I get the 
following error:

Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on 
win32
Type "copyright", "credits" or "license()" for more information.
>>> pip install swampy
SyntaxError: invalid syntax
>>> 

with the word install highlighted in red.

I have installed pip by opening it in IDLE & running it from there. A new 
folder   'Scripts'   was created in the Python installation directory   
'E:\Program Files\Python 2.7.6'   with the following files:

easy_install-2.7.exe
easy_install.exe
pip2.7.exe
pip2.exe
pip.exe

I have added   'E:\Program Files\Python 2.7.6'   &   'E:\Program Files\Python 
2.7.6\Scripts'   to the   'path'   variable in Environment Variables in Windows.

I have added   'E:\Program Files\Python 2.7.6\Scripts'   to the   'PYTHONPATH'  
 variable in Environment Variables in Windows.

I have read a lot online trying to get it work, but now I am lost in the 
technical jargons. I might have missed some steps or done something incorrectly.

Please let me know where I went wrong or guide me on how to install swampy.

Thanks.

Ronak.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem in writing demands to the xml file

2014-05-20 Thread varun7rs
There is no traceback error. But I want to actually fill the demands with 
certain attributes which I'm not able to do. When I run the program, the xml is 
written but the demands doesn't have any attributes whatsoever. I could give 
you a clear idea of what I expect in the demands. For every node, I have an 
attribute called totaldemands which takes a value between 1 and 5. Now, I need 
the same no. of demands being written onto the xml file below every node which 
is now empty

totaldemands = random.randint(1, 5)
demnum = 0
for demand in range(totaldemands):
demnum = demnum + 1
PoPbdw = random.uniform(2, 2.5)
PoPstor = random.uniform(2, 2.5)
PoPpro = random.uniform(0.5, 1)
MMEbdw = random.uniform(2, 2.5)
MMEstor = random.uniform(2, 3)
MMEpro = random.uniform(0.5, 1)
IMSbdw = random.uniform(2.5, 3)
IMSstor = random.uniform(2.5, 3.5)
IMSpro = random.uniform(0.5, 1)
SGWbdw = random.uniform(3, 3.5)
SGWstor = random.uniform(2.5, 3.5)
SGWpro = random.uniform(0.5, 1)
PGWbdw = random.uniform(2.5, 3.5)
PGWstor = random.uniform(2, 2.5)
PGWpro = random.uniform(0.5, 1)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and Math

2014-05-20 Thread wxjmfauth
Le lundi 19 mai 2014 21:18:54 UTC+2, Tim Golden a écrit :
> On 19/05/2014 20:07, wxjmfa...@gmail.com wrote:
> 
> >>> Yesterday, I spent one hour attemepting to install IPython
> 
> >>
> 
> >>> for Py3.3 (win 7), I failed. I do not even succeed to
> 
> >>
> 
> >>> understand how. Pip, setuptools, whl or manualy with from the
> 
> >>
> 
> >>> zip... completely lost. There is always something not working.
> 
> >>
> 
> >>
> 
> >>
> 
> >>> This morning I installed Py 3.4.1. I do not even
> 
> >>
> 
> >>> succeed to put it to work.
> 
> 
> 
> 
> 
> I realise that this probably isn't very helpful, but I've just 
> 
> successfully installed ipython on Python 3.3 and Python 3.4 (Win7 
> 
> 32-bit) by simply doing:
> 
> 
> 
> py -3.3 -mpip install ipython
> 
> 
> 
> py -3.4 -mpip install ipython
> 
> 
> 
> Since I don't have the various c:\pythonxx\scripts folders on my path, I 
> 
> did then have to launch it explictly:
> 
> 
> 
> c:\python33\scripts\ipython
> 
> 
> 
> but it was no harder than that.
> 
> 
 Sorry, but I'm even not able to understand how
to install pip!
Py3.3, why? because I already all the Qt derivative.

I found the pip manual, I do not get it! To install
pip: To install or upgrade pip, securely download get-pip.py.
Where? What should I do with it?



It seems you
have to
install 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and Math

2014-05-20 Thread Tim Golden
On 20/05/2014 10:19, wxjmfa...@gmail.com wrote:
> Le lundi 19 mai 2014 21:18:54 UTC+2, Tim Golden a écrit :
>> On 19/05/2014 20:07, wxjmfa...@gmail.com wrote:
>> 
> Yesterday, I spent one hour attemepting to install IPython
> for Py3.3 (win 7), I failed. I do not even succeed to
> understand how. Pip, setuptools, whl or manualy with from
> the
> zip... completely lost. There is always something not
> working.

>> 
> This morning I installed Py 3.4.1. I do not even
> succeed to put it to work.
>> 
>> I realise that this probably isn't very helpful, but I've just
>> successfully installed ipython on Python 3.3 and Python 3.4 (Win7
>> 32-bit) by simply doing:
>> 
>> py -3.3 -mpip install ipython
>> 
>> py -3.4 -mpip install ipython
>> 
>> 
>> 
> Sorry, but I'm even not able to understand how to install pip! Py3.3,
> why? because I already all the Qt derivative.
> 
> I found the pip manual, I do not get it! To install pip: To install
> or upgrade pip, securely download get-pip.py. Where? What should I do
> with it?

Ah, I understand. I thought you already had pip and just had
difficulties beyond that. Frankly, yes, bootstrapping pip on Windows can
be a bit frustrating. That's why 3.4 comes with a version pre-installed.
But you say you want to stay with 3.3.

If it's possible, download get-pip.py from here:

https://bootstrap.pypa.io/get-pip.py

(linked from here: http://pip.readthedocs.org/en/latest/installing.html)

using wget, curl, File Save As, python requests, urllib.urlretrieve or
whatever other method you choose.

And then run the get-pip.py program with the version of Python for which
you wish to install pip. eg,

c:\python33\python.exe get-pip.py

That will download the current versions of everything needed and will
put various flavours of pip.exe into c:\python33\scripts. As I mentioned
before, I've tended not to have the scripts directory on my path, and
you can instead do:

py -3.3 -mpip install 


I think some people have put together .msi/.exe installers for this but
I can't point to any one in particular.

TJG
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and Math

2014-05-20 Thread Rustom Mody
On Tuesday, May 20, 2014 3:43:45 PM UTC+5:30, Tim Golden wrote:
> If it's possible, download get-pip.py from here:
> 
> https://bootstrap.pypa.io/get-pip.py

Gives me secure connection failed error (in firefox)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and Math

2014-05-20 Thread Tim Golden
On 20/05/2014 12:20, Rustom Mody wrote:
> On Tuesday, May 20, 2014 3:43:45 PM UTC+5:30, Tim Golden wrote:
>> If it's possible, download get-pip.py from here:
>>
>> https://bootstrap.pypa.io/get-pip.py
> 
> Gives me secure connection failed error (in firefox)
> 

I've reported on the PyPA issues list for pip:

https://github.com/pypa/pip/issues/1823

but, as you can see from that report, I was only able to get a failure
in one circumstance. I can successfully download via FF29, IE11 & chrome
whatever, all on Win7.

TJG
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Copying files from sub folders under source directories into sub folders with same names as source directory sub folders in destination directories without overwriting already existing files of sa

2014-05-20 Thread Satish ML
On Tuesday, May 20, 2014 5:51:19 PM UTC+5:30, Satish ML wrote:
> On Tuesday, May 20, 2014 11:27:01 AM UTC+5:30, Rustom Mody wrote: > On 
> Monday, May 19, 2014 2:32:36 PM UTC+5:30, Satish ML wrote: > On Monday, May 
> 19, 2014 12:31:05 PM UTC+5:30, Chris Angelico wrote: > > On Mon, May 19, 2014 
> at 4:53 PM, wrote: > Could you kindly help? Sure. Either start writing code 
> and then post when you have problems, or investigate some shell commands 
> (xcopy in Windows, cp in Linux, maybe scp) that can probably do the whole 
> job. Or pay someone to do the job for you. ChrisA > Hi ChrisAngelico, > 
> Consider that source and destination directories are given in a .xls(excel) 
> file. > This is the code > import xlrd, sys, subprocess > file_location = 
> "C:\Users\salingeg\Desktop\input.xls" > workbook = 
> xlrd.open_workbook(file_location) > sheet = workbook.sheet_by_index(0) > 
> sheet.cell_value(0, 0) > for row in range(sheet.nrows): > values = [] > 
> values.append(sheet.cell_value(row, 1)) > destination = [] > 
> destination.append(sheet.cell_value(row, 2)) > for s in values: > for
  d in destination: > If I am using cp or xcopy command, it will copy all files 
from s to d. > shutil.copy(s, d) can't be used here because it overwrites files 
in d. Kindly help. have u tried using 
https://docs.python.org/2/library/os.path.html#os.path.exists ? I have tried 
it. But how does it help? We won't be able to make out whether source file is 
present in destination directory.

If we can do that, like

if (source file exists in destination directory)
print "exists"
else
shutil.copy(s, d)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Copying files from sub folders under source directories into sub folders with same names as source directory sub folders in destination directories without overwriting already existing files of sa

2014-05-20 Thread Satish ML
On Tuesday, May 20, 2014 11:27:01 AM UTC+5:30, Rustom Mody wrote:
> On Monday, May 19, 2014 2:32:36 PM UTC+5:30, Satish ML wrote: > On Monday, 
> May 19, 2014 12:31:05 PM UTC+5:30, Chris Angelico wrote: > > On Mon, May 19, 
> 2014 at 4:53 PM, wrote: > Could you kindly help? Sure. Either start writing 
> code and then post when you have problems, or investigate some shell commands 
> (xcopy in Windows, cp in Linux, maybe scp) that can probably do the whole 
> job. Or pay someone to do the job for you. ChrisA > Hi ChrisAngelico, > 
> Consider that source and destination directories are given in a .xls(excel) 
> file. > This is the code > import xlrd, sys, subprocess > file_location = 
> "C:\Users\salingeg\Desktop\input.xls" > workbook = 
> xlrd.open_workbook(file_location) > sheet = workbook.sheet_by_index(0) > 
> sheet.cell_value(0, 0) > for row in range(sheet.nrows): > values = [] > 
> values.append(sheet.cell_value(row, 1)) > destination = [] > 
> destination.append(sheet.cell_value(row, 2)) > for s in values: > for d in 
> destination: > If I am using cp or xcopy command, it will copy
  all files from s to d. > shutil.copy(s, d) can't be used here because it 
overwrites files in d. Kindly help. have u tried using 
https://docs.python.org/2/library/os.path.html#os.path.exists ?

I have tried it. But how does it help?

We won't be able to make out whether source file is present in destination 
directory.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Copying files from sub folders under source directories into sub folders with same names as source directory sub folders in destination directories without overwriting already existing files of sa

2014-05-20 Thread Satish ML
On Tuesday, May 20, 2014 5:51:19 PM UTC+5:30, Satish ML wrote:
> On Tuesday, May 20, 2014 11:27:01 AM UTC+5:30, Rustom Mody wrote: > On 
> Monday, May 19, 2014 2:32:36 PM UTC+5:30, Satish ML wrote: > On Monday, May 
> 19, 2014 12:31:05 PM UTC+5:30, Chris Angelico wrote: > > On Mon, May 19, 2014 
> at 4:53 PM, wrote: > Could you kindly help? Sure. Either start writing code 
> and then post when you have problems, or investigate some shell commands 
> (xcopy in Windows, cp in Linux, maybe scp) that can probably do the whole 
> job. Or pay someone to do the job for you. ChrisA > Hi ChrisAngelico, > 
> Consider that source and destination directories are given in a .xls(excel) 
> file. > This is the code > import xlrd, sys, subprocess > file_location = 
> "C:\Users\salingeg\Desktop\input.xls" > workbook = 
> xlrd.open_workbook(file_location) > sheet = workbook.sheet_by_index(0) > 
> sheet.cell_value(0, 0) > for row in range(sheet.nrows): > values = [] > 
> values.append(sheet.cell_value(row, 1)) > destination = [] > 
> destination.append(sheet.cell_value(row, 2)) > for s in values: > for
  d in destination: > If I am using cp or xcopy command, it will copy all files 
from s to d. > shutil.copy(s, d) can't be used here because it overwrites files 
in d. Kindly help. have u tried using 
https://docs.python.org/2/library/os.path.html#os.path.exists ? I have tried 
it. But how does it help? We won't be able to make out whether source file is 
present in destination directory.

If we can do that, like 

if (source file exists in destination directory) 
 print "exists" 
 continue
else 
 shutil.copy(s, d) 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Copying files from sub folders under source directories into sub folders with same names as source directory sub folders in destination directories without overwriting already existing files of sa

2014-05-20 Thread Satish ML
On Tuesday, May 20, 2014 5:54:47 PM UTC+5:30, Satish ML wrote:
> On Tuesday, May 20, 2014 5:51:19 PM UTC+5:30, Satish ML wrote: > On Tuesday, 
> May 20, 2014 11:27:01 AM UTC+5:30, Rustom Mody wrote: > On Monday, May 19, 
> 2014 2:32:36 PM UTC+5:30, Satish ML wrote: > On Monday, May 19, 2014 12:31:05 
> PM UTC+5:30, Chris Angelico wrote: > > On Mon, May 19, 2014 at 4:53 PM, 
> wrote: > Could you kindly help? Sure. Either start writing code and then post 
> when you have problems, or investigate some shell commands (xcopy in Windows, 
> cp in Linux, maybe scp) that can probably do the whole job. Or pay someone to 
> do the job for you. ChrisA > Hi ChrisAngelico, > Consider that source and 
> destination directories are given in a .xls(excel) file. > This is the code > 
> import xlrd, sys, subprocess > file_location = 
> "C:\Users\salingeg\Desktop\input.xls" > workbook = 
> xlrd.open_workbook(file_location) > sheet = workbook.sheet_by_index(0) > 
> sheet.cell_value(0, 0) > for row in range(sheet.nrows): > values = [] > 
> values.append(sheet.cell_value(row, 1)) > destination = [] > dest
 ination.append(sheet.cell_value(row, 2)) > for s in values: > for d in 
destination: > If I am using cp or xcopy command, it will copy all files from s 
to d. > shutil.copy(s, d) can't be used here because it overwrites files in d. 
Kindly help. have u tried using 
https://docs.python.org/2/library/os.path.html#os.path.exists ? I have tried 
it. But how does it help? We won't be able to make out whether source file is 
present in destination directory. If we can do that, like if (source file 
exists in destination directory) print "exists" continue else shutil.copy(s, d)

Here we don't have the option of manually giving the file path. It has to be 
read from .xls file (i.e. from the two lists in code)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Copying files from sub folders under source directories into sub folders with same names as source directory sub folders in destination directories without overwriting already existing files of sa

2014-05-20 Thread alister
On Tue, 20 May 2014 05:28:09 -0700, Satish ML wrote:

> On Tuesday, May 20, 2014 5:54:47 PM UTC+5:30, Satish ML wrote:
>> On Tuesday, May 20, 2014 5:51:19 PM UTC+5:30, Satish ML wrote: > On
>> Tuesday, May 20, 2014 11:27:01 AM UTC+5:30, Rustom Mody wrote: > On
>> Monday, May 19, 2014 2:32:36 PM UTC+5:30, Satish ML wrote: > On Monday,
>> May 19, 2014 12:31:05 PM UTC+5:30, Chris Angelico wrote: > > On Mon,
>> May 19, 2014 at 4:53 PM, wrote: > Could you kindly help? Sure. Either
>> start writing code and then post when you have problems, or investigate
>> some shell commands (xcopy in Windows, cp in Linux, maybe scp) that can
>> probably do the whole job. Or pay someone to do the job for you. ChrisA
>> > Hi ChrisAngelico, > Consider that source and destination directories
>> are given in a .xls(excel) file. > This is the code > import xlrd, sys,
>> subprocess > file_location = "C:\Users\salingeg\Desktop\input.xls" >
>> workbook = xlrd.open_workbook(file_location) > sheet =
>> workbook.sheet_by_index(0) > sheet.cell_value(0, 0) > for row in
>> range(sheet.nrows): > values = [] > values.append(sheet.cell_value(row,
>> 1)) > destination = [] > destination.append(sheet.cell_value(row, 2)) >
>> for s in values: > for d in destination: > If I am using cp or xcopy
>> command, it will copy all files from s to d. > shutil.copy(s, d) can't
>> be used here because it overwrites files in d. Kindly help. have u
>> tried using
>> https://docs.python.org/2/library/os.path.html#os.path.exists ? I have
>> tried it. But how does it help? We won't be able to make out whether
>> source file is present in destination directory. If we can do that,
>> like if (source file exists in destination directory) print "exists"
>> continue else shutil.copy(s, d)
> 
> Here we don't have the option of manually giving the file path. It has
> to be read from .xls file (i.e. from the two lists in code)

1) Post your current code & any errors you are getting, this list is not 
a free software development house

2) Please clean up your posts before sending so that they are readable



either use the mailing list 
https://mail.python.org/mailman/listinfo/python-list or read and action 
this https://wiki.python.org/moin/GoogleGroupsPython to prevent us 
seeing double line spacing and single line paragraphs, thanks.

Thanks to Mark for the above paragraph I hope this is "Acceptable Usage" 
& not a copyright breach ;-)
-- 
My weight is perfect for my height -- which varies.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and Math

2014-05-20 Thread Frank Millman

"Tim Golden"  wrote in message 
news:537b42bc.3030...@timgolden.me.uk...
> On 20/05/2014 12:20, Rustom Mody wrote:
>> On Tuesday, May 20, 2014 3:43:45 PM UTC+5:30, Tim Golden wrote:
>>> If it's possible, download get-pip.py from here:
>>>
>>> https://bootstrap.pypa.io/get-pip.py
>>
>> Gives me secure connection failed error (in firefox)
>>
>
> I've reported on the PyPA issues list for pip:
>
> https://github.com/pypa/pip/issues/1823
>
> but, as you can see from that report, I was only able to get a failure
> in one circumstance. I can successfully download via FF29, IE11 & chrome
> whatever, all on Win7.
>

I have never managed to install pip before (not that I have tried very hard) 
but following
your instructions I seemed to have installed it successfully, using Windows 
Server 2003,
IE8, and python 3.3.

I used it to install IPython, with the following results.

First I ran 'pip install ipython', which worked.

Then I read the IPython docs, which gave the following command to install 
Notebook -
'pip install ipython[notebook]'

That seemed to work, but when I ran 'ipython notebook' it failed on 'import 
pyzmq'.

I ran 'pip install pyzmq', tried again, and it failed on 'import jinja2'.

I used pip to install that, then it failed on 'import tornado'.

I used pip to install that, and now it seems to be working.

Now I understand why 'pip' is so popular - despite the above hiccups, it 
felt very smooth.

Thanks for the instructions, Tim - much appreciated.

Frank Millman



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: 'Swampy' installation through 'pip'

2014-05-20 Thread Mark Lawrence

On 20/05/2014 08:11, Ronak Dhakan wrote:

I have just started learning python from How to Think Like a Computer 
Scientist. It requires me to install 'swampy'   
(http://www.greenteapress.com/thinkpython/swampy/install.html)   which requires 
me to install 'pip'   (https://pip.pypa.io/en/latest/installing.html).   I 
think I was able to somehow install pip, but am unable to install swampy.

When i run   'pip install swampy'   in windows command prompt, I get an error:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Ronak>E:

E:\>pip install swampy
Fatal error in launcher: Unable to create process using '""E:\Program Files\Pyth
on 2.7.6\pythonw.exe"" "E:\Program Files\Python 2.7.6\Scripts\pip.exe" install s
wampy'



Your setup looks wrong, surely that should be python.exe, not pythonw.exe.

I'd recommend reinstalling and use the default settings, putting Python 
at the top level of the disk and not in "Program Files", that's another 
set of potential set of problems eliminated straight away.


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


--
https://mail.python.org/mailman/listinfo/python-list


Re: 'Swampy' installation through 'pip'

2014-05-20 Thread Chris Angelico
On Tue, May 20, 2014 at 11:20 PM, Mark Lawrence  wrote:
> I'd recommend reinstalling and use the default settings, putting Python at
> the top level of the disk and not in "Program Files", that's another set of
> potential set of problems eliminated straight away.

Second this recommendation. I saw some NEWS entries recently regarding
pip and spaces in file names.

If you're on the absolute latest pip, it would quite possibly work,
but I don't know if that works with 2.7, and if so, with which 2.7.x.
Avoid spaces unless you're sure.

In fact, looking at the error messages, I suspect this isn't a
*potential* set of problems, but quite probably the actual problem.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and Math

2014-05-20 Thread wxjmfauth
Le mardi 20 mai 2014 12:13:45 UTC+2, Tim Golden a écrit :
> On 20/05/2014 10:19, wxjmfa...@gmail.com wrote:
> 
> > Le lundi 19 mai 2014 21:18:54 UTC+2, Tim Golden a �crit :
> 
> >> On 19/05/2014 20:07, wxjmfa...@gmail.com wrote:
> 
> >> 
> 
> > Yesterday, I spent one hour attemepting to install IPython
> 
> > for Py3.3 (win 7), I failed. I do not even succeed to
> 
> > understand how. Pip, setuptools, whl or manualy with from
> 
> > the
> 
> > zip... completely lost. There is always something not
> 
> > working.
> 
> 
> 
> >> 
> 
> > This morning I installed Py 3.4.1. I do not even
> 
> > succeed to put it to work.
> 
> >> 
> 
> >> I realise that this probably isn't very helpful, but I've just
> 
> >> successfully installed ipython on Python 3.3 and Python 3.4 (Win7
> 
> >> 32-bit) by simply doing:
> 
> >> 
> 
> >> py -3.3 -mpip install ipython
> 
> >> 
> 
> >> py -3.4 -mpip install ipython
> 
> >> 
> 
> >> 
> 
> >> 
> 
> > Sorry, but I'm even not able to understand how to install pip! Py3.3,
> 
> > why? because I already all the Qt derivative.
> 
> > 
> 
> > I found the pip manual, I do not get it! To install pip: To install
> 
> > or upgrade pip, securely download get-pip.py. Where? What should I do
> 
> > with it?
> 
> 
> 
> Ah, I understand. I thought you already had pip and just had
> 
> difficulties beyond that. Frankly, yes, bootstrapping pip on Windows can
> 
> be a bit frustrating. That's why 3.4 comes with a version pre-installed.
> 
> But you say you want to stay with 3.3.
> 
> 
> 
> If it's possible, download get-pip.py from here:
> 
> 
> 
> https://bootstrap.pypa.io/get-pip.py
> 
> 
> 
> (linked from here: http://pip.readthedocs.org/en/latest/installing.html)
> 
> 
> 
> using wget, curl, File Save As, python requests, urllib.urlretrieve or
> 
> whatever other method you choose.
> 
> 
> 
> And then run the get-pip.py program with the version of Python for which
> 
> you wish to install pip. eg,
> 
> 
> 
> c:\python33\python.exe get-pip.py
> 
> 
> 
> That will download the current versions of everything needed and will
> 
> put various flavours of pip.exe into c:\python33\scripts. As I mentioned
> 
> before, I've tended not to have the scripts directory on my path, and
> 
> you can instead do:
> 
> 
> 
> py -3.3 -mpip install 
> 
> 
> 
> 
> 
> I think some people have put together .msi/.exe installers for this but
> 
> I can't point to any one in particular.
> 
> 
> 
> TJG

--

I give up.
Anyway, thanks.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and Math

2014-05-20 Thread Rustom Mody
On Tuesday, May 20, 2014 5:25:40 PM UTC+5:30, Tim Golden wrote:
> On 20/05/2014 12:20, Rustom Mody wrote:
> 
> > On Tuesday, May 20, 2014 3:43:45 PM UTC+5:30, Tim Golden wrote:
> >> If it's possible, download get-pip.py from here:
> >>
> >> https://bootstrap.pypa.io/get-pip.py
> > 
> > Gives me secure connection failed error (in firefox)
> > 
> 
> 
> I've reported on the PyPA issues list for pip:
> 
> https://github.com/pypa/pip/issues/1823

Thanks

> 
> 
> 
> but, as you can see from that report, I was only able to get a failure
> 
> in one circumstance. I can successfully download via FF29, IE11 & chrome
> 
> whatever, all on Win7.

Seems to be working for me also (now).

[Without claiming any understanding]...

I dont know what wget has to do with it (in the bug report)
I just opened it in firefox: Earlier it didn't work now its working
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and Math

2014-05-20 Thread Rustom Mody
On Tuesday, May 20, 2014 7:12:19 PM UTC+5:30, jmf wrote:
> I give up.
> Anyway, thanks.


Take a deep breath.
Be patient.
And post the backtrace (or whatever is the evidence of 'not working')



-- 
https://mail.python.org/mailman/listinfo/python-list


Putting Py 3.4.1 to work.

2014-05-20 Thread wxjmfauth
Experimented users have certainly noticed a lot of
things have changed.

Short. I installed Py3.4.1, it overwrites c:\Python34 which
contained eg. PySide in ...\site-packages.

So far, so good. I can launch Python, IDLE and my interactive
interpreter I wrote with tkinter via a cmd in dos, .bat, ...

Now the questions. It seems all packages in \site-packages
are no more recognized.
What am I doing wrong? Why is "site-packages" no more
recognized, "forcing" sys.path does not seem to help.

>From my interactive interpreter:

>>> ---
import PySide
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named 'PySide'
>>> ---
sys.path
['D:\\jm\\jmpy\\smid\\smid50beta1', 'C:\\Windows\\system32\\python34.zip', 
'C:\\Python34\\DLLs\\DLLs', 'C:\\Python34\\DLLs\\lib', 'C:\\Python34\\DLLs', 
'C:\\Python34\\DLLs\\lib\\site-packages']
>>> ---
sys.path.append(r'C:\Python34\Lib\site-packages\PySide')
>>> ---
sys.path
['D:\\jm\\jmpy\\smid\\smid50beta1', 'C:\\Windows\\system32\\python34.zip', 
'C:\\Python34\\DLLs\\DLLs', 'C:\\Python34\\DLLs\\lib', 'C:\\Python34\\DLLs', 
'C:\\Python34\\DLLs\\lib\\site-packages', 
'C:\\Python34\\Lib\\site-packages\\PySide']
>>> ---
import PySide
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named 'PySide'
>>> ---
sys.version
'3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit (Intel)]'
>>> ---

jmf
-- 
https://mail.python.org/mailman/listinfo/python-list


Basic help

2014-05-20 Thread Pat Fourie
Good Day all.

I am new to Python. I need to maintain software written on Python 1.5.2. I
will upgrade after learning more.

My question is :

When compiling, the results of the compile is displayed in the "active
window". How can I view this window.

Many thanks for your assistance.

Kind regards

Pat


-- 
This message has been scanned for viruses and
dangerous content by Pinpoint, and is
believed to be clean.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: 'Swampy' installation through 'pip'

2014-05-20 Thread Ian Kelly
On May 20, 2014 7:22 AM, "Mark Lawrence"  wrote:
>
> On 20/05/2014 08:11, Ronak Dhakan wrote:
>>
>> I have just started learning python from How to Think Like a Computer
Scientist. It requires me to install 'swampy'   (
http://www.greenteapress.com/thinkpython/swampy/install.html)   which
requires me to install 'pip'   (
https://pip.pypa.io/en/latest/installing.html).   I think I was able to
somehow install pip, but am unable to install swampy.
>>
>> When i run   'pip install swampy'   in windows command prompt, I get an
error:
>>
>> Microsoft Windows XP [Version 5.1.2600]
>> (C) Copyright 1985-2001 Microsoft Corp.
>>
>> C:\Documents and Settings\Ronak>E:
>>
>> E:\>pip install swampy
>> Fatal error in launcher: Unable to create process using '""E:\Program
Files\Pyth
>> on 2.7.6\pythonw.exe"" "E:\Program Files\Python 2.7.6\Scripts\pip.exe"
install s
>> wampy'
>>
>
> Your setup looks wrong, surely that should be python.exe, not pythonw.exe.

I would bet that's a result of installing from IDLE. Recommend reinstalling
pip from the Windows command line.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Copying files from sub folders under source directories into sub folders with same names as source directory sub folders in destination directories without overwriting already existing files of sa

2014-05-20 Thread Jagadeesh Malakannavar
Hi Satish,

Can you please send python part in plain text format? Python code here is 
difficult to read.

Thanks

On Tue, 20 May 2014, Satish ML wrote:

| On Tuesday, May 20, 2014 5:54:47 PM UTC+5:30, Satish ML wrote:
| > On Tuesday, May 20, 2014 5:51:19 PM UTC+5:30, Satish ML wrote: > On 
Tuesday, May 20, 2014 11:27:01 AM UTC+5:30, Rustom Mody wrote: > On Monday, May 
19, 2014 2:32:36 PM UTC+5:30, Satish ML wrote: > On Monday, May 19, 2014 
12:31:05 PM UTC+5:30, Chris Angelico wrote: > > On Mon, May 19, 2014 at 4:53 
PM, wrote: > Could you kindly help? Sure. Either start writing code and then 
post when you have problems, or investigate some shell commands (xcopy in 
Windows, cp in Linux, maybe scp) that can probably do the whole job. Or pay 
someone to do the job for you. ChrisA > Hi ChrisAngelico, > Consider that 
source and destination directories are given in a .xls(excel) file. > This is 
the code > import xlrd, sys, subprocess > file_location = 
"C:\Users\salingeg\Desktop\input.xls" > workbook = 
xlrd.open_workbook(file_location) > sheet = workbook.sheet_by_index(0) > 
sheet.cell_value(0, 0) > for row in range(sheet.nrows): > values = [] > 
values.append(sheet.cell_value(row, 1)) > destination = [] > dest
|  ination.append(sheet.cell_value(row, 2)) > for s in values: > for d in 
destination: > If I am using cp or xcopy command, it will copy all files from s 
to d. > shutil.copy(s, d) can't be used here because it overwrites files in d. 
Kindly help. have u tried using 
https://docs.python.org/2/library/os.path.html#os.path.exists ? I have tried 
it. But how does it help? We won't be able to make out whether source file is 
present in destination directory. If we can do that, like if (source file 
exists in destination directory) print "exists" continue else shutil.copy(s, d)
| 
| Here we don't have the option of manually giving the file path. It has to be 
read from .xls file (i.e. from the two lists in code)
| -- 
https://mail.python.org/mailman/listinfo/python-list


Reading OpenOffice spreadsheet in Python?

2014-05-20 Thread Skip Montanaro
I don't have Windows and since upgrading my Mac to Mavericks I no
longer have Excel of any flavor. I have a few Excel spreadsheets in
which I store parameters from which I generate other config files. I
read those spreadsheets using xlrd.

I am so fed up with LibreOffice's inability to properly support really
basic Excel capabilities, I'm about ready to throw my computer out the
window. So, I'm looking for alternatives. Before someone suggests
config parser/Windows INI files... A spreadsheet format is kinda handy
in this case because I do use a few formulas to define some of the
parameters. Adding a new row (new config file) or column (new
parameter) is a breeze. The simplest solution would seem to be to
submit to LibreOffice's terror and just start saving my spreadsheets
in OpenDocument format. That then puts me in the market for an xlrd
replacement. Is there something akin to xlrd for OpenDocument
spreadsheets? I see a couple possibilities in PyPI (exodf, odfpy), but
none which have a really high weight (suggesting they are "category
killers").

I'm open to other options as well. I see a number of Google
spreadsheet modules, and there is pyspread. The former has the
permission issue (besides, where I work everything goes into Git), and
I'm not sure how full-featured or stable the latter is (but, will
investigate).

Thx,

Skip
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Basic help

2014-05-20 Thread Ned Batchelder

On 5/20/14 10:25 AM, Pat Fourie wrote:

Good Day all.

I am new to Python. I need to maintain software written on Python 1.5.2.
I will upgrade after learning more.


Pat, you are dealing with a version most people have never even seen! 
You are brave! :)




My question is :

When compiling, the results of the compile is displayed in the “active
window”. How can I view this window.


You'll have to clarify what you are referring to.  Python typically has 
no explicit compile phase.  Python also is often used in a terminal 
window, and has no built-in idea of "active window".  Can you tell us 
more about your environment?




Many thanks for your assistance.

Kind regards

Pat


--
Ned Batchelder, http://nedbatchelder.com

--
https://mail.python.org/mailman/listinfo/python-list


Re: Reading OpenOffice spreadsheet in Python?

2014-05-20 Thread Chris Angelico
On Wed, May 21, 2014 at 2:38 AM, Skip Montanaro  wrote:
> Before someone suggests
> config parser/Windows INI files... A spreadsheet format is kinda handy
> in this case because I do use a few formulas to define some of the
> parameters. Adding a new row (new config file) or column (new
> parameter) is a breeze.

Okay, I won't suggest Windows INI files, but I'll still suggest taking
a step back and figuring out exactly what you're trying to accomplish.
Can you separate out the real data from the formula-derived info, put
the former into a git-managed file, and the latter into something you
regenerate by script (maybe off a makefile)? Organize your source file
in such a way that adding a new config file or new parameter is easy.
The beauty of a spreadsheet is that a cell could be *either* a formula
*or* actual data, completely indistinguishably (note, some may argue
that this is also a major weakness of spreadsheets); I would guess you
most likely don't need that flexibility, and can easily separate
"source" and "calculated". You could make your file format CSV or tab
delimited, and then use LibreOffice to edit it, if that makes the most
sense.

Something to consider, since I can't specifically advise on OO/LO
readers/writers. :)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Basic help

2014-05-20 Thread Emile van Sebille

On 5/20/2014 7:25 AM, Pat Fourie wrote:

Good Day all.

I am new to Python.


Welcome --


I need to maintain software written on Python 1.5.2.


I'd point you to the tutorial for a start.

See the docs at https://docs.python.org/release/1.5.2/


I will upgrade after learning more.

My question is :

When compiling,


Python isn't a compiled language other than reduction to byte code which 
doesn't require a compile step but rather is done automatically at run 
time, so this is somewhat confusing.




the results of the compile is displayed in the “active
window”. How can I view this window.



Here you are likely referring to your editor, but that's not a python 
issue.


HTH,

Emile



Many thanks for your assistance.

Kind regards

Pat


--
This message has been scanned for viruses and
dangerous content by *Pinpoint Securemail*,
and is believed to be clean.





--
https://mail.python.org/mailman/listinfo/python-list


Re: Loading modules from files through C++

2014-05-20 Thread Roland Plüss

On 05/19/2014 03:40 AM, Chris Angelico wrote:
> On Mon, May 19, 2014 at 5:41 AM, Roland Plüss  wrote:
>> This exec source_code in module.__dict__ , should this not also be doable
>> with PyEval_EvalCode?
> General principle: The more code you write in Python and the less in
> C/C++, the happier and more productive you will be.
>
> Drop into Python as soon as you can, and do all the work from there.
> You won't have to worry about RAM (de)allocation, Unicode (especially
> if you use Python 3 rather than 2), integer overflow, etc, etc, etc.
> Only write lower-level code for the bits that actually demand it; and
> as Stefan has pointed out, Cython is a great help there.
>
> (Which reminds me. I still need some "excuse project" to justify my
> learning Cython. It's good-looking tech but everything I can imagine
> writing seems to already exist.)
>
> ChrisA
Figured out the solution to the problem. Inspected some python imported
files to check out the module is actually constructed. Turns out
something has been missing. In general I needed this to get it working:

PyObject * const loadedModule = Py_InitModule3( fullname, NULL, "Loaded
module" );
PyObject * const moduleDict = PyModule_GetDict( loadedModule ); //
borrowed reference
PyDict_SetItemString( moduleDict, "__builtins__", PyEval_GetBuiltins() );
PyRun_StringFlags( fileContent, Py_file_input, moduleDict, moduleDict,
NULL );

The important part are the last two lines. An important module is
lacking the __builtins__ dictionary member so I had to add it.
Furthermore I had to call the string runner with moduleDict both as
global and local dictionary. With that change the virtual script is
properly loaded and working as it should.

Hopefully this works also in Py3 should I switch some time later. But I
guess it should seeing how simple the import now became.

-- 
Yours sincerely
Plüss Roland

Leader and Head Programmer
- Game: Epsylon ( http://www.indiedb.com/games/epsylon )
- Game Engine: Drag[en]gine ( http://www.indiedb.com/engines/dragengine
, http://dragengine.rptd.ch/wiki )
- Normal Map Generator: DENormGen ( http://epsylon.rptd.ch/denormgen.php )
- As well as various Blender export scripts und game tools



signature.asc
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Putting Py 3.4.1 to work.

2014-05-20 Thread John Gordon
In  wxjmfa...@gmail.com 
writes:

> sys.path
> ['D:\\jm\\jmpy\\smid\\smid50beta1', 'C:\\Windows\\system32\\python34.zip', 
> 'C:\\Python34\\DLLs\\DLLs', 'C:\\Python34\\DLLs\\lib', 'C:\\Python34\\DLLs', 
> 'C:\\Python34\\DLLs\\lib\\site-packages', 
> 'C:\\Python34\\Lib\\site-packages\\PySide']
> >>> ---
> import PySide
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: No module named 'PySide'

Is there a file named __init__.py in the PySide directory?
Did 'import PySide' used to work on Python 3.4.0?

-- 
John Gordon Imagine what it must be like for a real medical doctor to
gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Putting Py 3.4.1 to work.

2014-05-20 Thread Ian Kelly
On Tue, May 20, 2014 at 11:14 AM, John Gordon  wrote:
> In  
> wxjmfa...@gmail.com writes:
>
>> sys.path
>> ['D:\\jm\\jmpy\\smid\\smid50beta1', 'C:\\Windows\\system32\\python34.zip',
>> 'C:\\Python34\\DLLs\\DLLs', 'C:\\Python34\\DLLs\\lib', 'C:\\Python34\\DLLs',
>> 'C:\\Python34\\DLLs\\lib\\site-packages', 
>> 'C:\\Python34\\Lib\\site-packages\\PySide']
>> >>> ---
>> import PySide
>> Traceback (most recent call last):
>>   File "", line 1, in 
>> ImportError: No module named 'PySide'
>
> Is there a file named __init__.py in the PySide directory?
> Did 'import PySide' used to work on Python 3.4.0?
>

Or maybe some .pth file got clobbered.

I always reinstall packages after upgrading Python on Windows.  I
don't know whether the scenario of reinstalling Python on top of an
existing site-packages directory is supposed to work or not.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Loading modules from files through C++

2014-05-20 Thread Chris Angelico
On Wed, May 21, 2014 at 3:17 AM, Roland Plüss  wrote:
> The important part are the last two lines. An important module is
> lacking the __builtins__ dictionary member so I had to add it.
>
> Hopefully this works also in Py3 should I switch some time later. But I
> guess it should seeing how simple the import now became.

An interesting omission, I'm a little surprised at that. But if your
switch to Py3 is a serious (or even half-serious) possibility, I
recommend tossing a quick comment against that line of code. Check to
see if you actually need it, and if you still do, see if there's a
change there. The module has been renamed (from __builtin__ to
builtins, although the global reference to it is still __builtins__),
so you may need to adjust something there, too. But mainly, see if you
can drop that line of code in Py3.

> Furthermore I had to call the string runner with moduleDict both as
> global and local dictionary. With that change the virtual script is
> properly loaded and working as it should.

This part does make sense, though. Normally, module-level code runs
with the same locals and globals:

>>> locals() is globals()
True

And that doesn't change in Py3, so I would expect that your C++ code
also won't change.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Code a web service with python/postgis

2014-05-20 Thread image
Dear all,

I would like code a web service with python. I have already imported several
vector data 
(land cover) and one Digital Elevation Model (raster layer) into my
postgresql/postgis 
database (server side).

I succeed in connecting to my pg db via psycopg2.

Client side, operators use a client application (Developed with PHP /
javascript / 
openlayers).

Objectives :  Client side, once the layer would be selected,and once the
operators have 
clicked on the map  , they would like that usefull informations appear on
the interface 
of the client application(kind of land cover, z of the DEM).


=> Regarding my python script, i have to type a SQL query in order to select
usefull 
informations of the db layers. And, of course, the information must  depend
on geographic 
coordinates (Latitude Y/Longitute X).
In a 2nd time, my script must  produce a result(JSon type) for the client
side.


It would be possible to help me regarding the coding in order to select
usefull 
informations of the db layers. (depends on geographic coordinates x/y  ?
Could you throw 
light for me regarding the way to do this SQL query ?

In advance, thank you to throw light for me.



--
View this message in context: 
http://python.6.x6.nabble.com/Code-a-web-service-with-python-postgis-tp5057714.html
Sent from the Python - python-list mailing list archive at Nabble.com.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Putting Py 3.4.1 to work.

2014-05-20 Thread Vincent Vande Vyvre

Le 20/05/2014 19:38, Ian Kelly a écrit :

On Tue, May 20, 2014 at 11:14 AM, John Gordon  wrote:

In  wxjmfa...@gmail.com 
writes:


sys.path
['D:\\jm\\jmpy\\smid\\smid50beta1', 'C:\\Windows\\system32\\python34.zip',
'C:\\Python34\\DLLs\\DLLs', 'C:\\Python34\\DLLs\\lib', 'C:\\Python34\\DLLs',
'C:\\Python34\\DLLs\\lib\\site-packages', 
'C:\\Python34\\Lib\\site-packages\\PySide']

---

import PySide
Traceback (most recent call last):
   File "", line 1, in 
ImportError: No module named 'PySide'

Is there a file named __init__.py in the PySide directory?
Did 'import PySide' used to work on Python 3.4.0?


Or maybe some .pth file got clobbered.

I always reinstall packages after upgrading Python on Windows.  I
don't know whether the scenario of reinstalling Python on top of an
existing site-packages directory is supposed to work or not.

What about:

from pyside import QtCore, QtGui

?

--
Vincent V.V.
Oqapy  . Qarte 
 . PaQager 

--
https://mail.python.org/mailman/listinfo/python-list


Re: Putting Py 3.4.1 to work.

2014-05-20 Thread Chris Angelico
On Wed, May 21, 2014 at 4:02 AM, Vincent Vande Vyvre
 wrote:
> from pyside import QtCore, QtGui

Is it pyside or PySide? There seems to be some inconsistency here.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Putting Py 3.4.1 to work.

2014-05-20 Thread Mark Lawrence

On 20/05/2014 18:38, Ian Kelly wrote:

On Tue, May 20, 2014 at 11:14 AM, John Gordon  wrote:

In  wxjmfa...@gmail.com 
writes:


sys.path
['D:\\jm\\jmpy\\smid\\smid50beta1', 'C:\\Windows\\system32\\python34.zip',
'C:\\Python34\\DLLs\\DLLs', 'C:\\Python34\\DLLs\\lib', 'C:\\Python34\\DLLs',
'C:\\Python34\\DLLs\\lib\\site-packages', 
'C:\\Python34\\Lib\\site-packages\\PySide']

---

import PySide
Traceback (most recent call last):
   File "", line 1, in 
ImportError: No module named 'PySide'


Is there a file named __init__.py in the PySide directory?
Did 'import PySide' used to work on Python 3.4.0?



Or maybe some .pth file got clobbered.

I always reinstall packages after upgrading Python on Windows.  I
don't know whether the scenario of reinstalling Python on top of an
existing site-packages directory is supposed to work or not.



I've never bothered to reinstall packages after upgrading Python on 
Windows and I've never had a problem.  I can't see how Python can do 
anything with site-packages as it knows nothing about it, other than 
that it exists, so it strikes me that it has to work, or am I missing 
something?


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


--
https://mail.python.org/mailman/listinfo/python-list


Code a web service with python/postgis

2014-05-20 Thread lcelati

Dear all,

I would like code a web service with python. I have already imported  
several vector data
(land cover) and one Digital Elevation Model (raster layer) into my  
postgresql/postgis

database (server side).

I succeed in connecting to my pg db via psycopg2.

Client side, operators use a client application (Developed with PHP /  
javascript /

openlayers).

Objectives :  Client side, once the layer would be selected,and once  
the operators have
clicked on the map  , they would like that usefull informations appear  
on the interface

of the client application(kind of land cover, z of the DEM).


=> Regarding my python script, i have to type a SQL query in order to  
select usefull
informations of the db layers. And, of course, the information must   
depend on geographic

coordinates (Latitude Y/Longitute X).
In a 2nd time, my script must  produce a result(JSon type) for the  
client side.



It would be possible to help me regarding the coding in order to  
select usefull
informations of the db layers. (depends on geographic coordinates x/y   
? Could you throw

light for me regarding the way to do this SQL query ?

In advance, thank you to throw light for me.
--
https://mail.python.org/mailman/listinfo/python-list


PyDev 3.5.0 Released

2014-05-20 Thread Fabio Zadrozny
What is PyDev?
---

PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and
IronPython development.

It comes with goodies such as code completion, syntax highlighting, syntax
analysis, code analysis, refactor, debug, interactive console, etc.

Details on PyDev: http://pydev.org
Details on its development: http://pydev.blogspot.com


What is LiClipse?
---

LiClipse is a PyDev standalone with goodies such as support for Multiple
cursors, theming and a number of other languages such as Django Templates,
Kivy Language, Mako Templates, Html, Javascript, etc.

It's also a commercial counterpart which helps supporting the development
of PyDev.

Details on LiClipse: http://brainwy.github.io/liclipse/


Release Highlights:
---

- **Important**: PyDev requires Eclipse 3.8 or 4.3 onwards and Java 7! For
older versions, keep using PyDev 2.x (or LiClipse for a PyDev standalone
with all requirements bundled).

* Adding plead for the current crowdfunding at http://tiny.cc/pydev-2014.

* PyDev now has a new logo.

* **py.test**:

* Improved py.test test runner preferences page.

* py.test integration improved to be less intrusive and work with xdist.

* py.test protocol invocation now allows for module/session scoped
fixtures to work properly.

* Add bookmark and add task actions are shown in the ruler context menu
(**Ctrl+F10**).

* Code completion was not properly recognizing variables assigned to self
inside an elif statement.

* Django 1.7: Model.objects is manually patched inside PyDev to give proper
code-completion results.

* Debugger: hovering over private ('__' prefixed) variables now shows
proper value.

* Thread.isAlive() is no longer called to workaround debugger issue on
Python 3.4.

* Hyperlinking should not happen on spacing characters (I.e.: Ctrl+click on
spaces).

* Fixed NPE when interpreter is created with JDT and loaded afterwards
without it.

* Fixed issue where tokens cached information could end up being null after
I/O.

* Manually creating new run configuration no longer gives an exception
(i.e.: configuration without associated project).

* Out-of-sync error on PYTHONPATH change (patch by Danny Yoo)

* There's an extension point for clients to resolve modules (patch by Danny
Yoo).

* **Ctrl+Shift+G** (find references) is now properly categorized.

* Rename refactoring now validates files (read only) prior to refactoring
(patch by Danny Yoo).

* Not checking preferred settings when the PyDev plugin is started, but
rather when a PyDev editor is opened.

* Setting remote debugger socket to be properly reused.

* The PyDev stdout/stderr redirector now properly uses PYTHONIOENCODING.



Cheers,

--
Fabio Zadrozny
--
Software Developer

LiClipse
http://brainwy.github.io/liclipse

PyDev - Python Development Environment for Eclipse
http://pydev.org
http://pydev.blogspot.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Putting Py 3.4.1 to work.

2014-05-20 Thread Vincent Vande Vyvre

Le 20/05/2014 20:12, Chris Angelico a écrit :

On Wed, May 21, 2014 at 4:02 AM, Vincent Vande Vyvre
 wrote:

from pyside import QtCore, QtGui

Is it pyside or PySide? There seems to be some inconsistency here.

ChrisA

Yes PySide, off course. Sorry.

--
Vincent V.V.
Oqapy  . Qarte 
 . PaQager 

--
https://mail.python.org/mailman/listinfo/python-list


Re: Putting Py 3.4.1 to work.

2014-05-20 Thread wxjmfauth
-

Complete (re)Fresh install Stop Python34, PySide ok Stop
cx_freeze 4.3.3 for py34 seems to suffer, again, from the same
desease as with cx_freeze 4.3.2, Py 3.4.0 leading to a Py crash
Stop Python, PySide, cx_freeze, Windows issue? No idea Stop
Have some idea about the guilty msi installer Stop.

jmf
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reading OpenOffice spreadsheet in Python?

2014-05-20 Thread Martin Manns
On Tue, 20 May 2014 11:38:06 -0500
Skip Montanaro  wrote:

> I am so fed up with LibreOffice's inability to properly support really
> basic Excel capabilities, I'm about ready to throw my computer out the

Could you please give some examples, what basic Excel capabilities you
are missing?

> I'm open to other options as well. I see a number of Google
> spreadsheet modules, and there is pyspread. The former has the
> permission issue (besides, where I work everything goes into Git), and
> I'm not sure how full-featured or stable the latter is (but, will
> investigate).

Maybe gnumeric may be an option, too.

Pyspread should run fine on the Mac. However, Macs are not officially
supported because there are no testers for OSX, yet.

Please note that pyspread does not translate Excel "xls" files into
Python but only imports cell contents and formatting via xlrd. If you
use Excel cell functions or VBA then you would have to migrate your
code to Python.


Martin
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Putting Py 3.4.1 to work.

2014-05-20 Thread Zachary Ware
On Tue, May 20, 2014 at 9:31 AM,   wrote:
> Experimented users have certainly noticed a lot of
> things have changed.
>
> Short. I installed Py3.4.1, it overwrites c:\Python34 which
> contained eg. PySide in ...\site-packages.
>
> So far, so good. I can launch Python, IDLE and my interactive
> interpreter I wrote with tkinter via a cmd in dos, .bat, ...
>
> Now the questions. It seems all packages in \site-packages
> are no more recognized.
> What am I doing wrong? Why is "site-packages" no more
> recognized, "forcing" sys.path does not seem to help.
>
> From my interactive interpreter:
>
 ---
> import PySide
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: No module named 'PySide'
 ---
> sys.path
> ['D:\\jm\\jmpy\\smid\\smid50beta1', 'C:\\Windows\\system32\\python34.zip',
> 'C:\\Python34\\DLLs\\DLLs', 'C:\\Python34\\DLLs\\lib', 'C:\\Python34\\DLLs',
> 'C:\\Python34\\DLLs\\lib\\site-packages']

This looks like something went weird in your installation, like you
installed to 'C:\Python34\DLLs' instead of 'C:\Python34'.  What path
does sys.executable give?  The usual location for site-packages is
C:\Python34\Lib\site-packages, which is not listed.

-- 
Zach
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reading OpenOffice spreadsheet in Python?

2014-05-20 Thread Skip Montanaro
On Tue, May 20, 2014 at 2:45 PM, Martin Manns  wrote:
>> I am so fed up with LibreOffice's inability to properly support really
>> basic Excel capabilities, I'm about ready to throw my computer out the
>
> Could you please give some examples, what basic Excel capabilities you
> are missing?

That's the problem. It's not that it's obviously missing some
features. It's that the files it writes sometimes are misinterpreted
by xlrd. (Maybe the problem is xlrd, but it never has a problem with
actual Excel-generated XLS files.)

For example, I use a formula to generate a sequence of strings in one column:

"F0", "G0", "H0", ..., "Z0", "F1", "G1", ...

continuing for as long as I have data in an adjoining column. If I add
or delete rows, this sequence grows and shrinks. It looks fine in the
spreadsheet. I rarely, if ever, change the number of rows, so the
values in this column rarely, if ever, change. Still, sometimes when
xlrd reads the values out of that column it finds all cells in that
column contain the number 0. If I mess around with the spreadsheet in
ways which are apparently unrelated to this column, I can sometimes
get it to read right, sort of like hitting a jukebox to stop a record
from skipping.

I haven't tried changing the output format to XLSX format (isn't that
a compressed XML document?), but maybe I should give that a whirl. I
don't know if xlrd will read such files (at first blush, it appears
not).

Also, Mac isn't my primary platform. This problem occurs using the
Linux version of LibreOffice as well. Sometimes I edit this
spreadsheet from home though. Before I upgraded to OS X Mavericks, I
still had an ancient version of Excel for Mac which worked fine
(despite all the disparaging remarks I've seen over the years about
that product). Once I upgraded though, that was no longer an option.

Thanks for the gnumeric and pyspread suggestions. I thought gnumeric
was a long dead project, but see that it's available for my Mac, so
I'll try that right off. I'll also play around with pyspread and see
how that does. I don't mind rewriting my couple of formulas, though I
will no longer be able to rely on the Excel experts at work. :-)

Skip
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Putting Py 3.4.1 to work.

2014-05-20 Thread Terry Reedy

On 5/20/2014 4:55 PM, Zachary Ware wrote:

On Tue, May 20, 2014 at 9:31 AM,   wrote:

Experimented users have certainly noticed a lot of
things have changed.

Short. I installed Py3.4.1, it overwrites c:\Python34 which
contained eg. PySide in ...\site-packages.


I installed 3.4.1 on top of 3.4.0, Win 7, both 64-bit versions.

>> contained eg. PySide in ...\site-packages.

The installer is careful to only overwrite or delete files it installed. 
The only problem one will have is if you modify a file Python installed 
or add a new file where Python subsequently adds one (but that is 
unlikely in bug-fix releases anyway).



So far, so good. I can launch Python, IDLE and my interactive
interpreter I wrote with tkinter via a cmd in dos, .bat, ...

Now the questions. It seems all packages in \site-packages
are no more recognized.
What am I doing wrong? Why is "site-packages" no more
recognized, "forcing" sys.path does not seem to help.

 From my interactive interpreter:


---

import PySide
Traceback (most recent call last):
   File "", line 1, in 
ImportError: No module named 'PySide'

---

sys.path
['D:\\jm\\jmpy\\smid\\smid50beta1', 'C:\\Windows\\system32\\python34.zip',
'C:\\Python34\\DLLs\\DLLs', 'C:\\Python34\\DLLs\\lib', 'C:\\Python34\\DLLs',
'C:\\Python34\\DLLs\\lib\\site-packages']


>>> sys.path
['', 'C:\\Programs\\Python34\\Lib\\idlelib', 
'C:\\Windows\\system32\\python34.zip', 'C:\\Programs\\Python34\\DLLs', 
'C:\\Programs\\Python34\\lib', 'C:\\Programs\\Python34', 
'C:\\Users\\Terry\\AppData\\Roaming\\Python\\Python34\\site-packages', 
'C:\\Programs\\Python34\\lib\\site-packages', 'F:\\Python'


Delete \Programs to match what you should have.


This looks like something went weird in your installation, like you
installed to 'C:\Python34\DLLs' instead of 'C:\Python34'.


I suspect you nailed it.


 What path does sys.executable give?


>>> sys.executable
'C:\\Programs\\Python34\\pythonw.exe' (from Idle)

> The usual location for site-packages is

C:\Python34\Lib\site-packages, which is not listed.


whereas the new 'C:\\Programs\\Python34\\lib\\site-packages' will be empty.

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: Reading OpenOffice spreadsheet in Python?

2014-05-20 Thread Skip Montanaro
On Tue, May 20, 2014 at 11:49 AM, Chris Angelico  wrote:
> Okay, I won't suggest Windows INI files, but I'll still suggest taking
> a step back and figuring out exactly what you're trying to accomplish.
> Can you separate out the real data from the formula-derived info, put
> the former into a git-managed file, and the latter into something you
> regenerate by script (maybe off a makefile)?

Actually, I'm sympathetic to INI files. I like the simplicity. The
ultimate config files are output in XML though (ugh). Somewhere along
the way, I want to avoid typing repetitive information into files.
Today, I use a template file, read the spreadsheet with xlrd and
generate the XML cruft with Cheetah. I could retain Excel (or Open
Document or pyspread or some other spreadsheet) and then export to CSV
files. That would solve the issue as well. Though it would be an extra
step I'd have to do manually (because I can rely on xlrd), it would
still leave me with the input-to-config-file data in tabular form.

I'll figure something out. Something else that occurs to me as I write
this is that Excel files tend to acquire all sorts of cruft, right? Or
is that just Word files? Perhaps I can make things better by
copying/pasting the existing spreadsheet data into a fresh spreadsheet
that hasn't been updated repeatedly?

Skip
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reading OpenOffice spreadsheet in Python?

2014-05-20 Thread Rustom Mody
On Tuesday, May 20, 2014 10:08:06 PM UTC+5:30, Skip Montanaro wrote:
> I don't have Windows and since upgrading my Mac to Mavericks I no
> longer have Excel of any flavor. I have a few Excel spreadsheets in
> which I store parameters from which I generate other config files. I
> read those spreadsheets using xlrd.

> I am so fed up with LibreOffice's inability to properly support really
> basic Excel capabilities, I'm about ready to throw my computer out the
> window. So, I'm looking for alternatives. Before someone suggests
> config parser/Windows INI files... A spreadsheet format is kinda handy
> in this case because I do use a few formulas to define some of the
> parameters. Adding a new row (new config file) or column (new
> parameter) is a breeze. 

Are you familiar with emacs' org mode tables?

http://orgmode.org/org.html#Tables

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Copying files from sub folders under source directories into sub folders with same names as source directory sub folders in destination directories without overwriting already existing files of sa

2014-05-20 Thread Rustom Mody
On Tuesday, May 20, 2014 9:35:10 PM UTC+5:30, Jagadeesh N. Malakannavar wrote:
> Hi Satish,
> 
> Can you please send python part in plain text format? Python code here is 
> 
> difficult to read.

It would be helpful to read 
https://wiki.python.org/moin/GoogleGroupsPython#Posting_from_Google_Groups

Note particularly the 2 standard expectations:
- Dont top post
- Dont use excessively long (> 70 chars) lines
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reading OpenOffice spreadsheet in Python?

2014-05-20 Thread Skip Montanaro
> Are you familiar with emacs' org mode tables?

> http://orgmode.org/org.html#Tables

No. Thanks for the pointer.

S
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Putting Py 3.4.1 to work.

2014-05-20 Thread wxjmfauth
Le mercredi 21 mai 2014 00:19:37 UTC+2, Terry Reedy a écrit :
> On 5/20/2014 4:55 PM, Zachary Ware wrote:
> 
> > On Tue, May 20, 2014 at 9:31 AM,   wrote:
> 
> >> Experimented users have certainly noticed a lot of
> 
> >> things have changed.
> 
> >>
> 
> 
> > This looks like something went weird in your installation, like you
> 
> > installed to 'C:\Python34\DLLs' instead of 'C:\Python34'.
> 
> 
> 
> I suspect you nailed it.
> 
> 

Sorry, *I* did not install, the *msi* installer
did it. I had a complete mismatch, python*.exe, in DLLs
and py*.exe in c:\python34 !

Usualy, I removed then I reinstall, I did no do it
this time.

I'm very aware about all this stuff, all my apps
are running on any wins from an usb strick, including
my interactive interpreters.

I have however some more serious concerns about
cx_freeze, will spend some time soon.

FYI:
On win7, "Program Files" does no more exist. The name
is a "fake" "Programs" (without any space (finally))
which carries the name of the "linguistic" win version,
in my case c:\Programmes (French).

jmf
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Reading OpenOffice spreadsheet in Python?

2014-05-20 Thread dieter
Skip Montanaro  writes:
> ...
> That then puts me in the market for an xlrd
> replacement. Is there something akin to xlrd for OpenDocument
> spreadsheets?

Unlike the binary "excel" format (at least for early versions),
"OpenDocument" is a well documented
file format (a zip file containing various XML files; processible
by standard XML tools). Thus, you may get at the content
via "zipfile" and Python's "xml" tools.

It might be possible to create an "xlrd" replacement based
on "zipfile" and the "xml" package -- but, of course, one
would need to study the (complex) description for the involved
XML files.

In the "Plone" world, there are text extractors/html converters
for "OpenDocument" which go this route. I do not know how
well they work.




-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Loading modules from files through C++

2014-05-20 Thread Stefan Behnel
Roland Plüss, 20.05.2014 19:17:
> PyObject * const loadedModule = Py_InitModule3( fullname, NULL, "Loaded
> module" );
> PyObject * const moduleDict = PyModule_GetDict( loadedModule ); //
> borrowed reference
> PyDict_SetItemString( moduleDict, "__builtins__", PyEval_GetBuiltins() );
> PyRun_StringFlags( fileContent, Py_file_input, moduleDict, moduleDict,
> NULL );
> 
> Hopefully this works also in Py3 should I switch some time later. But I
> guess it should seeing how simple the import now became.

The general principle should still work, just the module creation has changed.

Stefan


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Code a web service with python/postgis

2014-05-20 Thread dieter
lcel...@latitude-geosystems.com writes:
> ...
> I would like code a web service with python.
> ... details omitted ...

Such a task has many facets. Some of them are quite general
and you can find packages on "PyPI" which support them well;
others are highly problem specific and you likely will need
to solve them on your own.

"web service" is an ambigous term: in a wide meaning, it can
be any service provided via HTTP/HTTPS; however, often,
it is used in a narrow way as a SOAP/WSDL service.
There are several packages which help you to implement SOAP services
in Python, among them "spyne" and "soapbox". This gives
you the SOAP aspect (together with WSDL generation).

In addition, you have the "web" aspect. There are other
packages for this: among them "django", "pyramid", "twisted", ...

And there are further more application dependent aspects
like determining the geo location. Look at "PyPI" to find
out whether there are packages that help you with those.
Likely, those will not be pure Python packages but bridges to
other ("C/C++") libraries.



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Putting Py 3.4.1 to work.

2014-05-20 Thread wxjmfauth
I really expected I worked to quickly and I did a mistake
in freezing applications. But, no. cx_freeze just re-became
problematic, __file__, bootstap, importlib and so on.

My take on the subject.
Since the introduction of this uncecessary __pycache__ mess,
I'm experimenting a lot of problems (I'm not alone).
It was too simple, logical, let's make complicate. Pure Python
development style.

jmf
-- 
https://mail.python.org/mailman/listinfo/python-list