pygame and python 2.5

2007-02-09 Thread siggi
@Ben Sizer

Hi Ben,

in January I received your message re Pygame and Python 2.5:

pygame and python 2.5
Ben Sizer kylotan at gmail.com
Fri Jan 12 11:01:00 CET 2007


siggi wrote:

 when I rtry to install pygame (pygame-1.7.1release.win32-py2.4.exe, the
 most
 ciurrent version I found) it requires Python 2.4! Will I really have to
 uninstall my Python 2.5 and install the old Python 2.4 in order to use
 pygame?

For now, yes. This is a long-standing problem with Python really,
requiring extensions to always be recompiled for newer versions. I
usually have to wait about 6 months to a year after any new release
before I can actually install it, due to the extension lag.

-- 
Ben Sizer

As a Python (and programming ) newbie  allow me a  - certainly naive -
question:

What is this time consuming part of recompiling an extension, such as
Pygame, from source code to Windows? Is it a matter of spare time to do the
job? Or do you have to wait for some Windows modules that are necessary for
compiling?

I am just asking for sake of scientific interest; building, compiling
from source code is a mystery to me poor Windows user ;-)

Thank you,

siggi



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


Re: pygame and python 2.5: switch to linux?

2007-02-09 Thread Siggi
Ben Sizer wrote:
[snip]
 Hopefully in the future, some of those convoluted steps will be fixed,
 but that requires someone putting in the effort to do so. As is often
 the case with Python, and indeed many open source projects, the people
 who are knowledgeable enough to do such things usually don't need to
 do them, as their setup already works just fine.

 --
 Ben Sizer


Thank you, and all those putting in their comments to my thread.
As a python newbie,  I conclude now that I will be better off to drop
Windows and install Linux on my next PC, to be able to reap the full
benefits of Python.

Thanks,

siggi






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


Thank you, Martin, Wang and Colin

2007-01-26 Thread siggi
Thanks for your answers, Martin, Wang and Colin!

siggi

siggi [EMAIL PROTECTED] schrieb im Newsbeitrag 
news:[EMAIL PROTECTED]
 Hi all,

 installing a package with 'setup.py' is easy. But how do I uninstall the
 package, once I want to get rid of it again?

 Thanks,

 siggi


 


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


how to unistall a Python package?

2007-01-25 Thread siggi
Hi all,

installing a package with 'setup.py' is easy. But how do I uninstall the
package, once I want to get rid of it again?

Thanks,

siggi



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


Re: Win GUI application: avoiding DOS console

2007-01-22 Thread siggi

Jarek Zgoda  wrote:

 Siggi napisa³(a):

 how do I avoid the DOS console show-up when starting a WinXP GUI 
 application
 with mouseclick on the respective Python file?

 I had this with my previous Python installation; it is very simple,
 something with a -i somewhere in the open command of the  MS Windows 
 data
 types PY and PYW. But after a new Python installation, this was lost,
 and I cannot find the instruction what to do.

 Run it using pythonw.exe instead of python.exe (check in file types
 properties window).

 -- 
 Jarek Zgoda
 http://jpa.berlios.de/

Thanks!

siggi 


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

Re: Code reformater?

2007-01-20 Thread Siggi

Vincent Delporte wrote:
 Hello

 When I copy/paste Python code from the web, every so often,
 the TABs are wrong, which means that the code won't work and I have to
 manually reformat the code.

 Is there a code reformater that can parse the code to make it right?

 Thanks.

Maybe my thread help: code formatter, 08/01/2007 helps a little? Here are
some of the answers:

*
Why don't you just write one? :)
Seriously: Try.
*
Tools\scripts\reindent.py in your Python distribution.
*
Why, yes, there is:
 http://lacusveris.com/PythonTidy/PythonTidy.python
*
tabnanny ?


siggi




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


Win GUI application: avoiding DOS console

2007-01-20 Thread Siggi
Hi all,

how do I avoid the DOS console show-up when starting a WinXP GUI application 
with mouseclick on the respective Python file?

I had this with my previous Python installation; it is very simple, 
something with a -i somewhere in the open command of the  MS Windows data 
types PY and PYW. But after a new Python installation, this was lost, 
and I cannot find the instruction what to do.

Please help!

Thanks,

siggi 


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


Re: Win GUI application: avoiding DOS console

2007-01-20 Thread Siggi
Thanks, but I don't mean that, I am looking for the method keeping *.py.

Bruno Desthuilliers [EMAIL PROTECTED] schrieb im 
Newsbeitrag news:[EMAIL PROTECTED]
 Siggi a écrit :
 Hi all,

 how do I avoid the DOS console show-up when starting a WinXP GUI 
 application with mouseclick on the respective Python file?

 rename yourfile.py to yourfile.pyw 


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

python and MOV or MPEG

2007-01-15 Thread siggi
Hi all,

does Python support MPEG or MOV videoclips? I couldn't find anything about
it online.

Thank you,

Siggi




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


Re: pygame and python 2.5

2007-01-15 Thread siggi
Thanks, I'll try that!

Siggi

Laurent Pointal [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
 siggi a écrit :
 Hi all,

 when I rtry to install pygame (pygame-1.7.1release.win32-py2.4.exe, the
 most
 ciurrent version I found) it requires Python 2.4! Will I really have to
 uninstall my Python 2.5  and install the old Python 2.4 in order to use
 pygame?

 Note: You can have both versions installed, just be sure to use the
 right one when using pygame (until there is a 2.5 compatible version).




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

Problem with findinf wx modules solved

2007-01-15 Thread siggi
I included the ...\wxDemos path in PYTHONPATH. Everthing fine now!

siggi [EMAIL PROTECTED] schrieb im Newsbeitrag 
news:[EMAIL PROTECTED]
 Tim Roberts  wrote:

when I do sys.path in IDLE (winXP), i get a horrendously long list of
paths, paths I may have used during a lot of trials and errors. How can I
clean up sys.path? I mean, trim it of unnecessary paths?

 What do mean by used during a lot of trials and errors?  sys.path is
 recreated from scratch every time Python starts.  It doesn't accumulate
 over time, other than from new packages that you install.
 -- 
 Tim Roberts, [EMAIL PROTECTED]
 Providenza  Boekelheide, Inc.


 Sorry Tim, my statement was not correct, due to my inexperience with 
 Python.
 And sorry, too, for my somewhat lengthy reply:
 After having had inspected my current sys.path...

 ['C:\\Documents and Settings\\User\\My Documents\\My Python files',
 'C:\\Documents and Settings\\User\\My Documents\\Python25\\Lib\\idlelib',
 'C:\\Documents and Settings\\User\\My Documents\\Python25\\python25.zip',
 'C:\\Documents and Settings\\User\\My Documents\\Python25\\DLLs',
 'C:\\Documents and Settings\\User\\My Documents\\Python25\\lib',
 'C:\\Documents and Settings\\User\\My Documents\\Python25\\lib\\plat-win',
 'C:\\Documents and Settings\\User\\My Documents\\Python25\\lib\\lib-tk',
 'C:\\Documents and Settings\\User\\My Documents\\Python25', 'C:\\Documents
 and Settings\\User\\My Documents\\Python25\\lib\\site-packages',
 'C:\\Documents and Settings\\User\\My
 Documents\\Python25\\lib\\site-packages\\PIL', 'C:\\Documents and
 Settings\\User\\My Documents\\Python25\\lib\\site-packages\\win32',
 'C:\\Documents and Settings\\User\\My
 Documents\\Python25\\lib\\site-packages\\win32\\lib', 'C:\\Documents and
 Settings\\User\\My Documents\\Python25\\lib\\site-packages\\Pythonwin',
 'C:\\Documents and Settings\\User\\My
 Documents\\Python25\\lib\\site-packages\\wx-2.8-msw-ansi']

 or in plain DOS:

 C:\Documents and Settings\User\My Documents\My Python files
 C:\Documents and Settings\User\My Documents\Python25\Lib\idlelib
 C:\Documents and Settings\User\My Documents\Python25\python25.zip
 C:\Documents and Settings\User\My Documents\Python25\DLLs
 C:\Documents and Settings\User\My Documents\Python25\lib
 C:\Documents and Settings\User\My Documents\Python25\lib\plat-win
 C:\Documents and Settings\User\My Documents\Python25\lib\lib-tk
 C:\Documents and Settings\User\My Documents\Python25
 C:\Documents and Settings\User\My Documents\Python25\lib\site-packages
 C:\Documents and Settings\User\My Documents\Python25\lib\site-packages\PIL
 C:\Documents and Settings\User\My 
 Documents\Python25\lib\site-packages\win32
 C:\Documents and Settings\User\My
 Documents\Python25\lib\site-packages\win32\lib
 C:\Documents and Settings\User\My
 Documents\Python25\lib\site-packages\Pythonwin
 C:\Documents and Settings\User\My
 Documents\Python25\lib\site-packages\wx-2.8-msw-ansi

 ...it just looked horrible to me at first sight!

 If I interpret your explanation correctly, all these paths are necessary,
 and not relics of previous installations and deinstallations.

 What puzzles me, though, is, that e.g., when I run the wxPython 
 application
 AnalogClock.py with IDLE or in the command line , this works only in the
 directory ...\My Python files\wxDemos\ . This directory contains all 
 files
 and folders from the original \wx-2.8-msw-ansi\demos\).

 When I copy AnalogClock.py to ...\My Python Files\  , nothing happens 
 after
 running it with IDLE or in the command line.
 Appending 'C:\Documents and Settings\User\My Documents\My Python
 files\wxDemos ' to the sys.path does not help either.

 Thinking that I am clever, I  changed my sys.path with sclicing and
 concatenation such that my sys.path starts with

 'C:\Documents and Settings\User\My Documents\My Python files', 
 'C:\Documents
 and Settings\User\My Documents\My Python files\wxDemos'. Now \wxDemos\ is
 being searched very early.

 ... no way! After running AnalogClock.py again, this error message 
 appears:

 --
 Traceback (most recent call last):
  File C:\Documents and Settings\My Documents\My Python
 files\wxAnalogClock.py, line 14, in module
import wx
 ImportError: No module named wx.
 --

 Very strange! Because all this wx stuff IS IN the directory 'C:\Documents
 and Settings\User\My Documents\My Python files\wxDemos'. And 
 AnalogClock.py
 does work when residing in that directory.

 Can you help me again?

 Thanks,

 siggi

 P.S. On another PC where the python program is in c:\programs\python25\, 
 same as above!





 


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


Re: python and MOV or MPEG

2007-01-15 Thread siggi

Diez B. Roggisch wrote:

 siggi wrote:

 Hi all,

 does Python support MPEG or MOV videoclips? I couldn't find anything
 about it online.

 Weak in googling today? Must have been a rough weekend.

 There are several options, including pymedia and pygame.

 Diez

Thanks, Diez.  I forgot to mention that I am learning Python with python 2.5
on WinXP. And both pymedia and pygame require somewhat older versions of
python, 1.3 and 2.4, respectively. And the updated binaries are still in the
offing. I was naive enough to think MPEG could be done using modules already
existing.

siggi



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


Re: python and MOV or MPEG

2007-01-15 Thread siggi
Bjoern Schliessmann wrote:

 1.3? I've found both for 2.4, and in one site's forum some guy
 offers windows binaries for 2.5.

The links, please!

Thank you,

siggi


Bjoern Schliessmann [EMAIL PROTECTED] schrieb 
im Newsbeitrag news:[EMAIL PROTECTED]
 siggi wrote:

 Thanks, Diez.  I forgot to mention that I am learning Python with
 python 2.5 on WinXP. And both pymedia and pygame require somewhat
 older versions of python, 1.3 and 2.4, respectively.

 1.3? I've found both for 2.4, and in one site's forum some guy
 offers windows binaries for 2.5.

 Regards,


 Björn

 -- 
 BOFH excuse #303:

 fractal radiation jamming the backbone
 


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

Re: how to clean sys.path

2007-01-13 Thread Siggi

Tim Roberts wrote:

wxDemos contains the demos.  The wx module lives in
site-packages\wx-2.8-msw-ansi.  Did you leave that in?

Yes! Even on this computer I am writing now with - where the whole Python
programs stuff is in a programs folder, such as

C:\Programs\Python25\Lib\site-packages\wx-2.8-msw-ansi

- it is the same problem!


 siggi [EMAIL PROTECTED] wrote:

or in plain DOS:

C:\Documents and Settings\User\My Documents\My Python files
C:\Documents and Settings\User\My Documents\Python25\Lib\idlelib
C:\Documents and Settings\User\My Documents\Python25\python25.zip
C:\Documents and Settings\User\My Documents\Python25\DLLs
C:\Documents and Settings\User\My Documents\Python25\lib
C:\Documents and Settings\User\My Documents\Python25\lib\plat-win
C:\Documents and Settings\User\My Documents\Python25\lib\lib-tk
C:\Documents and Settings\User\My Documents\Python25
C:\Documents and Settings\User\My Documents\Python25\lib\site-packages
C:\Documents and Settings\User\My Documents\Python25\lib\site-packages\PIL
C:\Documents and Settings\User\My
Documents\Python25\lib\site-packages\win32
C:\Documents and Settings\User\My
Documents\Python25\lib\site-packages\win32\lib
C:\Documents and Settings\User\My
Documents\Python25\lib\site-packages\Pythonwin
C:\Documents and Settings\User\My
Documents\Python25\lib\site-packages\wx-2.8-msw-ansi

...it just looked horrible to me at first sight!

 It looks horrible to me, too.  That's why I install applications like that
 in \Apps instead of a document off of Documents and setings.  This looks
 much better:

 C:\Documents and Settings\User\My Documents\My Python files
 C:\Apps\Python25\Lib\idlelib
 C:\Apps\Python25\python25.zip
 C:\Apps\Python25\DLLs
 C:\Apps\Python25\lib
 C:\Apps\Python25\lib\plat-win
 C:\Apps\Python25\lib\lib-tk
 C:\Apps\Python25
 C:\Apps\Python25\lib\site-packages
 C:\Apps\Python25\lib\site-packages\PIL
 C:\Apps\Python25\lib\site-packages\win32
 C:\Apps\Python25\lib\site-packages\win32\lib
 C:\Apps\Python25\lib\site-packages\Pythonwin
 C:\Apps\Python25\lib\site-packages\wx-2.8-msw-ansi

 Searching these doesn't really take very long.  Remember that it doesn't
 have to read all the files -- it only has to read the directories.

'C:\Documents and Settings\User\My Documents\My Python files',
'C:\Documents
and Settings\User\My Documents\My Python files\wxDemos'. Now \wxDemos\ is
being searched very early.

... no way! After running AnalogClock.py again, this error message
appears:

--
Traceback (most recent call last):
  File C:\Documents and Settings\My Documents\My Python
files\wxAnalogClock.py, line 14, in module
import wx
ImportError: No module named wx.
--

Very strange! Because all this wx stuff IS IN the directory 'C:\Documents
and Settings\User\My Documents\My Python files\wxDemos'. And
AnalogClock.py
does work when residing in that directory.

 wxDemos contains the demos.  The wx module lives in
 site-packages\wx-2.8-msw-ansi.  Did you leave that in?
 -- 
 Tim Roberts, [EMAIL PROTECTED]
 Providenza  Boekelheide, Inc.




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


pygame and python 2.5

2007-01-12 Thread siggi
Hi all,

when I rtry to install pygame (pygame-1.7.1release.win32-py2.4.exe, the most
ciurrent version I found) it requires Python 2.4! Will I really have to
uninstall my Python 2.5  and install the old Python 2.4 in order to use
pygame?

Thanks,

Siggi



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


Re: how to clean sys.path

2007-01-11 Thread siggi
Tim Roberts  wrote:

when I do sys.path in IDLE (winXP), i get a horrendously long list of
paths, paths I may have used during a lot of trials and errors. How can I
clean up sys.path? I mean, trim it of unnecessary paths?

 What do mean by used during a lot of trials and errors?  sys.path is
 recreated from scratch every time Python starts.  It doesn't accumulate
 over time, other than from new packages that you install.
 -- 
 Tim Roberts, [EMAIL PROTECTED]
 Providenza  Boekelheide, Inc.


Sorry Tim, my statement was not correct, due to my inexperience with Python.
And sorry, too, for my somewhat lengthy reply:
After having had inspected my current sys.path...

['C:\\Documents and Settings\\User\\My Documents\\My Python files',
'C:\\Documents and Settings\\User\\My Documents\\Python25\\Lib\\idlelib',
'C:\\Documents and Settings\\User\\My Documents\\Python25\\python25.zip',
'C:\\Documents and Settings\\User\\My Documents\\Python25\\DLLs',
'C:\\Documents and Settings\\User\\My Documents\\Python25\\lib',
'C:\\Documents and Settings\\User\\My Documents\\Python25\\lib\\plat-win',
'C:\\Documents and Settings\\User\\My Documents\\Python25\\lib\\lib-tk',
'C:\\Documents and Settings\\User\\My Documents\\Python25', 'C:\\Documents
and Settings\\User\\My Documents\\Python25\\lib\\site-packages',
'C:\\Documents and Settings\\User\\My
Documents\\Python25\\lib\\site-packages\\PIL', 'C:\\Documents and
Settings\\User\\My Documents\\Python25\\lib\\site-packages\\win32',
'C:\\Documents and Settings\\User\\My
Documents\\Python25\\lib\\site-packages\\win32\\lib', 'C:\\Documents and
Settings\\User\\My Documents\\Python25\\lib\\site-packages\\Pythonwin',
'C:\\Documents and Settings\\User\\My
Documents\\Python25\\lib\\site-packages\\wx-2.8-msw-ansi']

or in plain DOS:

C:\Documents and Settings\User\My Documents\My Python files
C:\Documents and Settings\User\My Documents\Python25\Lib\idlelib
C:\Documents and Settings\User\My Documents\Python25\python25.zip
C:\Documents and Settings\User\My Documents\Python25\DLLs
C:\Documents and Settings\User\My Documents\Python25\lib
C:\Documents and Settings\User\My Documents\Python25\lib\plat-win
C:\Documents and Settings\User\My Documents\Python25\lib\lib-tk
C:\Documents and Settings\User\My Documents\Python25
C:\Documents and Settings\User\My Documents\Python25\lib\site-packages
C:\Documents and Settings\User\My Documents\Python25\lib\site-packages\PIL
C:\Documents and Settings\User\My Documents\Python25\lib\site-packages\win32
C:\Documents and Settings\User\My
Documents\Python25\lib\site-packages\win32\lib
C:\Documents and Settings\User\My
Documents\Python25\lib\site-packages\Pythonwin
C:\Documents and Settings\User\My
Documents\Python25\lib\site-packages\wx-2.8-msw-ansi

...it just looked horrible to me at first sight!

If I interpret your explanation correctly, all these paths are necessary,
and not relics of previous installations and deinstallations.

What puzzles me, though, is, that e.g., when I run the wxPython application
AnalogClock.py with IDLE or in the command line , this works only in the
directory ...\My Python files\wxDemos\ . This directory contains all files
and folders from the original \wx-2.8-msw-ansi\demos\).

When I copy AnalogClock.py to ...\My Python Files\  , nothing happens after
running it with IDLE or in the command line.
Appending 'C:\Documents and Settings\User\My Documents\My Python
files\wxDemos ' to the sys.path does not help either.

Thinking that I am clever, I  changed my sys.path with sclicing and
concatenation such that my sys.path starts with

'C:\Documents and Settings\User\My Documents\My Python files', 'C:\Documents
and Settings\User\My Documents\My Python files\wxDemos'. Now \wxDemos\ is
being searched very early.

... no way! After running AnalogClock.py again, this error message appears:

--
Traceback (most recent call last):
  File C:\Documents and Settings\My Documents\My Python
files\wxAnalogClock.py, line 14, in module
import wx
ImportError: No module named wx.
--

Very strange! Because all this wx stuff IS IN the directory 'C:\Documents
and Settings\User\My Documents\My Python files\wxDemos'. And AnalogClock.py
does work when residing in that directory.

Can you help me again?

Thanks,

siggi

P.S. On another PC where the python program is in c:\programs\python25\, 
same as above!






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


Re: help: code formatter?

2007-01-09 Thread siggi
Chuck wrote:

  http://lacusveris.com/PythonTidy/PythonTidy.python

Wow, what a giant of a program! Trying to find out how this works.

Thank you,

siggi

Chuck Rhode [EMAIL PROTECTED] schrieb im Newsbeitrag 
news:[EMAIL PROTECTED]
 siggi wrote this on Mon, Jan 08, 2007 at 03:33:21PM +0100.  My reply is 
 below.

 Is there a simple code formatter that first removes all indentations
 and then refomats correctly?

 Why, yes, there is:

  http://lacusveris.com/PythonTidy/PythonTidy.python

 -- 
 .. Chuck Rhode, Sheboygan, WI, USA
 .. 1979 Honda Goldwing GL1000 (Geraldine)
 .. Weather:  http://LacusVeris.com/WX
 .. 26° - Wind W 17 mph
 


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

Re: help: code formatter?

2007-01-09 Thread siggi
Thomas wrote:

 Tools\scripts\reindent.py in your Python distribution.

Thank you Thomas!

What a bucket full of toolsin \tools! I didn't know that.

siggi


Thomas Heller [EMAIL PROTECTED] schrieb im Newsbeitrag 
news:[EMAIL PROTECTED]
 siggi schrieb:
 Hi all,

 as a newbie I have problems with formatting code of downloaded programs,
 because IDLE's reformatting capabilities are limited . Incorrect
 indentation, mixing of TAB with BLANKs or eol are often very nasty to
 correct.
 Is there a simple code formatter that first removes all indentations and
 then refomats correctly?

 Please help!


 Tools\scripts\reindent.py in your Python distribution.

 Thomas 


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


Re: code formatter?

2007-01-09 Thread siggi
tabnanny?
not quite!

Hendrik van Rooyen [EMAIL PROTECTED] schrieb im Newsbeitrag 
news:[EMAIL PROTECTED]
 siggi [EMAIL PROTECTED] wrote:

 Is there a simple code formatter that first removes all indentations and
 then refomats correctly?

 tabnanny ?

 - Hendrik


 


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


how to clean sys.path

2007-01-09 Thread siggi
Hi all,

when I do sys.path in IDLE (winXP), i get a horrendously long list of 
paths, paths I may have used during a lot of trials and errors. How can I 
clean up sys.path? I mean, trim it of unnecessary paths?

So far, I know only the command sys.path.append(r'c:etc...'), but how 
to delete or insert at the beginning of the list, I know not.

Thanks,

siggi


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


Re: how to clean sys.path

2007-01-09 Thread siggi
Thank you Laszlo!

Take care,

siggi

Laszlo Nagy [EMAIL PROTECTED] schrieb im Newsbeitrag 
news:[EMAIL PROTECTED]


 So far, I know only the command sys.path.append(r'c:etc...'), but 
 how to delete or insert at the beginning of the list, I know not.

 You can delete a slice. For example,

 del sys.path[2:5]

 More about slicing: http://docs.python.org/ref/slicings.html
 sys.path is a regular list. List methods: 
 http://docs.python.org/tut/node7.html

 Best,

   Laszlo
 


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


help: code formatter?

2007-01-08 Thread siggi
Hi all,

as a newbie I have problems with formatting code of downloaded programs,
because IDLE's reformatting capabilities are limited . Incorrect
indentation, mixing of TAB with BLANKs or eol are often very nasty to
correct.
Is there a simple code formatter that first removes all indentations and
then refomats correctly?

Please help!

Thank you,

siggi




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


Re: help: code formatter?

2007-01-08 Thread siggi
Bjoern wrote:

 Why don't you just write one? :)

Very funny! Just learning Python  :(

Regards,

siggi

 siggi wrote:

 as a newbie I have problems with formatting code of downloaded
 programs, because IDLE's reformatting capabilities are limited .
 Incorrect indentation, mixing of TAB with BLANKs or eol are often
 very nasty to correct.
 Is there a simple code formatter that first removes all
 indentations and then refomats correctly?

 Why don't you just write one? :)

 Seriously: Try.

 BTW: Guessing to what amount of space TABs must be converted in
 mixed source can be non-trivial.

 Regards,


 Björn

 -- 
 BOFH excuse #289:

 Interference between the keyboard and the chair.
 


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

Python and SDK5.1 are just terrific!!!

2007-01-06 Thread Siggi
Thanks, Jussi, for your post, but I found that PythonWin's SDK5.0 option 
works well with MS SDk5.1.
Just had an Email read for me using a small Python program: correct English, 
even the date such as 12/06/06 was correctly transformed into the names of 
the month and year. Python is great1

Siggi


Jussi Salmela [EMAIL PROTECTED] schrieb im Newsbeitrag 
news:[EMAIL PROTECTED]
 Siggi kirjoitti:
 Gabriel Genellina wrote:

 After you download and install version 5.1, it should appear on the 
 list.

 It should, but it does not! Shutting down and starting the WinXP Home 
 system anew did not help.
 The SDK 5.1 installation went smoothly, however. What can I do to find 
 out
 what is wrong?

 siggi



 (Sorry for the long post!)


 Unfortunately I can't comment on this 5.0/5.1 issue but if you look at 
 page
 http://www.cs.unc.edu/~parente/tech/tr02.shtml
 you'll find the pyTTS system. I've used it and everything works.

 The funny thing is that the page has a link named Microsoft SAPI 5.1 
 redistributable which links to
 http://www.cs.unc.edu/Research/assist/packages/SAPI5SpeechInstaller.msi
 ie. a SAPI 5 installer. So I'm starting to wonder if it matters at all 
 whether the speech kit is a version 5 or 5.1.

 Anyway: pyTTS works with Python 2.4 as advertized in the accompanying 
 examples. I've used it to resolve the following dilemma: how to guarantee 
 that I'm aware of new mail appearing on my ISP.

 I had an unfortunate experience where a guy I was working with sent me (to 
 my home) mail that I didn't expect to receive just at the moment and to 
 which I would have liked to react immediately. Why I didn't notice the 
 mail coming: I was outside my house pumping more air to my wife's bicycle 
 tires! The mail notification was shown and erased and one more icon among 
 the more than dozen icons on my Windows System Tray didn't account for 
 much.

 So I figured out that a voice to remind me would be nice. I have a low 
 rate inbox, usually only a maximum of hald a dozen messages per day so I 
 wouldn't have to listen the voice all day long. So the voice keeps 
 repeating that I have new mail at my ISP until I download the mail and 
 otherwise keeps quiet. So here is my program and a skeleton of the INI 
 file it uses. The program is not finished (I have a few ideas still) but 
 it runs all day long on my computer keeping me happy.

 ==
 New Email Notifier.py
 ==
 #!/usr/bin/python

 '''
 License: MIT License. See License.txt. If that file is not attached,
 the license is http://www.opensource.org/licenses/mit-license.php, 
 where
 year = 2006 and copyright holders = Jussi Salmela, Turku, Finland
 '''

 # This program checks for new email at ISP and notifies if new email is 
 found

 import win32serviceutil
 import win32service
 import win32event
 import pyTTS, sys, os, poplib, logging, time
 import ConfigParser,pywintypes

 print '\nThis is the New Mail Notifier window\n'
 notifierDirectory = r'C:\Python\OMAT___PROJEKTIT\New Email Notifier 
 Service'
 logging.basicConfig(level=logging.DEBUG,
 format='%(asctime)s %(levelname)-8s %(message)s',
 filename=notifierDirectory+r'\error.log')
 logging.info('=')
 logging.info('New Email Notifier Service started')
 config = ConfigParser.ConfigParser()
 config.readfp(open(notifierDirectory+r'\New Email Notifier.INI'))
 POP3Server = config.get('POP3','server')
 POP3Account = config.get('POP3','account')
 POP3Password = config.get('POP3','password')
 totalMessagesFormat = config.get('messages','total_message')
 newMessagesFormat = config.get('messages','new_message')
 wakeupMessageFormat = config.get('messages','wakeup_message')

 tts = pyTTS.Create()
 #set the speech volume percentage (0-100%)
 tts.Volume = 100
 #explicitly set a voice
 tts.SetVoiceByName(u'MSMary')

 uidDict = {}
 # We wait to be stopped and check for new email every maxTimeToWait 
 seconds
 maxTimeToWait = 1 # First check after 1 second
 while True:
 time.sleep(maxTimeToWait)
 maxTimeToWait = 60 # Rest of the checks after 60 second
 try:
 # Connect to the ISP
 a = poplib.POP3(POP3Server,110)
 answer = a.getwelcome()
 if answer[0:3] != '+OK':
 raise ValueError,'a.getwelcome returned: ' + answer
 answer = a.user(POP3Account)
 if answer[0:3] != '+OK':
 raise ValueError,'a.user returned: ' + answer
 if answer[4:] == 'Password required':
 answer = a.pass_(POP3Password)
 if answer[0:3] != '+OK':
 raise ValueError,'a.pass_ returned: ' + answer
 answer = a.uidl()
 if answer[0][0:3] != '+OK':
 raise ValueError,'a.uidl returned: ' + repr(answer)
 a.quit()
 # Connection closed. Start handling the unique message identifiers
 #logging.info('Connection succesfully opened, used

where to find wx package

2007-01-05 Thread siggi
Hi all,

a newbie question:

I have a program gui03A.py using wxPython, importing it such:
from wxPython.wx import *

The program works, but I get the warning message:

gui03A.py:4: DeprecationWarning: The wxPython compatibility package is no
longer  automatically generated or activly maintained.  Please switch to the
wx package  as soon as possible.

However, after extensive searching on www.python.org and Googling the web, I
do not find any package with wx as its only name.

Where can I get the wx package (for win32 XP)?

Thanks,

Siggi









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


Re: where to find wx package

2007-01-05 Thread siggi
Thanks Rob!

siggi

Rob Williscroft [EMAIL PROTECTED] schrieb im Newsbeitrag 
news:[EMAIL PROTECTED]
 siggi wrote in news:[EMAIL PROTECTED] in
 comp.lang.python:

 Hi all,

 a newbie question:

 I have a program gui03A.py using wxPython, importing it such:
 from wxPython.wx import *

 The program works, but I get the warning message:

 gui03A.py:4: DeprecationWarning: The wxPython compatibility package
 is no longer  automatically generated or activly maintained.  Please
 switch to the wx package  as soon as possible.

 However, after extensive searching on www.python.org and Googling the
 web, I do not find any package with wx as its only name.

 Where can I get the wx package (for win32 XP)?

 The wx package talked about above is also part of WxPython,
 so you have already got it. To import it use:

 import wx

 You will need to translate all (well most) identifiers in
 your programme from wxBlah to wx.Blah so:

 class MyFrame( wxFrame ):
  pass

 becomes

 class MyFrame( wx.Frame ):
  pass

 Rob.
 -- 
 http://www.victim-prime.dsl.pipex.com/ 


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


Re: where to find wx package

2007-01-05 Thread siggi
Thanks to you, too, Robert!

siggi

Robert Kern [EMAIL PROTECTED] schrieb im Newsbeitrag 
news:[EMAIL PROTECTED]
 siggi wrote:
 Hi all,

 a newbie question:

 I have a program gui03A.py using wxPython, importing it such:
 from wxPython.wx import *

 The program works, but I get the warning message:

 gui03A.py:4: DeprecationWarning: The wxPython compatibility package is 
 no
 longer  automatically generated or activly maintained.  Please switch to 
 the
 wx package  as soon as possible.

 However, after extensive searching on www.python.org and Googling the 
 web, I
 do not find any package with wx as its only name.

 Where can I get the wx package (for win32 XP)?

 It's the same project (from the people at www.wxpython.org), they just 
 renamed
 the package. You already have it installed.

 -- 
 Robert Kern

 I have come to believe that the whole world is an enigma, a harmless 
 enigma
 that is made terrible by our own mad attempt to interpret it as though it 
 had
 an underlying truth.
  -- Umberto Eco
 


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


where is Microsoft Speech Object Library 5.1 option in PythonWin 2.5?

2007-01-05 Thread siggi
Hi all,

newbie question:
I'd like to try speech synthesis with PythonWin 2.5.

Problem
**
according to several instructions, such as found on
http://surguy.net/articles/speechrecognition.xml
and in a book on Python,

I have to select Tools | COM MakePy Utility | Microsoft Speech Object
Library 5.1, SDK 5.1, that is.

However, in my Python 2.5/PythonWin 2.5 installation I find as only option
Microsoft Speech Object Library 5.0 to select.

Unfortunately, 5.1 is the lowest SDK version I found on
http://www.microsoft.com/downloads/details.aspx?FamilyId=5E86EC97-40A7-453F-B0EE-6583171B4530displaylang=en#QuickInfoContainer

Will this PythonWin's Tools | COM MakePy Utility for 5.0 work with SDK 5.1?

Or will PythonWin's Tools | COM MakePy Utility  be updated to SDK 5.1, once
I have SDK 5.1 installed?

Thanks,

Siggi
















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


Re: where is Microsoft Speech Object Library 5.1 option inPythonWin 2.5?

2007-01-05 Thread Siggi
Gabriel Genellina wrote:

 After you download and install version 5.1, it should appear on the list.

It should, but it does not! Shutting down and starting the WinXP Home system 
anew did not help.
The SDK 5.1 installation went smoothly, however. What can I do to find out
what is wrong?

siggi

Gabriel Genellina [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
 At Friday 5/1/2007 11:24, siggi wrote:

However, in my Python 2.5/PythonWin 2.5 installation I find as only option
Microsoft Speech Object Library 5.0 to select.

 This list shows all the COM objects currently registered in Windows, does
 not depend on Pythonwin.

Unfortunately, 5.1 is the lowest SDK version I found on
http://www.microsoft.com/downloads/details.aspx?FamilyId=5E86EC97-40A7-453F-B0EE-6583171B4530displaylang=en#QuickInfoContainer

 After you download and install version 5.1, it should appear on the list.


 -- 
 Gabriel Genellina
 Softlab SRL





 __ Preguntá. Respondé.
 Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en
 Yahoo! Respuestas (Beta). ¡Probalo ya! http://www.yahoo.com.ar/respuestas



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

pow() works but sqrt() not!?

2007-01-04 Thread siggi
Hi all,

this is a newbie question on :
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on
win32
PC with WinXP

In
http://www.python.org/doc/2.3.5/lib/module-math.html
I read:

sqrt( x) Return the square root of x.

Now the test for module math with function pow():
---
 pow(9,9)
387420489

 Fine, but sqrt() fails:
---
 sqrt(9)
I get this error message

'Traceback (most recent call last):
  File pyshell#3, line 1, in module
sqrt(9)
NameError: name 'sqrt' is not defined'

Same for sin() and cos().  Import math does not help. Will I have to
define the sqrt() function first? If so, how?

Please help!

Thank you,

Siggi










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


Re: pow() works but sqrt() not!?

2007-01-04 Thread siggi
Thank you very much, Tõnis!:

*** 1 ***
you forgot to import math module
 import math

Nope, I did not! But I used sqrt(9), and not math.sqrt(9). The latter works
excellent, thank you! From now on, I will use import math and
math.fuction() for EVERY mathematical function, even for pow() etc. just
to be on the safe side!

*** 2 ***
if you want math functions to your current namespace use:
 from math import *

What is a namespace and what is the difference between import math
and from math import * ?

Siggi


tonisk [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
you forgot to import math module

 import math
 math.sqrt(9)
3.0

if you want math functions to your current namespace use:
 from math import *

--
Tõnis

On Jan 4, 10:13 am, siggi [EMAIL PROTECTED] wrote:
 Hi all,

 this is a newbie question on :
 Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)]
 on
 win32
 PC with WinXP

 Inhttp://www.python.org/doc/2.3.5/lib/module-math.html
 I read:

 sqrt( x) Return the square root of x.

 Now the test for module math with function pow():
 --- pow(9,9)387420489

  Fine, but sqrt() fails:
 --- sqrt(9)I get this error message

 'Traceback (most recent call last):
   File pyshell#3, line 1, in module
 sqrt(9)
 NameError: name 'sqrt' is not defined'

 Same for sin() and cos().  Import math does not help. Will I have to
 define the sqrt() function first? If so, how?

 Please help!

 Thank you,

 Siggi




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

Re: pow() works but sqrt() not!?

2007-01-04 Thread siggi
Thank you Tõnis, both for the link and your patient explanation :-)

Siggi


tonisk [EMAIL PROTECTED] schrieb im Newsbeitrag 
news:[EMAIL PROTECTED]
 if you want math functions to your current namespace use:
  from math import *What is a namespace and what is the difference 
  between import math
 and from math import * ?

for namespaces read this
http://www.network-theory.co.uk/docs/pytut/tut_68.html

import math creates new namespace math for names in that module, so
you can acess them by prefixing them with math, like math.sqrt(9).
from math import * imports all names to your local scope, so you do not
have to prefix them, sqrt(9)

-- 
Tõnis


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

Re: pow() works but sqrt() not!?

2007-01-04 Thread siggi
Thanks for the explanation. I am astonished what an interpreted language is 
able to do!

Fredrik Lundh [EMAIL PROTECTED] schrieb im Newsbeitrag 
news:[EMAIL PROTECTED]
 siggi wrote:

 Nope, I did not! But I used sqrt(9), and not math.sqrt(9). The latter 
 works
 excellent, thank you! From now on, I will use import math and
 math.fuction() for EVERY mathematical function, even for pow() etc. 
 just
 to be on the safe side!

 pow and math.pow are two slightly different things, though.  pow() works 
 on
 any type that supports power-of operations (via the __pow__ hook), while
 math.pow treats everything as a 64-bit float:

 math.pow(2, 200)
 1.6069380442589903e+060

 pow(2, 200)
 1606938044258990275541962092341162602522202993782792835301376L

 pow also takes a third modulo argument (pow(x,y,z) is equivalent to 
 pow(x,y) % z,
 but can be implemented more efficiently for certain data types).

 /F

 


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


Re: pow() works but sqrt() not!?

2007-01-04 Thread siggi
Thanks for that, too!

Would be interesting to learn how these different algorithms influence the 
precision of the result!?



Boris Borcic [EMAIL PROTECTED] schrieb im Newsbeitrag 
news:[EMAIL PROTECTED]
 siggi wrote:
 Hi all,

 this is a newbie question on :
 Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] 
 on
 win32
 PC with WinXP

 In
 http://www.python.org/doc/2.3.5/lib/module-math.html
 I read:

 sqrt( x) Return the square root of x.

 Now the test for module math with function pow():
 ---
 pow(9,9)
 387420489

  Fine, but sqrt() fails:
 ---

 BTW note that (of course) you can write pow(x,.5) or x**.5 for sqrt(x)
 without any preliminary import statement 


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