Re: PyWart: Poor Documentation Examples

2015-01-10 Thread Ethan Furman
On 01/10/2015 06:32 PM, Steven D'Aprano wrote: > > If you treat your readers as idiots, only idiots will read your writing. Or the morbidly curious, which I presume covers your case (along with a handful of others ;) . -- ~Ethan~ signature.asc Description: OpenPGP digital signature -- https

Re: PyWart: Poor Documentation Examples

2015-01-10 Thread Devin Jeanpierre
On Sat, Jan 10, 2015 at 6:32 PM, Steven D'Aprano wrote: > At the point you are demonstrating reduce(), if the reader doesn't > understand or can't guess the meaning of "n = 4", "n+1" or range(), they > won't understand anything you say. > > Teachers need to understand that education is a process o

Re: PyWart: Poor Documentation Examples

2015-01-10 Thread Rustom Mody
On Sunday, January 11, 2015 at 8:02:50 AM UTC+5:30, Steven D'Aprano wrote: > Rick Johnson wrote: > > > > > > EXAMPLE 1: "Reducing Comprehension" > > https://docs.python.org/2/howto/doanddont.html#using-the-batteries > >

Re: Can numpy do better than this?

2015-01-10 Thread Nobody
On Thu, 08 Jan 2015 09:56:50 -0800, Rustom Mody wrote: > Given a matrix I want to shift the 1st column 0 (ie leave as is) 2nd by > one place, 3rd by 2 places etc. > > This code works. > But I wonder if numpy can do it shorter and simpler. def shiftcols(mat): iy,ix = np.indices(mat.shape)

Re: Generate jpg files using line length (pixels) and orientation (degrees)

2015-01-10 Thread Denis McMahon
On Fri, 09 Jan 2015 09:49:25 -0800, semeon.risom wrote: > Thank you for the help btw. I think I'm close to a solution, but I'm > having issue feeding the coordinates from my csv file into the formula. > > This is the error I get: > Traceback (most recent call last): > File "C:\Users\Owner\Deskt

Help running python tests on MIPS

2015-01-10 Thread Ramesh
I am new to python. I downloaded python 2.7.8 tarball, successfully cross compiled it, to make sure that the subsystems are correctly built, I tried running the python test scripts on the MIPS based target board. I hit the below error while I do so, == # /opt/Python-2.7.8/bin/python2.7 /opt/Pyt

Re: Syntax error

2015-01-10 Thread Steven D'Aprano
Abdul Abdul wrote: > Hello, > > I have the following program that employs the dcm2jpg.exe software: > > import os > os.system(“dcm2jpg.exe IM-0004-0004.dcm”) > exit > > When I tried to run it, I got the following error: > > SyntaxError: Non-ASCII character '\xe2' in file dicomjpg.py on line 2,

Re: PyWart: Poor Documentation Examples

2015-01-10 Thread Steven D'Aprano
Rick Johnson wrote: > > EXAMPLE 1: "Reducing Comprehension" > https://docs.python.org/2/howto/doanddont.html#using-the-batteries > > > >

Re: Syntax error

2015-01-10 Thread Dave Angel
On 01/10/2015 04:36 PM, Abdul Abdul wrote: Hello, I have the following program that employs the dcm2jpg.exe software: import os os.system(“dcm2jpg.exe IM-0004-0004.dcm”) exit When I tried to run it, I got the following error: SyntaxError: Non-ASCII character '\xe2' in file dicomjpg.py on line

Re: Syntax error

2015-01-10 Thread Peter Otten
Abdul Abdul wrote: > Hello, > > I have the following program that employs the dcm2jpg.exe software: > > import os > os.system(“dcm2jpg.exe IM-0004-0004.dcm”) > exit > > When I tried to run it, I got the following error: > > SyntaxError: Non-ASCII character '\xe2' in file dicomjpg.py on line 2,

Re: Syntax error

2015-01-10 Thread Joel Goldstick
On Sat, Jan 10, 2015 at 4:36 PM, Abdul Abdul wrote: > > Hello, > > I have the following program that employs the dcm2jpg.exe software: > > import os > os.system(“dcm2jpg.exe IM-0004-0004.dcm”) > exit > It may be that your actual code has ascii quote characters, but you have sent your question as r

Syntax error

2015-01-10 Thread Abdul Abdul
Hello, I have the following program that employs the dcm2jpg.exe software: import os os.system(“dcm2jpg.exe IM-0004-0004.dcm”) exit When I tried to run it, I got the following error: SyntaxError: Non-ASCII character '\xe2' in file dicomjpg.py on line 2, but no en coding declared; see http://pyt

Re: PyWart: Poor Documentation Examples

2015-01-10 Thread Mark Lawrence
On 10/01/2015 18:26, Chris Angelico wrote: On Sun, Jan 11, 2015 at 5:05 AM, Rick Johnson wrote: EXAMPLE 1: "Reducing Comprehension" https://docs.python.org/2/howto/doanddont.html#using-the-batteries ==

[RELEASE] ‘python-daemon’ version 2.0.1 released

2015-01-10 Thread Ben Finney
Howdy all, I am pleased to announce the release of version 2.0.1 of the ‘python-daemon’ library. The current release is always available at https://pypi.python.org/pypi/python-daemon/>. The project's forums and VCS are hosted at Alioth https://alioth.debian.org/projects/python-daemon/>. Signif

Re: PyWart: Poor Documentation Examples

2015-01-10 Thread Chris Angelico
On Sun, Jan 11, 2015 at 5:05 AM, Rick Johnson wrote: > > EXAMPLE 1: "Reducing Comprehension" > https://docs.python.org/2/howto/doanddont.html#using-the-batteries > 1) Why are

PyWart: Poor Documentation Examples

2015-01-10 Thread Rick Johnson
EXAMPLE 1: "Reducing Comprehension" https://docs.python.org/2/howto/doanddont.html#using-the-batteries #

Re: ftfy: fixes text for you

2015-01-10 Thread Joel Goldstick
On Sat, Jan 10, 2015 at 10:50 AM, Mark Lawrence wrote: > I came across ftfy via this post http://ianozsvald.com/2015/01/ > 10/a-first-approach-to-automatic-text-data-cleaning/ and thought others > here might be interested in it, so here's the direct link > http://ftfy.readthedocs.org/en/latest/.

Re: Python : writing to a file

2015-01-10 Thread Steven D'Aprano
Ganesh Pal wrote: > Throttling-1# cat test_2.txt Are you running these scripts as root? That could be a bad idea. If you have a bug in your code, as often happens when coding, who knows what it might do. E.g. if you put in the wrong pathname, you could overwrite important files. You should always

Re: [OT] x**y == y**x

2015-01-10 Thread Peter Pearson
On Fri, 09 Jan 2015 23:41:15 +0200, Marko Rauhamaa wrote: > Peter Pearson : > >> If you've never looked at the set of reals (x,y) satisfying x**y == >> y**x, it's worth a visit. > > Thanks, it was. The graph's something like this: [snip] > > Where can I read more on the topic? Sorry, I don't know

ftfy: fixes text for you

2015-01-10 Thread Mark Lawrence
I came across ftfy via this post http://ianozsvald.com/2015/01/10/a-first-approach-to-automatic-text-data-cleaning/ and thought others here might be interested in it, so here's the direct link http://ftfy.readthedocs.org/en/latest/. -- My fellow Pythonistas, ask not what our language can do fo

Re: Python : writing to a file

2015-01-10 Thread Dave Angel
On 01/10/2015 10:14 AM, Ganesh Pal wrote: Please provide you input on the below questions: For each new thread, you should specify at a minimum your Python version and OS. it frequently matters, and it's better to specify than to have everyone try to guess. I'll assume Python 2.7 and Linux

Re: Playing with threads

2015-01-10 Thread Ganesh Pal
Thanks I read subprocess module this answered most of my question ,thanks a lot for the replies On Thu, Jan 8, 2015 at 9:46 AM, Terry Reedy wrote: > On 1/7/2015 9:00 PM, Ganesh Pal wrote: > >> Hi friends, >> >> I'm trying to use threads to achieve the below work flow >> >> 1. Start a process ,

Python : writing to a file

2015-01-10 Thread Ganesh Pal
Please provide you input on the below questions: (a) I was expecting the string i.e day of week , example Saturday to be written in the file. what Iam I missing in the below program ? Program: #!/usr/bin/python import time f = open ('test_2.txt','w+b') DAY = time.strftime("%A") f.write(DAY)

Re: Why do the URLs of posts here change?

2015-01-10 Thread Skip Montanaro
On Sat, Jan 10, 2015 at 3:41 AM, Terry Reedy wrote: > The post could be replaced by a placeholder "This message deleted' > > and the >> >> archive regenerated. That changes the counter for every message after > > > A placeholder should avoid that. I suspect (though don't know for certain) that j

Re: OSError: [WinError 10022] An invalid argument was supplied in udp python file

2015-01-10 Thread Kev Dwyer
contro opinion wrote: > When i test an udp.py file on server and client in python34. > > > #!/usr/bin/env python > import socket, sys > s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) > MAX = 65535 > PORT = 1060 > if sys.argv[1:] == ['server']: > s.bind(('127

[RELEASE] ‘python-daemon’ version 2.0 released

2015-01-10 Thread Ben Finney
Howdy all, I am pleased to announce the release of version 2.0 of the ‘python-daemon’ library. The current release is always available at https://pypi.python.org/pypi/python-daemon/>. The project's forums and VCS are hosted at Alioth https://alioth.debian.org/projects/python-daemon/>. Signific

Re: Decimals and other numbers

2015-01-10 Thread alister
On Fri, 09 Jan 2015 19:57:20 -0800, Devin Jeanpierre wrote: > On Fri, Jan 9, 2015 at 7:05 PM, Gregory Ewing > wrote: >> It's far from clear what *anything* multiplied by itself zero times >> should be. >> >> A better way of thinking about what x**n for integer n means is this: >> Start with 1, an

Re: Why do the URLs of posts here change?

2015-01-10 Thread Terry Reedy
On 1/9/2015 7:04 AM, Skip Montanaro wrote: Posts on this newsgroup/mailing list are archived on the web, but the URLs seem to change, which leaves dead links if you search for things. Steven, It's a known issue, but one which appears to be somewhat unavoidable, at least in Mailman 2.x. The pro

Re: Non-unique dirs in sys.path

2015-01-10 Thread Terry Reedy
On 1/9/2015 8:14 AM, Gisle Vanem wrote: I'm having some trouble understanding why my Python 2.7.9 has the '%PYTHONHOME%\lib\site-packages' listed multiple times. I cooked up this .bat file to demonstrate the issue: @echo off setlocal set PYTHONPATH= python -c "import sys; [sys.stdout

Re: [ANN] EasyGUI_Qt version 0.9

2015-01-10 Thread Chris Warrick
On Sat, Jan 10, 2015 at 2:02 AM, André Roberge wrote: > On Friday, 9 January 2015 19:09:15 UTC-4, stephen...@gmail.com wrote: >> One issue is the format returned for the calendar selection. For today, the >> string returned is "Fri Jan 9 2015". My script needs to convert the date to >> a dateti

Re: Begginer Question , what i need for web app and site

2015-01-10 Thread memilanuk
On 01/09/2015 05:53 AM, meiry...@gmail.com wrote: Hello all coming from java and c++ now going with python what setup do i need to run full python stack for web application . what i need is web framework and back-end . what usually be in the java world tomcat and servlets or jsp and pure java ba

OSError: [WinError 10022] An invalid argument was supplied in udp python file

2015-01-10 Thread contro opinion
When i test an udp.py file on server and client in python34. #!/usr/bin/env python import socket, sys s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) MAX = 65535 PORT = 1060 if sys.argv[1:] == ['server']: s.bind(('127.0.0.1', PORT)) print('Listening at