Re: Is there a quick & accurate way to test a python install?

2012-12-16 Thread Gene Heskett
On Sunday 16 December 2012 01:33:35 Terry Reedy did opine:

> On 12/15/2012 9:59 PM, Gene Heskett wrote:
> > This is 2.6, on ubuntu-10.04.4 LTS
> > 
> > gene@lathe:/usr/lib/python2.6/test$ python -m test.regrtest
> 
> That should be the right incantation for 2.6.
> 
> > test_grammar
> > test_grammar skipped -- No module named test_grammar
> > test_opcodes
> > test_opcodes skipped -- No module named test_opcodes
> > test_dict
> > test_dict skipped -- No module named test_dict
> > test_builtin
> 
> You appear to have some of /Lib/test/ present, including
> Lib/test/regrtest.py, but not move of the test_xxx.py files. I do not
> know what is normal for an Ubuntu distribution. On Windows, I believe it
> is all or nothing.
/usr/lib/test?
gene@lathe:/usr/lib/python2.6$ locate lib/test
/opt/libreoffice3.5/program/python-core-2.6.1/lib/idlelib/testcode.py
/usr/lib/pymodules/python2.6/launchpadlib/testing
/usr/lib/pymodules/python2.6/launchpadlib/tests
/usr/lib/pymodules/python2.6/launchpadlib/testing/__init__.py
/usr/lib/pymodules/python2.6/launchpadlib/testing/__init__.pyc
/usr/lib/pymodules/python2.6/launchpadlib/testing/helpers.py
/usr/lib/pymodules/python2.6/launchpadlib/testing/helpers.pyc
/usr/lib/pymodules/python2.6/launchpadlib/tests/__init__.py
/usr/lib/pymodules/python2.6/launchpadlib/tests/__init__.pyc
/usr/lib/pymodules/python2.6/launchpadlib/tests/test_launchpad.py
/usr/lib/pymodules/python2.6/launchpadlib/tests/test_launchpad.pyc

There are half a dozen or more branches of the python tree that claim to 
have test things, but the universal answer is:

gene@lathe:/usr/lib/python2.6$ cd /usr/share/pyshared/numpy/lib/tests
gene@lathe:/usr/share/pyshared/numpy/lib/tests$ python -m test -uall
/usr/bin/python: test is a package and cannot be directly executed

I have installed several more python 'likely suspects' but have not changed 
a thing in the results.
> 
> > ImportError: cannot import name test_timeout
> 
> I have no idea why this one gave an exception rather than a skip.


Cheers, Gene
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page:  is up!
Human kind cannot bear very much reality.
-- T. S. Eliot, "Four Quartets: Burnt Norton"
I was taught to respect my elders, but its getting 
harder and harder to find any...
-- 
http://mail.python.org/mailman/listinfo/python-list


python-daemon

2012-12-16 Thread n8felton
Hello all. Got a question for anyone out there that is willing to help. Looking 
to make a Python Daemon, Google searches lead me to 
http://pypi.python.org/pypi/python-daemon. My question is 2 part. 1) pip 
install python-daemon downloads version 1.6, but the site states that 1.5.5 is 
the latest version. Anyone know why this is? 2) With python-daemon having been 
last uploaded in 2010, is anyone aware if there is a better implementation for 
python daemons, or is this still considered current?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python-daemon

2012-12-16 Thread rurpy
On 12/16/2012 08:26 AM, n8fel...@gmail.com wrote:
> Hello all. Got a question for anyone out there that is willing to
> help. Looking to make a Python Daemon, Google searches lead me to
> http://pypi.python.org/pypi/python-daemon. My question is 2 part. 1)
> pip install python-daemon downloads version 1.6, but the site states
> that 1.5.5 is the latest version. Anyone know why this is? 2) With
> python-daemon having been last uploaded in 2010, is anyone aware if
> there is a better implementation for python daemons, or is this still
> considered current?

The author of the python-daemon package I believe is Ben Finney, 
who sometimes posts here.  Sadly, I think he is a member of a group 
of people here who say they filter out and ignore all messages posted 
from Google Groups (which would include yours and mine).  

If you get no other good answers here, you could try emailing him
directly at ben+pyt...@benfinney.id.au, which is the address on 
a recent post from him.

Or you could repost from other than GG if you don't mind being a 
tool of someone else's political agenda.
-- 
http://mail.python.org/mailman/listinfo/python-list


Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread Darrien Glasser
Hey guys, I'm working on a Python rock paper scissors (lizard spock) game, and 
the beginning is complete. After I finished it, I thought, "You know what? I 
think I can make this even better, and add a score counter." And so I did.

The problem is that it doesn't seem to actually keep track of score. In fact it 
always keeps the score at 0 for both players. It's fully functional otherwise, 
but it's bothering me that I can't get it to work. 

Currently using Windows Python 32 bit v2.6.8

Download of the code here:

https://www.box.com/s/2lupxeyk5jvsxs0zkdfb

Copy of the code here:

http://pastebin.com/MNdgiuSY

Thanks in advance for your help...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread Kwpolska
On Sun, Dec 16, 2012 at 6:00 PM, Darrien Glasser
 wrote:
> Hey guys, I'm working on a Python rock paper scissors (lizard spock) game, 
> and the beginning is complete. After I finished it, I thought, "You know 
> what? I think I can make this even better, and add a score counter." And so I 
> did.
>
> The problem is that it doesn't seem to actually keep track of score. In fact 
> it always keeps the score at 0 for both players. It's fully functional 
> otherwise, but it's bothering me that I can't get it to work.
>
> Currently using Windows Python 32 bit v2.6.8
>
> Download of the code here:
>
> https://www.box.com/s/2lupxeyk5jvsxs0zkdfb
>
> Copy of the code here:
>
> http://pastebin.com/MNdgiuSY
>
> Thanks in advance for your help...
> --
> http://mail.python.org/mailman/listinfo/python-list

winx = winx + 1
winy = winy + 1

PS. please do not use pastebin.com.
-- 
Kwpolska 
stop html mail  | always bottom-post
www.asciiribbon.org | www.netmeister.org/news/learn2quote.html
GPG KEY: 5EAAEA16
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: problem with web browser module

2012-12-16 Thread Eric Johansson

On Saturday, December 15, 2012 9:14:25 PM, Terry Reedy wrote:


I believe this worked with Firefox the last time I tested. I just read
the docs. Never tried IE. I believe details partly depend on browser.


thank you Terry. I will try with Firefox  but the main reason I'm using 
IE is simply because nuance has created a module  to make the text 
areas speech recognition friendly. So I will do some more work to find 
out how to make IE do what I needed it to do.


thank you again.


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


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread Darrien Glasser
Awesome thanks, and sounds good. 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pexpect and buffering

2012-12-16 Thread jim . hefferon
Sorry to reply to my own post, but I believe I have my answer and I want to 
help anyone who might google their way here: I need to change PROMPT and 
PROMPT_CONTINUE to be regular expressions, for instance by escaping the periods.


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


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread rurpy
> Hey guys, I'm working on a Python rock paper scissors (lizard spock)
> game, and the beginning is complete. After I finished it, I thought,
> "You know what? I think I can make this even better, and add a score
> counter." And so I did.
> 
> The problem is that it doesn't seem to actually keep track of score.
> In fact it always keeps the score at 0 for both players. It's fully
> functional otherwise, but it's bothering me that I can't get it to
> work.
> 
> Currently using Windows Python 32 bit v2.6.8
> 
> Download of the code here:
> https://www.box.com/s/2lupxeyk5jvsxs0zkdfb
> 
> Copy of the code here:
> http://pastebin.com/MNdgiuSY

If you are keeping the score in 'winx 'and 'winy' then you are adding
one to the the values but not saving the results.

I think you want 

  winx = winx + 1

or more concisely,

  winx += 1
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread tbg
Actually, I was just going to post that it wasn't saving the scores. Great 
timing, I'll try it.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread rurpy
On Sunday, December 16, 2012 10:09:53 AM UTC-7, Kwpolska wrote:
>[...]
> PS. please do not use pastebin.com.

Why?
-- 
http://mail.python.org/mailman/listinfo/python-list


ANNOUNCE: pyparsing 1.5.7/2.0.0

2012-12-16 Thread Paul McGuire
With the release of version 2.0.0/1.5.7, pyparsing has now officially switched 
to Python 3.x support as its default installation environment. Python 2.x users 
can install the latest 1.5.7 release. (If you're using easy_install, do 
"easy_install pyparsing==1.5.7".)

I'm taking this opportunity to do some minor API tweaking too, renaming some 
operators and method names that I got wrong earlier (the old operators and 
methods are still there for now for compatibility, but they are deprecated to 
be removed in a future release):

- Added new operator '<<=', which will eventually replace '<<' for 
  storing the contents of a Forward(). '<<=' does not have the same
  operator precedence problems that '<<' does.

- 'operatorPrecedence' is being renamed 'infixNotation' as a better
  description of what this helper function creates. 'operatorPrecedence'
  is deprecated, and will be dropped entirely in a future release.

Several bug-fixes are included, plus several new examples, *and* an awesome 
example submitted by Luca DellOlio, for parsing ANTLR grammar definitions and 
implementing them with pyparsing objects.

---
Pyparsing wiki: pyparsing.wikispaces.com
SVN checkout: 
  (latest) svn checkout 
https://pyparsing.svn.sourceforge.net/svnroot/pyparsing/trunk pyparsing
  (1.5.x branch) svn checkout 
https://pyparsing.svn.sourceforge.net/svnroot/pyparsing/branches/pyparsing_1.5.x
 pyparsing
  
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread Kwpolska
On Sun, Dec 16, 2012 at 6:25 PM,   wrote:
> On Sunday, December 16, 2012 10:09:53 AM UTC-7, Kwpolska wrote:
>>[...]
>> PS. please do not use pastebin.com.
>
> Why?
> --
> http://mail.python.org/mailman/listinfo/python-list

http://news.ycombinator.com/item?id=2595066 should answer this very question.
-- 
Kwpolska 
stop html mail  | always bottom-post
www.asciiribbon.org | www.netmeister.org/news/learn2quote.html
GPG KEY: 5EAAEA16
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread tbg
On Sunday, December 16, 2012 12:16:34 PM UTC-5, ru...@yahoo.com wrote:
> > Hey guys, I'm working on a Python rock paper scissors (lizard spock)
> 
> > game, and the beginning is complete. After I finished it, I thought,
> 
> > "You know what? I think I can make this even better, and add a score
> 
> > counter." And so I did.
> 
> > 
> 
> > The problem is that it doesn't seem to actually keep track of score.
> 
> > In fact it always keeps the score at 0 for both players. It's fully
> 
> > functional otherwise, but it's bothering me that I can't get it to
> 
> > work.
> 
> > 
> 
> > Currently using Windows Python 32 bit v2.6.8
> 
> > 
> 
> > Download of the code here:
> 
> > https://www.box.com/s/2lupxeyk5jvsxs0zkdfb
> 
> > 
> 
> > Copy of the code here:
> 
> > http://pastebin.com/MNdgiuSY
> 
> 
> 
> If you are keeping the score in 'winx 'and 'winy' then you are adding
> 
> one to the the values but not saving the results.
> 
> 
> 
> I think you want 
> 
> 
> 
>   winx = winx + 1
> 
> 
> 
> or more concisely,
> 
> 
> 
>   winx += 1

I changed it so that it said winx += 1 etc. and it doesn't seem to save it. I 
also tried pulling the variables from the loop and making them global variables 
at the top.

The latter game me a traceback error when printing out the results. Any ideas?

http://puu.sh/1BCbG

Code Preview/Download

https://www.box.com/s/jiu0259nohx0kae2am57
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread Kwpolska
On Sun, Dec 16, 2012 at 6:44 PM, tbg  wrote:
> I changed it so that it said winx += 1 etc. and it doesn't seem to save it. I 
> also tried pulling the variables from the loop and making them global 
> variables at the top.
>
> The latter game me a traceback error when printing out the results. Any ideas?
>
> http://puu.sh/1BCbG
>
> Code Preview/Download
>
> https://www.box.com/s/jiu0259nohx0kae2am57
> --
> http://mail.python.org/mailman/listinfo/python-list

Put this on top of your function:

global winx, winy


PS. Why did you put those delays in?  They are useless.
-- 
Kwpolska 
stop html mail  | always bottom-post
www.asciiribbon.org | www.netmeister.org/news/learn2quote.html
GPG KEY: 5EAAEA16
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread tbg
On Sunday, December 16, 2012 12:50:18 PM UTC-5, Kwpolska wrote:
> On Sun, Dec 16, 2012 at 6:44 PM, tbg  wrote:
> 
> > I changed it so that it said winx += 1 etc. and it doesn't seem to save it. 
> > I also tried pulling the variables from the loop and making them global 
> > variables at the top.
> 
> >
> 
> > The latter game me a traceback error when printing out the results. Any 
> > ideas?
> 
> >
> 
> > http://puu.sh/1BCbG
> 
> >
> 
> > Code Preview/Download
> 
> >
> 
> > https://www.box.com/s/jiu0259nohx0kae2am57
> 
> > --
> 
> > http://mail.python.org/mailman/listinfo/python-list
> 
> 
> 
> Put this on top of your function:
> 
> 
> 
> global winx, winy
> 
> 
> 
> 
> 
> PS. Why did you put those delays in?  They are useless.
> 
> -- 
> 
> Kwpolska 
> 
> stop html mail  | always bottom-post
> 
> www.asciiribbon.org | www.netmeister.org/news/learn2quote.html
> 
> GPG KEY: 5EAAEA16

I figured it would be too much for the person playing the game. Getting 
attacked with lines of text and all. Although it is a pain developing with it.

And by the way, works perfectly now. Thanks for your help.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread Mitya Sirenef

On 12/16/2012 12:00 PM, Darrien Glasser wrote:
Hey guys, I'm working on a  Python rock paper scissors (lizard spock) game, and the beginning is 
complete. After I finished it, I thought, "You know what? I think I can 
make this even better, and add a score counter." And so I did.

>
> The problem is that it doesn't seem to actually keep track of score. 
In fact it always keeps the score at 0 for both players. It's fully 
functional otherwise, but it's bothering me that I can't get it to work.

>
> Currently using Windows Python 32 bit v2.6.8
>
> Download of the code here:
>
> https://www.box.com/s/2lupxeyk5jvsxs0zkdfb
>
> Copy of the code here:
>
> http://pastebin.com/MNdgiuSY
>
> Thanks in advance for your help...


I was actually thinking of making a simple rock paper scissors game so I
went ahead and cobbled it together, using a design with a class and
generally a structured approach.. It keeps the scores, too, and you can
set both players to be AI, or one to be AI, or both to be humans:

https://github.com/pythonbyexample/PBE/blob/master/code/rockpaper.py

(it needs python3 but can be easily changed to work with python2.x)


 - mitya

--
Lark's Tongue Guide to Python: http://lightbird.net/larks/

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


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread tbg
On Sunday, December 16, 2012 1:07:16 PM UTC-5, Mitya Sirenef wrote:
> On 12/16/2012 12:00 PM, Darrien Glasser wrote:
> 
> > Hey guys, I'm working on a  Python rock paper scissors (lizard spock) game, 
> > and the beginning is 
> 
> complete. After I finished it, I thought, "You know what? I think I can 
> 
> make this even better, and add a score counter." And so I did.
> 
>  >
> 
>  > The problem is that it doesn't seem to actually keep track of score. 
> 
> In fact it always keeps the score at 0 for both players. It's fully 
> 
> functional otherwise, but it's bothering me that I can't get it to work.
> 
>  >
> 
>  > Currently using Windows Python 32 bit v2.6.8
> 
>  >
> 
>  > Download of the code here:
> 
>  >
> 
>  > https://www.box.com/s/2lupxeyk5jvsxs0zkdfb
> 
>  >
> 
>  > Copy of the code here:
> 
>  >
> 
>  > http://pastebin.com/MNdgiuSY
> 
>  >
> 
>  > Thanks in advance for your help...
> 
> 
> 
> 
> 
> I was actually thinking of making a simple rock paper scissors game so I
> 
> went ahead and cobbled it together, using a design with a class and
> 
> generally a structured approach.. It keeps the scores, too, and you can
> 
> set both players to be AI, or one to be AI, or both to be humans:
> 
> 
> 
> https://github.com/pythonbyexample/PBE/blob/master/code/rockpaper.py
> 
> 
> 
> (it needs python3 but can be easily changed to work with python2.x)
> 
> 
> 
> 
> 
>   - mitya
> 
> 
> 
> -- 
> 
> Lark's Tongue Guide to Python: http://lightbird.net/larks/

Well there goes my hopes and dreams of being the first one to do that. Nice job 
by the way.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread Mitya Sirenef

On 12/16/2012 01:17 PM, tbg wrote:

On Sunday, December 16, 2012 1:07:16 PM UTC-5, Mitya Sirenef wrote:

On 12/16/2012 12:00 PM, Darrien Glasser wrote:


Hey guys, I'm working on a  Python rock paper scissors (lizard spock) game, and 
the beginning is

complete. After I finished it, I thought, "You know what? I think I can

make this even better, and add a score counter." And so I did.

  >

  > The problem is that it doesn't seem to actually keep track of score.

In fact it always keeps the score at 0 for both players. It's fully

functional otherwise, but it's bothering me that I can't get it to work.

  >

  > Currently using Windows Python 32 bit v2.6.8

  >

  > Download of the code here:

  >

  > https://www.box.com/s/2lupxeyk5jvsxs0zkdfb

  >

  > Copy of the code here:

  >

  > http://pastebin.com/MNdgiuSY

  >

  > Thanks in advance for your help...





I was actually thinking of making a simple rock paper scissors game so I

went ahead and cobbled it together, using a design with a class and

generally a structured approach.. It keeps the scores, too, and you can

set both players to be AI, or one to be AI, or both to be humans:



https://github.com/pythonbyexample/PBE/blob/master/code/rockpaper.py



(it needs python3 but can be easily changed to work with python2.x)





   - mitya



--

Lark's Tongue Guide to Python: http://lightbird.net/larks/

Well there goes my hopes and dreams of being the first one to do that. Nice job 
by the way.


Well you were the first :-)  I just did it to illustrate a modular 
approach, I think a

simple game like that is a great learning opportunity.

I posted an update with some small cleanups just now..

--
Lark's Tongue Guide to Python: http://lightbird.net/larks/

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


Pastebin [was: Trying to make a basic Python score counter in a game... will not count.]

2012-12-16 Thread Ian Kelly
On Sun, Dec 16, 2012 at 10:32 AM, Kwpolska  wrote:
> On Sun, Dec 16, 2012 at 6:25 PM,   wrote:
>> On Sunday, December 16, 2012 10:09:53 AM UTC-7, Kwpolska wrote:
>>>[...]
>>> PS. please do not use pastebin.com.
>>
>> Why?
>
> http://news.ycombinator.com/item?id=2595066 should answer this very question.

That seems to be a problem with a certain class of users that have
adopted Pastebin, not a problem with the site itself.  What do you
hope to accomplish by boycotting Pastebin for actual code pastes?
Even if the site were to cease to exist tomorrow, what is to stop the
hackers from simply switching to dpaste or gist like everybody else?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread tbg
Nice, will have to try it out...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is there a quick & accurate way to test a python install?

2012-12-16 Thread Terry Reedy

On 12/16/2012 6:22 AM, Gene Heskett wrote:

On Sunday 16 December 2012 01:33:35 Terry Reedy did opine:



You appear to have some of /Lib/test/ present, including
Lib/test/regrtest.py, but not move of the test_xxx.py files. I do not
know what is normal for an Ubuntu distribution. On Windows, I believe it
is all or nothing.



/usr/lib/test?


No. I am on Windows and by /Lib I mean the directory containing 
Python-coded stdlib modules. It is on sys.path. For me, the path entry 
is 'C:\\Programs\\Python33\\lib'. (Windows paths are case indifferent 
for matching.) /test is one of several package subdirectories in /Lib.


--
Terry Jan Reedy

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


modify image and save with exif data

2012-12-16 Thread jwe . van . dijk
I want to resize an image but retain the exif data
I now have:
import Image

img = Image.open('photo.jpg')
img.thumbnail((800, 800), Image.ANTIALIAS)
img.save('photo800.jpg', 'JPEG')

The saved image photo800.jpg has no exif info anymore.
I would so much like to have it retained in particular the exposure and gps 
data.

I use Python 2.7 with PIL 1.17 on Ubuntu 12.04
For exif reading/writing I use pyexiv2 0.3.2 but apparently you cannot add tags 
to an image that has none; only modifying existing ones seems to work.

Thanks for any helpful suggestions,
Janwillem
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is there a quick & accurate way to test a python install?

2012-12-16 Thread Gene Heskett
On Sunday 16 December 2012 14:55:53 Terry Reedy did opine:

> On 12/16/2012 6:22 AM, Gene Heskett wrote:
> > On Sunday 16 December 2012 01:33:35 Terry Reedy did opine:
> >> You appear to have some of /Lib/test/ present, including
> >> Lib/test/regrtest.py, but not move of the test_xxx.py files. I do not
> >> know what is normal for an Ubuntu distribution. On Windows, I believe
> >> it is all or nothing.
> > 
> > /usr/lib/test?
> 
> No. I am on Windows and by /Lib I mean the directory containing
> Python-coded stdlib modules. It is on sys.path. For me, the path entry
> is 'C:\\Programs\\Python33\\lib'. (Windows paths are case indifferent
> for matching.) /test is one of several package subdirectories in /Lib.

Nothing even remotely related in the linux /lib tree:

gene@coyote:/$ ls -lR /lib|grep test
-rw-r--r-- 1 root root 6592 2010-07-27 13:58 raid6test.ko
drwxr-xr-x 2 root root  4096 2010-07-27 23:16 tests
/lib/modules/2.6.32-122-rtai/kernel/drivers/mtd/tests:
-rw-r--r-- 1 root root 14752 2010-07-27 13:58 mtd_oobtest.ko
-rw-r--r-- 1 root root 12668 2010-07-27 13:58 mtd_pagetest.ko
-rw-r--r-- 1 root root  7260 2010-07-27 13:58 mtd_readtest.ko
-rw-r--r-- 1 root root 10304 2010-07-27 13:58 mtd_speedtest.ko
-rw-r--r-- 1 root root  8552 2010-07-27 13:58 mtd_stresstest.ko
-rw-r--r-- 1 root root 12220 2010-07-27 13:58 mtd_subpagetest.ko
-rw-r--r-- 1 root root 13336 2010-07-27 13:58 mtd_torturetest.ko
-rw-r--r-- 1 root root  5816 2010-07-27 13:58 rtc-test.ko
-rw-r--r-- 1 root root  6968 2010-07-27 13:58 comedi_test.ko
-rw-r--r-- 1 root root 29556 2010-07-27 13:59 usbtest.ko

I knew there was a certain amount of isolation between the windows version 
and the linux version, but this seems total, so perhaps someone actually 
running linux can chip in here, with suggestions that are valid for the 
linux version?

Cheers, Gene
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page:  is up!
There is no sincerer love than the love of food.
-- George Bernard Shaw
I was taught to respect my elders, but its getting 
harder and harder to find any...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pastebin [was: Trying to make a basic Python score counter in a game... will not count.]

2012-12-16 Thread Chris Angelico
On Mon, Dec 17, 2012 at 5:35 AM, Ian Kelly  wrote:
> On Sun, Dec 16, 2012 at 10:32 AM, Kwpolska  wrote:
>> On Sun, Dec 16, 2012 at 6:25 PM,   wrote:
>>> On Sunday, December 16, 2012 10:09:53 AM UTC-7, Kwpolska wrote:
[...]
 PS. please do not use pastebin.com.
>>>
>>> Why?
>>
>> http://news.ycombinator.com/item?id=2595066 should answer this very question.
>
> That seems to be a problem with a certain class of users that have
> adopted Pastebin, not a problem with the site itself.  What do you
> hope to accomplish by boycotting Pastebin for actual code pastes?
> Even if the site were to cease to exist tomorrow, what is to stop the
> hackers from simply switching to dpaste or gist like everybody else?

The comment by genbattle in the above link is an important one, I
think. The last time I used pastebin was for Pike code - does any
competing site have Pike support?

http://pastebin.com/UNTj642Y

I don't understand the idea behind the boycott. Are people worried
about the longevity of linked-to content, in the event that pastebin
should, as you say, cease to exist tomorrow? Or is it that some won't
click a pastebin link in case it's abusive? This isn't the sort of
abuse that can compromise your computer.

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


Re: python-daemon

2012-12-16 Thread Chris Angelico
On Mon, Dec 17, 2012 at 3:59 AM,   wrote:
> On 12/16/2012 08:26 AM, n8fel...@gmail.com wrote:
>> Hello all. Got a question for anyone out there that is willing to
>> help. Looking to make a Python Daemon, Google searches lead me to
>> http://pypi.python.org/pypi/python-daemon. My question is 2 part. 1)
>> pip install python-daemon downloads version 1.6, but the site states
>> that 1.5.5 is the latest version. Anyone know why this is? 2) With
>> python-daemon having been last uploaded in 2010, is anyone aware if
>> there is a better implementation for python daemons, or is this still
>> considered current?
>
> The author of the python-daemon package I believe is Ben Finney,
> who sometimes posts here.  Sadly, I think he is a member of a group
> of people here who say they filter out and ignore all messages posted
> from Google Groups (which would include yours and mine).
>
> If you get no other good answers here, you could try emailing him
> directly at ben+pyt...@benfinney.id.au, which is the address on
> a recent post from him.

More courteous would be to NOT post an unsolicited email to a poster's
address gleaned (by someone else) from a mailing list, but to look for
contact details in the package itself. I haven't looked, so it may
well be that there are none, but if there's an official contact point
for the package, that would be a very good start.

If your post is swallowed by someone's twit filter, that probably
means that you're doing something twittish. Switching to direct mail
isn't going to win you any friends :) Switching your newsgroup client,
however, will have all the same benefits; so do you want to be a tool
of the anti-Google-Groups propaganda, or of the
anti-anti-Google-Groups propaganda?

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


Re: python-daemon

2012-12-16 Thread rurpy
On Sunday, December 16, 2012 1:25:51 PM UTC-7, Chris Angelico wrote:
>[...]
> If your post is swallowed by someone's twit filter, that probably
> means that you're doing something twittish. Switching to direct mail
> isn't going to win you any friends :) Switching your newsgroup client,
> however, will have all the same benefits; so do you want to be a tool
> of the anti-Google-Groups propaganda, or of the
> anti-anti-Google-Groups propaganda?

The contents of a twit filter can be just as good an indication
of a twit reader as a twit poster.

And as was pointed out the last time this subject came up, no,
other clients do not "have all the same benefits" [as GG].

Rather than continue this twit-for-twat noise I've tried to 
provide something a little more constructive at 

  http://wiki.python.org/moin/GoogleGroupsPython
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread alex23
On Dec 17, 3:32 am, Kwpolska  wrote:
> >> PS. please do not use pastebin.com.
> http://news.ycombinator.com/item?id=2595066should answer this very question.

By that argument, you should also be asking people not to use the
internet.

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


Re: Unicode

2012-12-16 Thread Dave Angel
On 12/16/2012 04:10 PM, Anatoli Hristov wrote:
> Hello guys,
>
> I'm using Linux CentOS and Python 2.4 with MySQL 5.xx, I get error
> with Unicode I tried many things that I found on the net but none of
> them working.
>
> If I dont use UTF-8 it inserts the data into the DB  but some French
> char. are not correctly decoded. Could you please help me ?

Thanks for describing your system, and for using plain text in your message.

But the program you supplied is missing quite a bit, starting with the
imports.  And you say nothing at all about the error you get.

You should include a full traceback of whatever error you're getting,
along with information about how you got there.

I don't see any place there which is dealing with unicode, except for
the part which is commented out.  Hard to get an error on those lines.



-- 

DaveA

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


Why Isn't Multiple Inheritance Automatic in Python?

2012-12-16 Thread Nick M . Daly
If you're short on time, the subject's all you need to read.  It seems
like it would always be the right thing to do, when the sub-class
specifically requests it.

It's very unlikely that multiple inheritance would go horribly wrong, as
long as classes adopt class-specific argument naming conventions.
However, ever since bug 1683368 [0] was fixed, it's now impossible to
cleanly create arbitrary inheritance trees.  The only reason I can't
just take anybody's code and plop it into my inheritance tree is because
Python demands that each class specifically opts in to MI though
mechanisms like the following:

1: class Foo(object):
2: def __init__(self, foo_bar, *args, **kwargs):
3: if Foo.__mro__[1] != object:
4: super().__init__(*args, **kwargs)
5: 
6: self.bar = foo_bar

Lines 3 and 4 are required because Foo might fall at the beginning or
the middle of in the inheritance tree: we can't know ahead of time.

>From my perspective, it'd be lovely if init methods implicitly accepted
*args and **kwargs while implicitly sending them off to the next class
in the MRO as the first call.  This would make the previous example
semantically equivalent to:

1: class Foo(object):
2: def __init__(self, foo_bar):
3: self.bar = foo_bar

Granted, that's probably too excessive and implicit for most folks to be
comfortable with, even though that's obviously the behavior a user
intends when they write code like:

1: class Baz(Foo, Bar):
2: def __init__(self):
3: super().__init__(foo_bar=1, bar_quote="Give me another!")

Fundamentally, I don't care if Foo or Bar explicitly handle being
composed into the inheritance tree.  They can be composed correctly
(they can do what the user is asking) in most obvious and simple cases,
and it'd be fine by me even if we threw errors in complex situations
(like overlapping argument names in init methods).

So, would it be a good idea to:

1. Undo the fix to bug 1683368, making multiple inheritance easier?

2. Make MI implicit, when subclasses try to use it?

Thanks for your time,
Nick

0: http://bugs.python.org/issue1683368

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


Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-16 Thread Mitya Sirenef

On 12/16/2012 01:07 PM, Mitya Sirenef wrote:

On 12/16/2012 12:00 PM, Darrien  Glasser wrote:
>> Hey guys, I'm working on a Python rock paper scissors (lizard spock) 
game, and the beginning is
> complete. After I finished it, I thought, "You know what? I think I 
can make this even better, and add a score counter." And so I did.

> >
> > The problem is that it doesn't seem to actually keep track of 
score. In fact it always keeps the score at 0 for both players. It's 
fully functional otherwise, but it's bothering me that I can't get it to 
work.

> >
> > Currently using Windows Python 32 bit v2.6.8
> >
> > Download of the code here:
> >
> > https://www.box.com/s/2lupxeyk5jvsxs0zkdfb
> >
> > Copy of the code here:
> >
> > http://pastebin.com/MNdgiuSY
> >
> > Thanks in advance for your help...
>
>
> I was actually thinking of making a simple rock paper scissors game so I
> went ahead and cobbled it together, using a design with a class and
> generally a structured approach.. It keeps the scores, too, and you can
> set both players to be AI, or one to be AI, or both to be humans:
>
> https://github.com/pythonbyexample/PBE/blob/master/code/rockpaper.py
>
> (it needs python3 but can be easily changed to work with python2.x)
>
>
> - mitya
>


If anyone's interested, I've simplified the code further by making use
of my TextInput utility class; I've also made the game into a tutorial,
it can be found here:

http://lightbird.net/larks/rockpaper.html


The updated full code is really tiny (it requires utils.py which is
linked at the top of tutorial):


import sys
from random import choice as randchoice
from time import sleep

from utils import TextInput

players= 'XY'
ai_players = 'Y'
moves  = "rps"
wins   = ("rp", "sr", "ps")   # choice on the right side wins
status = "%5s %3d %5s %3d moves: %s %s"
pause_time = 0.3


class RockPaperScissors(object):
def run(self):
self.textinput = TextInput("(r|p|s)")
scores = [0, 0]

while True:
choice1, choice2 = (self.get_move(p) for p in players)

if choice1 != choice2:
winplayer = 1 if (choice1+choice2 in wins) else 0
scores[winplayer] += 1

print(status % (players[0], scores[0], players[1], 
scores[1], choice1, choice2))

sleep(pause_time)

def get_move(self, player):
if player in ai_players : return randchoice(moves)
else: return self.textinput.getval()


if __name__ == "__main__":
try  : RockPaperScissors().run()
except KeyboardInterrupt : pass


--
Lark's Tongue Guide to Python: http://lightbird.net/larks/

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


Re: Unicode

2012-12-16 Thread Steven D'Aprano
On Sun, 16 Dec 2012 22:10:37 +0100, Anatoli Hristov wrote:

> If I dont use UTF-8 it inserts the data into the DB  but some French
> char. are not correctly decoded. Could you please help me ?

What happens when you do use UTF-8?

What do you mean, "use UTF-8"?


To learn about Unicode, start here:

http://www.joelonsoftware.com/articles/Unicode.html

If that helps you solve the problem, excellent. If not, please come back 
with your questions, but first read this:

http://www.sscce.org/

As given, we cannot answer your question easily, or at all, because we 
cannot run your code. It gives indentation errors, you don't tell us what 
modules you're using, and you haven't reduced the example down to the 
critical parts that demonstrate the failure.



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python-daemon

2012-12-16 Thread Chris Angelico
On Mon, Dec 17, 2012 at 9:18 AM,   wrote:
> On Sunday, December 16, 2012 1:25:51 PM UTC-7, Chris Angelico wrote:
>>[...]
>> If your post is swallowed by someone's twit filter, that probably
>> means that you're doing something twittish. Switching to direct mail
>> isn't going to win you any friends :) Switching your newsgroup client,
>> however, will have all the same benefits; so do you want to be a tool
>> of the anti-Google-Groups propaganda, or of the
>> anti-anti-Google-Groups propaganda?
>
> The contents of a twit filter can be just as good an indication
> of a twit reader as a twit poster.
>
> And as was pointed out the last time this subject came up, no,
> other clients do not "have all the same benefits" [as GG].
>
> Rather than continue this twit-for-twat noise I've tried to
> provide something a little more constructive at
>
>   http://wiki.python.org/moin/GoogleGroupsPython

All you've said is the exact same things that have already been said,
including that not everyone will see your post if you use Google
Groups. Why use something that unnecessarily restricts your audience,
when non-restrictive posting methods work just fine?

Anyway. This debate isn't going away; I have no strong side in it, I'm
just informing people of the fact that posting from GG will reduce
your potential response sources.

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


Re: modify image and save with exif data

2012-12-16 Thread Vincent Vande Vyvre
Le 16/12/12 20:43, jwe.van.d...@gmail.com a écrit :
> I want to resize an image but retain the exif data
> I now have:
> import Image
>
> img = Image.open('photo.jpg')
> img.thumbnail((800, 800), Image.ANTIALIAS)
> img.save('photo800.jpg', 'JPEG')
>
> The saved image photo800.jpg has no exif info anymore.
> I would so much like to have it retained in particular the exposure and gps 
> data.
>
> I use Python 2.7 with PIL 1.17 on Ubuntu 12.04
> For exif reading/writing I use pyexiv2 0.3.2 but apparently you cannot add 
> tags to an image that has none; only modifying existing ones seems to work.
>
> Thanks for any helpful suggestions,
> Janwillem
Hi,

If a tag is not already set you can create it with pyexiv2.

Example:
--
self.data = pyexiv2.ImageMetadata(img.jpg)
self.data.read()

tag = "Exif.Image.ImageWidth"
try:
self.data[tag].value = sizes[0]
except:
self.data[tag] = pyexiv2.ExifTag(tag, sizes[0])
---

A more complete example:
http://bazaar.launchpad.net/~vincent-vandevyvre/oqapy/serie-1.0/view/head:/oqapy-1.0/metadata.py



-- 
Vincent V.V.
Oqapy  . Qarte
 . PaQager 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pastebin [was: Trying to make a basic Python score counter in a game... will not count.]

2012-12-16 Thread Steven D'Aprano
On Mon, 17 Dec 2012 07:13:44 +1100, Chris Angelico wrote:

> On Mon, Dec 17, 2012 at 5:35 AM, Ian Kelly 
> wrote:
>> On Sun, Dec 16, 2012 at 10:32 AM, Kwpolska  wrote:
>>> On Sun, Dec 16, 2012 at 6:25 PM,   wrote:
 On Sunday, December 16, 2012 10:09:53 AM UTC-7, Kwpolska wrote:
>[...]
> PS. please do not use pastebin.com.

 Why?
[...]
> I don't understand the idea behind the boycott. Are people worried about
> the longevity of linked-to content, in the event that pastebin should,
> as you say, cease to exist tomorrow? Or is it that some won't click a
> pastebin link in case it's abusive? This isn't the sort of abuse that
> can compromise your computer.

How do you know? Between javascript and flash, just about any browser 
could be vulnerable to just about any website. You might implicitly trust 
Pastebin, but you can't possibly *know* that the site won't do bad 
things. It wouldn't be the first time that even a reputable website got 
hacked by somebody who used it to deploy malware.

But that's not why I dislike Pastebin. I argue against Pastebin because:

1) Longevity of the content. Your question is going to be around for 
much, much longer than your pastebin. People searching for help will 
click through to the pastebin and find the code is gone. It is really 
frustrating to (say) search for the solution to a problem, and find that 
the answer is given in an expired pastebin.


2) When you ask for help via email, you shouldn't assume that the people 
reading have access to the web. Perhaps they have email access, but all 
or part of the web is blocked to them. Perhaps they are reading email on 
a mobile device and don't mind paying to download a couple of KB of 
email, but draw the line at (potentially) hundreds of KB of a web page 
plus associated images, unnecessary javascript, web bugs, advertisements, 
etc. Or maybe they just don't want the context switch:

"I'm reading email right now, I'll click the link later..."

Email is a push technology. A pastebin is a pull technology. Whenever you 
require your audience to actively go and get content, you're cutting your 
audience by some fraction.

I am aware that it is irrational and silly, but for me it also has to do 
with a sense of fairness. I'm prepared to spend tens of minutes, or 
sometimes even an hour or more, solving somebody else's problem for no 
benefit except a sense of accomplishment. But ask me to click on a 
pastebin to find out what that question is, and I'm all "Why should I 
have to go out of my way to find out what your question is? You're asking 
me to do you a favour, and you're making me work to find out what the 
favour is??? Fuck you!"

But maybe that's just me :-)

I'm not saying "never use a paste bin". I think it probably makes lots of 
sense to use one in IRC, where it is inappropriate to paste more than a 
line or two of code at once, and the conversation is already ephemeral. 
But in a Usenet or email forum, I think it is almost always inappropriate 
to use paste bins. If your code is too large to paste directly in the 
body of your email, chances are it is too large to expect people to debug 
for you. But you can try adding it as an attachment (.py, not .doc), and 
only if you can't do that for some reason, then maybe a paste bin is 
appropriate.


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python-daemon

2012-12-16 Thread rurpy
On 12/16/2012 11:16 PM, Chris Angelico wrote:
> On Mon, Dec 17, 2012 at 9:18 AM,   wrote:
>> On Sunday, December 16, 2012 1:25:51 PM UTC-7, Chris Angelico wrote:
>>>[...]
>>> If your post is swallowed by someone's twit filter, that probably
>>> means that you're doing something twittish. Switching to direct mail
>>> isn't going to win you any friends :) Switching your newsgroup client,
>>> however, will have all the same benefits; so do you want to be a tool
>>> of the anti-Google-Groups propaganda, or of the
>>> anti-anti-Google-Groups propaganda?
>>
>> The contents of a twit filter can be just as good an indication
>> of a twit reader as a twit poster.
>>
>> And as was pointed out the last time this subject came up, no,
>> other clients do not "have all the same benefits" [as GG].
>>
>> Rather than continue this twit-for-twat noise I've tried to
>> provide something a little more constructive at
>>
>>   http://wiki.python.org/moin/GoogleGroupsPython
> 
> All you've said is the exact same things that have already been said,
> including that not everyone will see your post if you use Google
> Groups. Why use something that unnecessarily restricts your audience,
> when non-restrictive posting methods work just fine?

I keep saying them because people like you keep saying (in
effect) that there is no difference in clients (in terms
of usability, convenience, setup effort and other factors
that vary on a person-by-person basis.)  I even wrote that 
above, right in the post you're replying to:
 
  >> no, other clients do not "have all the same benefits"

and yet you respond that other "posting methods work just fine"
Again, that may be true for you and your definition of "fine", 
and maybe even for many people but it is not true for everyone,

As you say, all this has been said before and if you need to 
refresh your memory, please see the list archives, the thread, 
"Simple Question regarding running .py program" around nov 14.

> Anyway. This debate isn't going away; I have no strong side in it, I'm
> just informing people of the fact that posting from GG will reduce
> your potential response sources.

No, that's not what you were "just" informing people of...
you were also informing us that we are "twits" for finding 
Google Groups fits our needs better than some other clients.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python-daemon

2012-12-16 Thread Chris Angelico
On Mon, Dec 17, 2012 at 6:25 PM,   wrote:
> No, that's not what you were "just" informing people of...
> you were also informing us that we are "twits" for finding
> Google Groups fits our needs better than some other clients.

I didn't say that. The first twit filter I met was when my dad put
*his own* address into it, to avoid downloading the posts he'd sent
(on a modem, that was significant). And that was the most normal thing
to do, twitting yourself :)

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