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-19 Thread Chris Angelico
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
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [python-committers] [RELEASED] Python 3.4.1

2014-05-19 Thread Victor Stinner
It's not easy to find the changelog. I found this page:
https://docs.python.org/3.4/whatsnew/changelog.html

Victor

2014-05-19 8:00 GMT+02:00 Larry Hastings :
>
>
> On behalf of the Python development community and the Python 3.4 release
> team, I'm pleased to announce the availability of Python 3.4.1.  Python
> 3.4.1 has over three hundred bugfixes and other improvements over 3.4.0. One
> notable change: the version of OpenSSL bundled with the Windows installer no
> longer has the "HeartBleed" vulnerability.
>
> You can download it here:
>
> https://www.python.org/download/releases/3.4.1
>
>
>
> /arry
>
> ___
> python-committers mailing list
> python-committ...@python.org
> https://mail.python.org/mailman/listinfo/python-committers
>
-- 
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-19 Thread Satish ML
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

Consider xls file contains source and destination directory paths.
import xlrd, sys, subprocess
file_location = "C:\Users\User1\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:
   What next after this? 
shutil.copy(src, dest) doesn't work because it overwrites dest files.
-- 
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-19 Thread Satish ML
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.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and Math

2014-05-19 Thread Fabien

Hi everyone,

I am new on this forum (I come from IDL and am starting to learn python)

This thread perfectly illustrates why Python is so scary to newcomers: 
one question, three answers: yes, no, maybe.


Python-fans sure would argue "freedom of choice" is the most important, 
but "being able to find the right tool for me in less than three days" 
surely is important too. The paradox of choice ;-)


Fabien




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


Re: Python and Math

2014-05-19 Thread Tim Golden
On 19/05/2014 11:15, Fabien wrote:
> Hi everyone,
> 
> I am new on this forum (I come from IDL and am starting to learn python)
> 
> This thread perfectly illustrates why Python is so scary to newcomers:
> one question, three answers: yes, no, maybe.

Welcome to the Python world, Fabien.

But I'm sure you realise that question as general-purpose as "is Python
good for Maths?" is pretty much *bound* to generate different kinds of
answers. I'm not sure why it should be seen as scary. If anything, the
variety of responses reflects the diversity of Python's userbase.

The casual mathematician sees Python as perfectly adequate using
built-in tools alone. The more advanced mathematician sees it as helpful
with the addition of some specialist libraries. The most advanced user
would prefer some specialised language or toolset more entirely devoted
to this one area of interest.

And you could repeat the same situation with any number of other areas:
Image Processing, Websites, Network-based message passing, Data mining,
financial market management, web-scraping, etc. For some, Python has
more or less useful built-in support. For some, there are
well-established or highly-regarded 3rd-party libraries and communities.
For some, you might be better advised to look at a different toolset,
especially if you want something which comes ready-made.

As I say, though, welcome to Python!

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


Re: [RELEASED] Python 2.7.7 release candidate 1

2014-05-19 Thread Miki Tebeka
> (If you don't know what the strop
> module is, go ahead and forget it now.)
+1 QOTW :)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [RELEASED] Python 2.7.7 release candidate 1

2014-05-19 Thread Mark Lawrence

On 19/05/2014 13:20, Miki Tebeka wrote:

(If you don't know what the strop
module is, go ahead and forget it now.)

+1 QOTW :)



IIRC the strop module was targetted at users such as myself :)

--
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: Python and Math

2014-05-19 Thread Rustom Mody
On Monday, May 19, 2014 3:45:22 PM UTC+5:30, Fabien wrote:
> Hi everyone,

> I am new on this forum (I come from IDL and am starting to learn python)

> This thread perfectly illustrates why Python is so scary to newcomers: 
> one question, three answers: yes, no, maybe.

> Python-fans sure would argue "freedom of choice" is the most important, 
> but "being able to find the right tool for me in less than three days" 
> surely is important too. The paradox of choice ;-)

Point taken.

So let me try to give pointwise answers to the OP's questions

Expanding and factoring equations of all degrees: 
http://docs.sympy.org/dev/modules/polys/wester.html

Numpy for gaussian elimination: https://gist.github.com/tkralphs/7554375
illustrates some of numpy's array-level features.

One thing about numpy that bugs me is that the docs never say how much
is taken straight from APL.  So here is the APL (which I dont claim to 
understand):

http://dfns.dyalog.com/n_gauss_jordan.htm

Here is an online APL you can run straight from the browser:
http://baruchel.hd.free.fr/apps/apl/


The more general question:

On Sunday, May 18, 2014 9:10:46 PM UTC+5:30, Grant Edwards wrote:
> On 2014-05-18, Bill Cunningham  wrote:
> > Does Python have good mathematical capabilities?

> No.

> It has very good numerical computation capabilities, but it does not
> really do "math" (at least not what a mathemetician would consider
> "math").

vs Robert's

> Many mathematicians would disagree.
> 
>http://sagemath.org/

Traditionally mathematicians do two kinds of things - calculating and proving.
Normal mathematicians dont make too much of a distinction between the two.
The more extremists in the one camp look down - as usual - on the other thus:

The provers call the calculators as "Just applied not pure mathematicians"
The calculators say of the provers: "They are not mathematicians but logicians"
(or philosophers)" [Chris had a funny quote on this a few weeks ago]

After computers, a new area emerged - explorers - which straddles proving and 
calculating.

In short, Grant is speaking from the prover angle whereas Robert is speaking 
from the
calculator angle.

There is one more point here:

Does language-X (in this case python) have a theoretically sound (ie 
mathematical) foundation?

Mathematicians coming to CS never bother with this whereas computer scientists, 
especially
theoretical CSists, at some point or other invariably come to this.

Since its not clear whether this question is being asked, I'm not saying 
anything more on
it.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and Math

2014-05-19 Thread Chris Angelico
On Mon, May 19, 2014 at 10:46 PM, Rustom Mody  wrote:
> The provers call the calculators as "Just applied not pure mathematicians"
> The calculators say of the provers: "They are not mathematicians but 
> logicians"
> (or philosophers)" [Chris had a funny quote on this a few weeks ago]

Which Chris? I don't remember either reading or writing such a quote,
and would like to. There are a good few Chrises on this list :)

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


Re: Python and Math

2014-05-19 Thread Rustom Mody
On Monday, May 19, 2014 6:39:49 PM UTC+5:30, Chris Angelico wrote:
> On Mon, May 19, 2014 at 10:46 PM, Rustom Mody  wrote:
> > The provers call the calculators as "Just applied not pure mathematicians"
> > The calculators say of the provers: "They are not mathematicians but 
> > logicians"
> > (or philosophers)" [Chris had a funny quote on this a few weeks ago]

> Which Chris? I don't remember either reading or writing such a quote,
> and would like to. There are a good few Chrises on this list :)

You!!
Something about mathematicians philosophers and waste-paper baskets
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and Math

2014-05-19 Thread Chris Angelico
On Mon, May 19, 2014 at 11:15 PM, Rustom Mody  wrote:
> On Monday, May 19, 2014 6:39:49 PM UTC+5:30, Chris Angelico wrote:
>> On Mon, May 19, 2014 at 10:46 PM, Rustom Mody  wrote:
>> > The provers call the calculators as "Just applied not pure mathematicians"
>> > The calculators say of the provers: "They are not mathematicians but 
>> > logicians"
>> > (or philosophers)" [Chris had a funny quote on this a few weeks ago]
>
>> Which Chris? I don't remember either reading or writing such a quote,
>> and would like to. There are a good few Chrises on this list :)
>
> You!!
> Something about mathematicians philosophers and waste-paper baskets

Oh! Yes, I remember now. Old joke I found someplace. Physicists need
heaps of sensitive (and expensive) equipment... mathematicians need
only pencils, paper, and waste-paper baskets. And philosophers don't
even need waste-paper baskets.

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


Problem in writing demands to the xml file

2014-05-19 Thread varun7rs
Hello Friends,

I am still working on the script to write data onto the xml file and now I've 
got a problem.

This is how my xml file looks now but I intend to add attributes to demands. I 
am not able to do it properly.
substrate>








My class for nodes. I have a class for DEMAND but I don't want to populate the 
post with all of it.
class PHY_NODES:
def __init__(self, nodeID, nodenum, x, y, capacity_proc, capacity_stor, 
capacity_switch, totaldemand, demands):
self.id = nodeID
self.nodenum = nodenum
self.x = x
self.y = y
self.capacity_proc = capacity_proc
self.capacity_stor = capacity_stor
self.capacity_switch = capacity_switch
self.totaldemand = totaldemand
self.demands = demands

def addDemand (self, demand):
self.demands.append( demand )  

The problem I have is in writing the demands. I generate the necessary stuff 
for it but when I try and append it, it doesn't seem to work. I'd be glad to 
share my files if you need them. Could you please help me fix this?

Thank You

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


[ANN]: distlib 0.1.9 released on PyPI

2014-05-19 Thread Vinay Sajip


I've just released version 0.1.9 of distlib on PyPI [1]. For newcomers,
distlib is a library of packaging functionality which is intended to be
usable as the basis for third-party packaging tools.

The main changes in this release are as follows:

    Fixed issue #47: Updated binary launchers to fix double-quoting bug
    where script executable paths have spaces.

    Added ``keystore`` keyword argument to signing and verification APIs.

A more detailed change log is available at [2].

Please try it out, and if you find any problems or have any suggestions for
improvements, please give some feedback using the issue tracker! [3]

Regards,

Vinay Sajip

[1] https://pypi.python.org/pypi/distlib/0.1.9
[2] http://pythonhosted.org/distlib/overview.html#change-log-for-distlib
[3] https://bitbucket.org/pypa/distlib/issues/new

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


Re: Python and Math

2014-05-19 Thread wxjmfauth
Le lundi 19 mai 2014 12:15:22 UTC+2, Fabien a écrit :
> Hi everyone,
> 
> 
> 
> I am new on this forum (I come from IDL and am starting to learn python)
> 
> 
> 
> This thread perfectly illustrates why Python is so scary to newcomers: 
> 
> one question, three answers: yes, no, maybe.
> 
> 
> 
> Python-fans sure would argue "freedom of choice" is the most important, 
> 
> but "being able to find the right tool for me in less than three days" 
> 
> surely is important too. The paradox of choice ;-)
> 
> 
> 
> Fabien

--

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 know Python since v 1.5.6 !

I'm able to write "Numerical Recipes" in Python,
(I did it in Py2 and Py3), I'm unable to install
a piece of software (like Python) to work with.

I'm just wondering if finally the better solution
is not to stick with an "MS C#".

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


ANN: pdb-clone 1.6 - a fast clone of pdb with the remote debugging and attach features

2014-05-19 Thread Xavier de Gaye

pdb-clone 1.6 has been released at Pypi: https://pypi.python.org/pypi/pdb-clone

Features:
  * Improve significantly pdb performance. With breakpoints, pdb-clone runs 
just above the speed of the interpreter while pdb runs at 10 to 100 times the 
speed of the interpreter.

  * Instrument the code with a `set_trace_remote()` hard-coded breakpoint and run the `pdb-attach` script from another terminal to start a remote debugging session. Or, when the code has not been 
instrumented, run `pdb-attach` with the `--pid` option to start the remote debugging session at any time and attach to the process main thread.


  * Fix pdb long standing bugs entered in the python issue tracker.

  * Add a bdb comprehensive test suite (more than 70 tests) and run both the 
Python pdb and pdb-clone bdb test suites.

  * Three versions of pdb-clone are supported:
* The _py3_ version of pdb-clone runs on python3 from python 3.2 onward.
* The _py2.7_ vesion runs on python 2.7.
* The _py2.4_ version runs on all python versions from 2.4 to 2.7 included.

The pdb command line interface remains unchanged except for the new `detach` 
pdb command. All the versions of pdb-clone implement the most recent python3 
features of pdb.

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


[RELEASED] Python 3.4.1

2014-05-19 Thread Larry Hastings



On behalf of the Python development community and the Python 3.4 release 
team, I'm pleased to announce the availability of Python 3.4.1.  Python 
3.4.1 has over three hundred bugfixes and other improvements over 3.4.0. 
One notable change: the version of OpenSSL bundled with the Windows 
installer no longer has the "HeartBleed" vulnerability.


You can download it here:

   https://www.python.org/download/releases/3.4.1



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


Re: Python and Math

2014-05-19 Thread Gene Heskett
On Monday 19 May 2014 09:24:18 Chris Angelico did opine
And Gene did reply:
> On Mon, May 19, 2014 at 11:15 PM, Rustom Mody  
wrote:
> > On Monday, May 19, 2014 6:39:49 PM UTC+5:30, Chris Angelico wrote:
> >> On Mon, May 19, 2014 at 10:46 PM, Rustom Mody  wrote:
> >> > The provers call the calculators as "Just applied not pure
> >> > mathematicians" The calculators say of the provers: "They are not
> >> > mathematicians but logicians" (or philosophers)" [Chris had a
> >> > funny quote on this a few weeks ago]
> >> 
> >> Which Chris? I don't remember either reading or writing such a
> >> quote, and would like to. There are a good few Chrises on this list
> >> :)
> > 
> > You!!
> > Something about mathematicians philosophers and waste-paper baskets
> 
> Oh! Yes, I remember now. Old joke I found someplace. Physicists need
> heaps of sensitive (and expensive) equipment... mathematicians need
> only pencils, paper, and waste-paper baskets. And philosophers don't
> even need waste-paper baskets.
> 
> ChrisA

I gotta grin and like it, that does boil it down to the pure essence.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
US V Castleman, SCOTUS, Mar 2014 is grounds for Impeaching SCOTUS
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Distutils] [ANN]: distlib 0.1.9 released on PyPI

2014-05-19 Thread Paul Moore
On 19 May 2014 15:24, Vinay Sajip  wrote:
> Fixed issue #47: Updated binary launchers to fix double-quoting bug
> where script executable paths have spaces.

Note that this issue affects pip / virtualenv in that creating a
virtualenv in a path with spaces can result in pip not working in that
virtualenv.

We should revendor distlib for the next pip/virtualenv release (if one
of the Unix devs could do that, that would be safer, I've managed to
break line endings trying to do a revendor on Windows in the past :-()

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


Re: Python and Math

2014-05-19 Thread Rustom Mody
On Monday, May 19, 2014 8:26:11 PM UTC+5:30, jmf 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 know Python since v 1.5.6 !

> I'm able to write "Numerical Recipes" in Python,
> (I did it in Py2 and Py3), I'm unable to install
> a piece of software (like Python) to work with.

So what're you waiting for?
Ask here and someone or other will help you get your system running.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Bug in Decimal??

2014-05-19 Thread Mark Dickinson
 isp.com> writes:

> I've tested on all platforms I know of and confirmed it. The wrong digit
> occurs in the middle of the number.  Propagation error would have a bad digit
> near the end, and garbage after that. Here there's a perfect sequence of
> numbers, but with one single digit changed in the middle of the number.  No
> error propagation in a series expansion can do that.

I can see how it might be surprising if you don't think about it too hard, but
I'm afraid that you're wrong here: error propagation is *exactly* what's
causing the effects you're seeing.

Here's another way of looking at it: if you truncate the Taylor series about 0
for (1 + x) / (1 - x) to k (>= 1) terms, you get the polynomial (1 + x - 2x^k)
/ (1 - x).  For example, taking k to be 3, we're getting (1 + x - 2x^3) / (1 -
x).  Given that the particular value of x you're testing with has the form
10**, rounding your intermediate result to the working precision has
exactly the effect of truncating the series at some k.

Now you can compute and compare (by hand, via Wolfram alpha, or however you
like) the Taylor series expansions for log((1 + x) / (1 - x)) and log((1 + x -
2x^3) / (1 - x)).  For the first you'll see:

  2x + 2/3 x^3  + 2/5 x^5 - 2/7 x^7 + 2/9 x^9 - ...

and for the second you'll get:

  2x - 4/3 x^3 + 2 x^4 - 8/5 x^5 + 16/7 x^7 - ...

The difference between the two series is:

  -2x^3 + 2x^4 - 2x^5 + 2x^7 - 4x^8 + ...

So again with x a small power of 10, you're going to see a single-digit error
from the -2x^3 term, and another single-digit error further along from
the 2x^3 term, and so on.

Here's a simpler example of the same phenomenon.  Note how the error propagation
leads to a single incorrect digit in the *middle* of the digit string.

Python 3.4.0 (default, Mar 25 2014, 11:07:05) 
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from decimal import Decimal
>>> x = Decimal('1e-15')
>>> y = (1 - 2 * x) / (1 - x)
>>> 2 * x + (y - 1) * (1 - x)  # Mathematically, expect to get 'x' back.
Decimal('1.001E-15')
>>> x
Decimal('1E-15')

-- 
Mark


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


Re: Loading modules from files through C++

2014-05-19 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
Cython is out of question since link time dependencies has to be kept at
an utmost minimum. An concerning doing things from python code it's
simply not possible (or I don't know how this should work). Python is
fully embedded including any file actions (virtual file system). The
launch comes from C++ land. No interpreter is involved. The main work is
done outside Python and only dropped in python to do higher logic. This
also means the very first python code run requires a C++ script file
loading before this first code can ever run. I can't run code that
doesn't yet exist in the reach of the python VM. That's the main
problem. This is why I need to figure out how to push that first code
into Python in a way I can construct an object (from a predefined
class). From there on all calls into Python land are solely done trough
function calls on this one object obtained in the beginning. I see no
other way to handle the problem.

-- 
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


Python CGI

2014-05-19 Thread Christian
Hi,

I'd like to use Python for CGI-Scripts. Is there a manual how to setup
Python with Fast-CGI? I'd like to make sure that Python scripts aren't
executed by www-user, but the user who wrote the script.

-- 
Gruß,
Christian
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python CGI

2014-05-19 Thread Burak Arslan

On 05/19/14 21:32, Christian wrote:
> Hi,
>
> I'd like to use Python for CGI-Scripts. Is there a manual how to setup
> Python with Fast-CGI?

Look for Mailman fastcgi guides.

Here's one for gentoo, but I imagine it'd be easily applicable to other
disros:
https://www.rfc1149.net/blog/2010/12/30/configuring-mailman-with-nginx-on-gentoo/

hth,
burak
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and Math

2014-05-19 Thread wxjmfauth
Le lundi 19 mai 2014 18:09:24 UTC+2, Rustom Mody a écrit :
> On Monday, May 19, 2014 8:26:11 PM UTC+5:30, jmf 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 know Python since v 1.5.6 !
> 
> 
> 
> > I'm able to write "Numerical Recipes" in Python,
> 
> > (I did it in Py2 and Py3), I'm unable to install
> 
> > a piece of software (like Python) to work with.
> 
> 
> 
> So what're you waiting for?
> 
> Ask here and someone or other will help you get your system running.




You know. You are right. I can only agree. Just ask.
The problem I see, is why I only "succeded" to just find
on Google, so many people who are just asking...
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and Math

2014-05-19 Thread Tim Golden

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.

What problems are you experiencing?

TJG

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


Need help with executing DB query in two different places in a test

2014-05-19 Thread Sunitha Byju
I am trying to automate an ecom website. I need to run DB query after placing 
each order.  I don't know how to run different queries after each order.  Can 
someone help me out with having queries after each order submission or test?  
If you notice, I'm calling self.database_verification() after test 1.  So for 
the second test the query would be different, something like, Select * from 
PORTFOLIO_ORDER where MEMBER = 'USA' AND SYMBOL = 'TOP' OR SYMBOL = 'Sweater.  
Basically for the sequence of orders, i would have different queries.  So what 
is the best way to write the code?


class OrderInputScreen(unittest.TestCase):
def setUp(self):self.driver = webdriver.Firefox()driver = 
self.driver
driver.get("http://testserver:8080/OrderInputScreen/login#/";)
driver.maximize_window()
def database_verification(self):con = 
cx_Oracle.connect('user/user@testDB123')  cur = con.cursor()  
cur.execute("Select * from US_ORDER where SYMBOL = 'TOP' and SIZE = 'M'")   
for result in cur:  print result[2:8]   cur.close() 
#USA single Order and verification
def __test_single_order(self):driver = self.driverelem = 
driver.find_element_by_name("username")elem.send_keys("TEST")  elemPassword 
= driver.find_element_by_name("password")  elemPassword.send_keys("TEST")  
elem.submit()member = 
driver.find_element_by_xpath("//form/div/dl/dd[1]/input")member.click() 
   member.send_keys("USA")PayType = driver.find_element_by_xpath 
("//form/div/dl/dd[2]/input")PayType.click()
PayType.send_keys("USD")clickPayType = driver.find_element_by_xpath 
("//form/div/dl/dd/ul/li/a")clickPayType.click()Symbol =  
driver.find_element_by_xpath ("//form/div/dl/dd[3]/input")
Symbol.click()Symbol.send_keys("TOP")Quantity = 
driver.find_element_by_name ("quantity")Quantity.click()
Quantity.send_keys("10")Price = driver.find_element_by_name ("price")   
 Price.click()Price.send_keys("56.99")Size = 
driver.find_element_by_xpath ("//form/div/dl/dd[6]/select/option[text()='M']")  
  Size.click()SubmitButton = driver.find_element_by_xpath 
("//form/div/dl/dd[11]/div[2]")SubmitButton.click()   
ActualOrderMsg = driver.find_element_by_xpath ("//span/p").text print 
ActualOrderMsgtextPresent = driver.find_element_by_xpath 
("//span/p[contains(text(), 'Successfuly added to processing!')]")
self.database_verification()   
#USA -multiple orders and verification
def test_Multiple_order(self):  #Order0
driver = self.driverelem = 
driver.find_element_by_name("username")  elem.send_keys("TEST")  
elemPassword = driver.find_element_by_name("password")  
elemPassword.send_keys("TEST")  elem.submit()member = 
driver.find_element_by_xpath("//form/div/dl/dd[1]/input")member.click() 
   member.send_keys("USA")PayType = driver.find_element_by_xpath 
("//form/div/dl/dd[2]/input")PayType.click()
PayType.send_keys("USD")clickPayType = driver.find_element_by_xpath 
("//form/div/dl/dd/ul/li/a")clickPayType.click()Symbol =  
driver.find_element_by_xpath ("//form/div/dl/dd[3]/input")
Symbol.click()Symbol.send_keys("TOP")Quantity = 
driver.find_element_by_name ("quantity")Quantity.click()
Quantity.send_keys("1")Price = driver.find_element_by_name ("price")
Price.click()Price.send_keys("16.99")Size = 
driver.find_element_by_xpath ("//form/div/dl/dd[6]/select/option[text()='S']")  
  Size.click()SubmitButton = driver.find_element_by_xpath 
("//form/div/dl/dd[11]/div[2]")SubmitButton.click()
ActualOrderMsg = driver.find_element_by_xpath ("//span/p").text print 
ActualOrderMsgtextPresent = driver.find_element_by_xpath 
("//span/p[contains(text(), 'Successfuly added to processing!')]"   
 #Order1 AddOrder1 = 
driver.find_element_by_xpath("//div/div[2]/form/div[2]/button[1]")  
AddOrder1.click()member = 
driver.find_element_by_xpath("//form/div/dl/dd[1]/input")member.click() 
   member.send_keys("USA")PayType = driver.find_element_by_xpath 
("//form/div/dl/dd[2]/input")PayType.click()
PayType.send_keys("USD")clickPayType = driver.find_element_by_xpath 
("//form/div/dl/dd/ul/li/a")clickPayType.click()Symbol =  
driver.find_element_by_xpath ("//form/div/dl/dd[3]/input")
Symbol.click()Symbol.send_keys("Sweater")Quantity = 
driver.find_element_by_name ("quantity")Quantity.click()
Quantity.send_keys("2")Price = driver.find_element_by_name ("price")
Price.click()Price.send_keys("26.99")Size = 
driver.find_element_by_xpath ("//form/div/dl/dd[

Re: Problem in writing demands to the xml file

2014-05-19 Thread Rhodri James

On Mon, 19 May 2014 14:42:02 +0100,  wrote:

The problem I have is in writing the demands. I generate the necessary  
stuff for it but when I try and append it, it doesn't seem to work. I'd  
be glad to share my files if you need them. Could you please help me fix  
this?


When you say, "It doesn't seem to work," what do you mean?  What are you
expecting it to do?  What does it actually do?  Is there a traceback?

--
Rhodri James *-* Wildebeest Herder to the Masses
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python and Math

2014-05-19 Thread Cameron Simpson

On 19May2014 12:07, wxjmfa...@gmail.com  wrote:

Le lundi 19 mai 2014 18:09:24 UTC+2, Rustom Mody a écrit :

> 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.

[...]


So what're you waiting for?
Ask here and someone or other will help you get your system running.


You know. You are right. I can only agree. Just ask.
The problem I see, is why I only "succeded" to just find
on Google, so many people who are just asking...


I have the same core skill: finding others with my question, not others with my 
needed answer. That the SO can usually find others with the answer when I 
cannot shows that there may be a mindset issue here.


Cheers,
Cameron Simpson 

Did microsoft take you today? Where do you want them to go?
--
https://mail.python.org/mailman/listinfo/python-list


RE: Exception problem with module

2014-05-19 Thread Joseph L. Casale
>> Well I am not sure what advantage this has for the user, not my code as
>> I don't advocate the import to begin with it, its fine spelled as it was
>> from where it was... 
>
> The advantage for the user is:

/snip

Hey Steven,
Sorry for the late reply (travelling). My comment wasn't clear, I was ranting 
against
the import of the exception in the second module, non the less how it was 
imported
and not why it was not ok.

Basically, it was no better than leaving it where it was, spelled as it was and
requiring the user to import it from where it was defined. It turned out to be
some faulty logic in the second module where the __setattr__ call was made
that was preventing it from being set...

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


Clip Raster Image Pair by Overlapping Area using Python

2014-05-19 Thread mikejohnryan08
Hello,

I have a set of aerial images which I am trying to clip by their overlapping 
areas, for use in a more involved program I am writing with PIL.

What would be the best method with Python to extract the overlapping area from 
a pair of images?  I know there are libraries out there that could do this, but 
I couldn't find any so far.

I need to execute this through Python as it will be part of a batch processing 
script.  Any ideas/advice would be great!  Thanks so much in advance. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Clip Raster Image Pair by Overlapping Area using Python

2014-05-19 Thread Chris Angelico
On Tue, May 20, 2014 at 11:05 AM,   wrote:
> I have a set of aerial images which I am trying to clip by their overlapping 
> areas, for use in a more involved program I am writing with PIL.
>
> What would be the best method with Python to extract the overlapping area 
> from a pair of images?  I know there are libraries out there that could do 
> this, but I couldn't find any so far.
>

The problem is that they won't absolutely perfectly match, so you need
some sort of similarity check. That's hard - very hard. I suggest you
find a stand-alone program that will do that part of the job; it'll be
easier than finding a Python library for it.

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


Re: Clip Raster Image Pair by Overlapping Area using Python

2014-05-19 Thread mikejohnryan08
On Monday, May 19, 2014 9:17:05 PM UTC-4, Chris Angelico wrote:
> On Tue, May 20, 2014 at 11:05 AM,   wrote:
> 
> > I have a set of aerial images which I am trying to clip by their 
> > overlapping areas, for use in a more involved program I am writing with PIL.
> 
> >
> 
> > What would be the best method with Python to extract the overlapping area 
> > from a pair of images?  I know there are libraries out there that could do 
> > this, but I couldn't find any so far.
> 
> >
> 
> 
> 
> The problem is that they won't absolutely perfectly match, so you need
> 
> some sort of similarity check. That's hard - very hard. I suggest you
> 
> find a stand-alone program that will do that part of the job; it'll be
> 
> easier than finding a Python library for it.
> 
> 
> 
> ChrisA


Chris,

Thanks for your response.  For my purpose, the images won't have to be 
'perfectly' matched, but hopefully as close as possible.  Registration 
algorithms won't work for this reason--the images aren't identical to each 
other because of the different perspectives.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Clip Raster Image Pair by Overlapping Area using Python

2014-05-19 Thread Chris Angelico
On Tue, May 20, 2014 at 11:30 AM,   wrote:
> Thanks for your response.  For my purpose, the images won't have to be 
> 'perfectly' matched, but hopefully as close as possible.  Registration 
> algorithms won't work for this reason--the images aren't identical to each 
> other because of the different perspectives.
>

Yeah, and that's what makes it hard. This is outside my area of
expertise, so all I can say is that these sorts of programs do exist,
but restricting yourself to Python libraries may make your life
unnecessarily hard.

On a separate topic, you're posting through Google Groups with its
abhorrent bugs. Can you please either edit your posts before sending
(removing the blank lines, wrapping to a sane width, and trimming the
quoted text), or switch to a better newsreader (or the mailing list)?
You'll find that a lot of people here either filter your message to
/dev/null automatically, or take one look and just move on to the next
post. Remember, never offend people with form when you can offend them
with substance :)

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


Re: Python CGI

2014-05-19 Thread Tim Chase
On 2014-05-19 20:32, Christian wrote:
> I'd like to use Python for CGI-Scripts. Is there a manual how to
> setup Python with Fast-CGI? I'd like to make sure that Python
> scripts aren't executed by www-user, but the user who wrote the
> script.

While Burak addressed your (Fast-)CGI issues, once you have a
test-script successfully giving you output, you can use the
standard-library's getpass.getuser() function to tell who your script
is running as.

-tkc


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


Re: Loading modules from files through C++

2014-05-19 Thread Michael Torrie
On 05/17/2014 08:01 AM, Stefan Behnel wrote:
> please avoid top-posting.

Trimming quoted material where appropriate is always welcome too!

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


Re: Python Internet Database

2014-05-19 Thread Joshua Landau
On 9 May 2014 22:06, Chris Angelico  wrote:
> On Sat, May 10, 2014 at 6:45 AM,   wrote:
>> 2 - Jit compiler for using from a web server. I mean, one has a web server 
>> running under Apache in a hosting service like Hostgator, Daddy Host or 
>> another inexpensive service. I decide to run a few applications in Racket, 
>> but the application  requires number crunching. I install the Jit Racket in 
>> the hosting service, and call it from my dynamic generated page. My programs 
>> will run almost at the speed of optimised C.
>>
>
> For number crunching, you can use the numpy library, which is highly
> efficient. For general JIT compilation of actual Python code, PyPy
> will do that. AFAIK there's no standard module for that, though.

There's also Numba for JIT compilation of Numpy code inside CPython.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Clip Raster Image Pair by Overlapping Area using Python

2014-05-19 Thread Rustom Mody
On Tuesday, May 20, 2014 7:13:42 AM UTC+5:30, Chris Angelico wrote:

> On a separate topic, you're posting through Google Groups with its
> abhorrent bugs. Can you please either edit your posts before sending
> (removing the blank lines, wrapping to a sane width, and trimming the
> quoted text), or switch to a better newsreader (or the mailing list)?
> You'll find that a lot of people here either filter your message to
> /dev/null automatically, or take one look and just move on to the next
> post. Remember, never offend people with form when you can offend them
> with substance :)

This https://wiki.python.org/moin/GoogleGroupsPython
shows the problems and possible solutions

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


Re: Psycopg2 : error message.

2014-05-19 Thread Tim Roberts
dandrigo  wrote:
>
>I'm writing a python script for a web service. I have to connect to my
>postgres/postgis databases via Psycopg2. 
>
>I writed a little first script just to connect to my pg/postgis db and drop
>a test db. 
>
>But when i execute the python file, i have several error messages. 

Really, this wouldn't have been so hard to figure out if you had read the
documentation.

 conn=psycopg2.connect("dbname='busard_test' user='laurent'
host='localhost' password='cactus'")

Psycopg2 has two ways to specify the parameters.  You can either do them as
individual Python parameters, in which case each parameter is a string that
needs to be quited, OR you can use a single connection string, in which
case you do NOT quote the individual parameters.

So, you can either do this:

conn=psycopg2.connect("dbname=busard_test user=laurent host=localhost
password=cactus")

or do this:

 conn=psycopg2.connect(database='busard_test', user='laurent',
host='localhost', password='cactus'")
-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Need help with executing DB query in two different places in a test

2014-05-19 Thread Tim Roberts
Sunitha Byju  wrote:
>
>I am trying to automate an ecom website. I need to run DB query after
>placing each order.  I don't know how to run different queries after
>each order.  Can someone help me out with having queries after each
>order submission or test?  

Well, what's your primary key?  After each test, you need to fetch the
record that should have been created, and verify that the fields contain
the information you provided.  For example, if you're doing a shopping
cart, then you must have some kind of key associated with this session. So,
you could just fetch all of the record for the session after each
transaction, and make sure the contents match what you expect.
-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.
-- 
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-19 Thread Rustom Mody
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
?
-- 
https://mail.python.org/mailman/listinfo/python-list