Parallel port programming on windows XP/2000?

2005-08-02 Thread Novice Experl
I'd like to write a simple application that interfaces with the parallel port, and changes the data on it according to keyboard input. I hope I can get it to run under windows xp and / or windows 2000. How can I do this? What do I need to know? It doesn't look like the standard library (the one

Re: JBUS and Python which way

2005-08-02 Thread Oren Tirosh
If you can't find any JBUS/Modbus modules specific for Python it's possible to use one of the many C/C++ modules available and make a Python wrapper for it with an interface generator like SWIG or SIP. You say that you don't have much technical background so you may consider hiring someone to do it

RE: Pythoncom scripting Windows Media Player & visible

2005-08-02 Thread Stefan Schukat
Hello, you have to put the ocx in a container window (e.g. a dialog or the IE). Without this the media player just acts like a normal COM object. Example for the dialog you can find in [Pythonroot]\Lib\site-packages\pythonwin\pywin\Demos\ocx Bye Stefan > -Original

Re: Wheel-reinvention with Python

2005-08-02 Thread Torsten Bronger
Hallöchen! Mike Meyer <[EMAIL PROTECTED]> writes: > Torsten Bronger <[EMAIL PROTECTED]> writes: > >> [...] >> >> Because such projects attract the greatest number of developers, >> many of them being amongst the most diligent developers, too. I >> expect this to have a positive influence of the

Request for Input re PyCon about Session Lengths

2005-08-02 Thread Jeff Rush
There is a discussion going on regarding how long the presentations should be for PyCon 2006. In the past the sessions have been 20 minutes of talk, 5 minutes of questions and 5 minutes to change rooms, grouped into 90-minute timeslots, with a 30-minute break btw each 90-minutes. There were co

Re: Standards not standard

2005-08-02 Thread Dark Cowherd
> > I really think that the community needs a lot more of STANDARDS not > > a STANDARD GUI > > Standards happen in one of two ways. Either an 800-lb gorrilla > establishes them by fiat, or a group of people interested in having > their code play well together hashes out something after they've all

Re: Setting a drive's volume label

2005-08-02 Thread Bob Greschke
Looks like the "label" system command will do it in Windows. That's good enough for this exercise. So, in Linux...??? "Bob Greschke" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > ...the name for a drive (hard or removable) that shows up when, for > example, a USB flash drive

Re: Python for embedded linux?

2005-08-02 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > Where can I find a minimal version of python (less than 2 MB) suitable for > a web server on an embedded linux system? The small size is required > because the system lives on flash memory. Such things have been discussed in this list/newsgroup before. I suggest tryin

using httplib for authentication

2005-08-02 Thread James Stroud
Hello All, I want to use python to download files from sites where authentication is required. The page appears to send a form with the login and pass by post. I would like to log in and keep this session open within python and download a number of files automatically. Could anyone kindly point

RE: HELP:sorting list of outline numbers

2005-08-02 Thread Delaney, Timothy (Tim)
Scott David Daniels wrote: > For 2.3: (using DSU -- Decorate, Sort, Undecorate) > def numparts(outlinetext): > return [int(number) for number in outlinetext.split('.')] > > lst = ['1', '1.2', '1.12', '1.1', '3.1'] > decorated = [(numparts(txt), txt) for txt in lst] >

Weekly Python Patch/Bug Summary

2005-08-02 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 354 open ( -3) / 2888 closed ( +3) / 3242 total ( +0) Bugs: 909 open (+11) / 5152 closed ( +8) / 6061 total (+19) RFE : 191 open ( +0) / 178 closed ( +0) / 369 total ( +0) Patches Closed __ PEP 342 Generator enhance

Re: HELP:sorting list of outline numbers

2005-08-02 Thread Felix Collins
Felix Collins wrote: > > Thanks Scott and Robert for your quick help. This list is amazing! > > Regards, > Felix Using Decorate, Sort , Undecorate... works like a charm. Thanks again. Felix -- http://mail.python.org/mailman/listinfo/python-list

Re: Wheel-reinvention with Python

2005-08-02 Thread Cliff Wells
On Tue, 2005-08-02 at 20:17 -0400, Mike Meyer wrote: > Um - you're not answering the question I asked. I asked "What app do I > use to bundle my applications for Unix, ala py2exe (or whatever it is) > for Windows?" You're telling me how to install wxPython on those > platforms. > I know how to ins

Re: Using win32com for web automation

2005-08-02 Thread Chris Smith
> "calfdog" == calfdog <[EMAIL PROTECTED]> writes: calfdog> ina wrote: >> Look up pamie it should do all the work you need. If it dosn't >> I can send you ishyBrowser but pamie has more comunity support. calfdog> # wait for the document to fully load calfdog> while ie.R

Re: HELP:sorting list of outline numbers

2005-08-02 Thread Felix Collins
Robert Kern wrote: > Felix Collins wrote: > > Use the "key" keyword argument to list.sort(). > > In [1]: outline = ['1.12', '1.1', '1', '1.2'] > > In [2]: outline.sort(key=lambda x: map(int, x.split('.'))) > > In [3]: outline > Out[3]: ['1', '1.1', '1.2', '1.12'] > Is this new in 2.4? I hav

Re: HELP:sorting list of outline numbers

2005-08-02 Thread Scott David Daniels
Felix Collins wrote: > Hi All, > does anyone know any cleaver tricks to sort a list of outline numbers. For 2.4 and beyond: (using a key function) def numparts(outlinetext): return [int(number) for number in outlinetext.split('.')] lst = ['1', '1.2', '1.12', '1.1', '3.1']

Re: HELP:sorting list of outline numbers

2005-08-02 Thread Robert Kern
Felix Collins wrote: > Hi All, > does anyone know any cleaver tricks to sort a list of outline numbers. > > An outline number is a number of the form...1.2.3 > > they should be sorted in the following way... > > 1 > 1.1 > 1.2 > 1.12 > > python's alpha sort (by design) sorts them... > > 1 >

HELP:sorting list of outline numbers

2005-08-02 Thread Felix Collins
Hi All, does anyone know any cleaver tricks to sort a list of outline numbers. An outline number is a number of the form...1.2.3 they should be sorted in the following way... 1 1.1 1.2 1.12 python's alpha sort (by design) sorts them... 1 1.1 1.12 1.2 That's no good for me. I'm planning on

Re: Wheel-reinvention with Python

2005-08-02 Thread Mike Meyer
Paul McNett <[EMAIL PROTECTED]> writes: >>>project I've found, but still doable. >> Well, I've got a long history of installing things from source - >> going >> back to v6. On OS X, I like the darwin ports stuff, so I tried that: >> % sudo port install wxpython >> It blew up trying to compile wxpyt

Setting a drive's volume label

2005-08-02 Thread Bob Greschke
...the name for a drive (hard or removable) that shows up when, for example, a USB flash drive is recognized by the system. I don't know if this shows up somewhere in Linux. Can this be set from Python? I guess it would be some MFC call in Windows (I don't know anything about doing that), and

Re: Wheel-reinvention with Python

2005-08-02 Thread Mike Meyer
Torsten Bronger <[EMAIL PROTECTED]> writes: > Hallöchen! > Mike Meyer <[EMAIL PROTECTED]> writes: >> Torsten Bronger <[EMAIL PROTECTED]> writes: >>> [...] >>> I'm interested in a language with a big community. This is my >>> definition of success. [...] >>> >>> GUI applications seem to be the mo

Re: Wheel-reinvention with Python

2005-08-02 Thread Mike Meyer
[EMAIL PROTECTED] (phil hunt) writes: > On Tue, 02 Aug 2005 00:42:53 -0400, Mike Meyer <[EMAIL PROTECTED]> wrote: >>[EMAIL PROTECTED] (phil hunt) writes: >>> In practise any Python GUI is going to contain code from otyher >>> languages since if it was coded all the way down in python it would >>

pygettext ?

2005-08-02 Thread cantabile
Hi, I'm trying to write an internationalized app. I'm learning python and read that pygettext would help me, but I found elsewhere it was obsolete (??) So, what's the correct and up to date tool to i18n python ? Is there a tutorial somewhere (python docs has nothing really usable : I'd like at l

Re: Wheel-reinvention with Python

2005-08-02 Thread Mike Meyer
Jorge Godoy <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >>> In fact this sounds more like a joke I've heard a while ago: standards, >>> if you don't like the ones out there, create your own. >> Works for me. > What works for you? You believe that chaos is better than having standards? > I bel

Re: Wheel-reinvention with Python

2005-08-02 Thread Mike Meyer
Cliff Wells <[EMAIL PROTECTED]> writes: >> > Regardless, when you say "Unix", what do you mean? You may as well say >> > "OS" as this term has little meaning. Linux (which flavor)? BSD? SCO? >> > HPUX? OS/X? Minix? Whichever way, I suspect that a bit of distutils >> > hacking would solve yo

Re: startfile problems

2005-08-02 Thread Timothy Smith
Michael Hoffman wrote: >Timothy Smith wrote: > > > >>yep the program is executed in the same dir as the pdf file. like i said >>it actually opens it, but throws up an exception as well. >> >> > >You are far more likely to get informed help if you post the traceback >here, as has been sugge

Re: startfile problems

2005-08-02 Thread Michael Hoffman
Timothy Smith wrote: > yep the program is executed in the same dir as the pdf file. like i said > it actually opens it, but throws up an exception as well. You are far more likely to get informed help if you post the traceback here, as has been suggested twice already. -- Michael Hoffman -- h

Python for embedded linux?

2005-08-02 Thread pythonic
Where can I find a minimal version of python (less than 2 MB) suitable for a web server on an embedded linux system? The small size is required because the system lives on flash memory. Thanks, Ken Seehart -- http://mail.python.org/mailman/listinfo/python-list

Re: bug in python/numarray

2005-08-02 Thread Xiangyi
Robert and Terry- Thank you so much for helping me on this! Yes, it's a problem due to an old version of numarray. I didn't realize that my windows has a much newer version than the debian machine. Best, Xiangyi - Original Message - From: "Robert Kern" <[EMAIL PROTECTED]> To: Sent: Tu

Re: startfile problems

2005-08-02 Thread Timothy Smith
Dennis Lee Bieber wrote: >On Tue, 02 Aug 2005 17:35:27 +1000, Timothy Smith ><[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > >>it's iterally just >> >>PDFname = 'tmp.pdf' >>os.startfile(PDFname) >> >>thats the code. >> >> >> > No "import os"? > And the fu

Re: Script for generating WSDL

2005-08-02 Thread pythonUser_07
Is that possible? In order to access a web service it seems like you need to know how it is defined (IE through the WSDL) -- http://mail.python.org/mailman/listinfo/python-list

Re: Pickle, __init__, and classes

2005-08-02 Thread Peter Hansen
Russell Blau wrote: > Try __new__(). http://docs.python.org/ref/customization.html This isn't > the usual application of __new__, but since it returns an object it should > be ideal for your purposes. Or simply create a factory function to return your instances -- which is in effect what __new_

Re: Art of Unit Testing

2005-08-02 Thread Peter Hansen
Christoph Zwerschke wrote: > I completely agree and I think it makes a lot of sense that unittest > calls setUp and tearDown for every single test. However, the fact that > this is *generally* the best way doesn't exclude the fact that there are > *exceptions* when it makes sense to setUp and te

Re: Art of Unit Testing

2005-08-02 Thread rafi
rafi wrote: > In order to unit test a function / method one should use mock objects, > otherwise you may not be sure that your code is faulty. 'should' may be too strong, 'may' may be better. In the meantime I found: http://python-mock.sourceforge.net/ my 2 cents -- rafi "Im

Re: time.clock() or time.time()

2005-08-02 Thread Peter Hansen
Magnus Lycka wrote: > On Windows, you're likely to prefer time.clock(), to > measure relative times, since time.time() will have too low resolution > for measuring short thingies. Specifically, using the NT/XP family of Windows operating systems time.time() has a resolution of approximately 0.01

Re: Art of Unit Testing

2005-08-02 Thread rafi
Christoph Zwerschke wrote: > Björn Lindström wrote: > > I already gave the example of creating database connections > or even creating/importing whole databases. My question was, how do I > handle these cases with the standard lib unittest? I do not get why a unit test whould create/import a wh

Re: Printing Docstrings Without Importing

2005-08-02 Thread Chris
Fuzzyman wrote: > This seems to scratch several people's itches. As I understand it it is something like generating "pythondoc" like javadoc? Should be pretty easy to develop something a bit more polished than Bengt's solution (or based on it of course) with maybe similar to javadoc framesets f

Re: Pickle, __init__, and classes

2005-08-02 Thread Russell Blau
"Yin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I've created a class that reads in and processes a file in the > initializer __init__. The processing is fairly substantial, and thus, > instead of processing the file every time the object is created, I > pickle the object to a f

Re: Art of Unit Testing

2005-08-02 Thread Benjamin Niemann
Christoph Zwerschke wrote: > Thanks for the link, Grig. I wasn't aware of the py lib so far. The > possibility to create fixtures at the three different scopes is exactly > what I was looking for. > > Anyway, I think it would be nice to have that feature in the standard > lib unittest as well. It

Re: trying to parse non valid html documents with HTMLParser

2005-08-02 Thread Benji York
florent wrote: > I'm trying to parse html documents from the web, using the HTMLParser > class of the HTMLParser module (python 2.3), but some web documents are > not fully valids. From http://www.crummy.com/software/BeautifulSoup/: You didn't write that awful page. You're just trying to

Re: Python IDE's

2005-08-02 Thread Benji York
Adriaan Renting wrote: > vi/vim is a godssend if you need a working system that needs to fit in 4 > Mb or ROM, but it's an editor not an IDE. > When talking about IDE's I mean a lot more as 'just' an editor, below is > my 'wishlist', I would be very interested what solutions you use, how > much ti

Re: trying to parse non valid html documents with HTMLParser

2005-08-02 Thread Benjamin Niemann
florent wrote: > I'm trying to parse html documents from the web, using the HTMLParser > class of the HTMLParser module (python 2.3), but some web documents are > not fully valids. Some?? Most of them :( > When the parser finds an invalid tag, he raises an > exception. Then it seems impossible

Pickle, __init__, and classes

2005-08-02 Thread Yin
I've created a class that reads in and processes a file in the initializer __init__. The processing is fairly substantial, and thus, instead of processing the file every time the object is created, I pickle the object to a file. In subsequent creations of the object, I implement a test to see whe

Re: py2exe windows apps path question

2005-08-02 Thread vincent wehren
"Gregory Piñero" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > If you need something that works both on a frozen app as well as an > (unfrozen) python > script, you'd be better off using something like: > >> def getAppPrefix(): >> """Return the location the app is runnin

Re: bug in python/numarray

2005-08-02 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Hi, there, > > I got different results by running the same lines of code on windows and > debian. Here is the code: > > a = kroneckerproduct(ones((4195,1)), identity(12)) > print a.mean() > > This works perfectly well in windows but it gave the following error while

Re: Newer than a Newbe

2005-08-02 Thread Luis M. Gonzalez
linuxfreak wrote: > Look at Karrigell. Its a web framework for Python > > http://karrigell.sourceforge.net I second this suggestion. Karrigell is a pleasure to work with and I'm sure it will appeal any python fun who dare to play with it. I also hope Pierre (its developer) lose some of his modest

Re: finding sublist

2005-08-02 Thread giampiero mu
controlla("12345678") -> "12345678" thanks everyone. only a question. there is a way to advantage of binary sequences? -- http://mail.python.org/mailman/listinfo/python-list

Re: pre subprocess help needed

2005-08-02 Thread [EMAIL PROTECTED]
You can also use the spawn functions in os, together with the P_WAIT mode. os.spawnlp(os.P_WAIT, 'ls', 'ls') gconfd-martin kde-martin mcop-martin ssh-PhJzdB6333 gpg-bSRhOE ksocket-martin orbit-martin 0 os.spawnlp(os.P_WAIT, 'spam', 'spam') 127 -- http://mail.python.org/mailman/listi

Re: py2exe windows apps path question

2005-08-02 Thread Grant Edwards
On 2005-08-02, vincent wehren <[EMAIL PROTECTED]> wrote: > If you are building paths in you code that are relative to > your app, I'm not using any paths. I use cytpes to load a .dll, and I don't really know what gnuplot-py is doing, but I think it's executing a .exe file and talking to it via a

trying to parse non valid html documents with HTMLParser

2005-08-02 Thread florent
I'm trying to parse html documents from the web, using the HTMLParser class of the HTMLParser module (python 2.3), but some web documents are not fully valids. When the parser finds an invalid tag, he raises an exception. Then it seems impossible to resume the parsing just after where the excep

Fredericksburg, VA Zope and Python User Group

2005-08-02 Thread Benji York
Please join us August 10, 7:30-9:00 PM, for the third meeting of the Fredericksburg, VA Zope and Python User Group ("ZPUG"). This meeting has four features of note. - Brian Lloyd, the author of Python for .Net (http://www.zope.org/ Members/Brian/PythonNet/) and the Zope Corporation VP of Engineer

Re: Art of Unit Testing

2005-08-02 Thread Christoph Zwerschke
Björn Lindström wrote: >>Would it make sense to add "globaleSetup" and "globalTearDown" methods >>to the TestCase class? > In general that's not such a good idea. I completely agree and I think it makes a lot of sense that unittest calls setUp and tearDown for every single test. However, the fact

Re: a pickle's pickle

2005-08-02 Thread [EMAIL PROTECTED]
Benji, Thanks so much, you have saved the day ^_^ -- http://mail.python.org/mailman/listinfo/python-list

Re: bug in python/numarray

2005-08-02 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, there, > > I got different results by running the same lines of code on windows and > debian. Here is the code: > > a = kroneckerproduct(ones((4195,1)), identity(12)) I don't know what this does, but wonder if it uses a lot of mem

Re: Art of Unit Testing

2005-08-02 Thread Christoph Zwerschke
Thanks for the link, Grig. I wasn't aware of the py lib so far. The possibility to create fixtures at the three different scopes is exactly what I was looking for. Anyway, I think it would be nice to have that feature in the standard lib unittest as well. It should not be too hard to add setUpO

Re: a pickle's pickle

2005-08-02 Thread Benji York
[EMAIL PROTECTED] wrote: > So basically trainer always gets an existing TrainingMatrix(the class) > pickled object if there is a file to read from, otherwise it just makes > a new instance. Either way, the instance trainer is pickled at the end. Right, but the data you're interested in is contain

Re: Dabo in 30 seconds?

2005-08-02 Thread Fernando Perez
Paul McNett wrote: > Fernando Perez wrote: >> If you are interested, just get ipython and grab the files for this, it's >> all >> BSD licensed. You can also browse the SVN repo here if you want to look at >> the code: >> >> http://ipython.scipy.org/svn/ipython/ipython/trunk/IPython/ >> >> The

Re: py2exe windows apps path question

2005-08-02 Thread Gregory Piñero
> If you need something that works both on a frozen app as well as an > (unfrozen) python > script, you'd be better off using something like: > > def getAppPrefix(): > """Return the location the app is running from > """ > isFrozen = False > try: > isFrozen = sys.frozen >

IronPython 0.9 Released

2005-08-02 Thread Luis M. Gonzalez
IronPython 0.9 Released(8/2/2005 10:28:41 AM) http://www.microsoft.com/downloads/details.aspx?familyid=cf5ae627-5df1-4f8a-ba8b-d64f0676f43f&displaylang=en -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe windows apps path question

2005-08-02 Thread vincent wehren
"Grant Edwards" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] | On 2005-08-02, vincent wehren <[EMAIL PROTECTED]> wrote: | > | > "Grant Edwards" <[EMAIL PROTECTED]> schrieb im Newsbeitrag | > news:[EMAIL PROTECTED] | >|I have several python apps (some wxPython, some plain text-

Re: py2exe windows apps path question

2005-08-02 Thread vincent wehren
"Gregory Piñero" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] |And here is how I make sure I'm always using the right directory in my scripts: | |Put this code at the top: |import sys |curdir=os.path.dirname(sys.argv[0]) |#print curdir |Then I use curdir to build all of the

Re: py2exe windows apps path question

2005-08-02 Thread Grant Edwards
On 2005-08-02, vincent wehren <[EMAIL PROTECTED]> wrote: > > "Grant Edwards" <[EMAIL PROTECTED]> schrieb im Newsbeitrag > news:[EMAIL PROTECTED] >|I have several python apps (some wxPython, some plain text-mode >| stuff) that I distribute internally for installation on Win32 >| machines. They're

Re: 2-player game, client and server at localhost

2005-08-02 Thread Christopher Subich
Michael Rybak wrote: > CS> There's the key. How are you processing network input, specifically > CS> retrieving it from the socket? > > A "sock" class has a socket with 0.1 timeout, and every time I > want anything, I call it's read_command() method until it returns > anything. read_command(

Re: py2exe windows apps path question

2005-08-02 Thread Gregory Piñero
On 8/2/05, Gregory Piñero <[EMAIL PROTECTED]> wrote: > Vincent, I'm not sure I completely understand your question but this > link may be the answer nonetheless: > http://www.jrsoftware.org/isfaq.php#workingdir I meant to say Grant, ... , Vincent wasn't the one with the question. Sorry. -- http:

Re: Dabo in 30 seconds?

2005-08-02 Thread Ed Leafe
On Tuesday 02 August 2005 13:40, Fernando Perez wrote: > The point is that something like this: > > - gives an experienced user a lot of information to track down the bug if > they feel like it. > > - but also gives the raw newbie an easy solution: just mail me that > auto-generated crash file and

Re: py2exe windows apps path question

2005-08-02 Thread Gregory Piñero
Vincent, I'm not sure I completely understand your question but this link may be the answer nonetheless: http://www.jrsoftware.org/isfaq.php#workingdir And here is how I make sure I'm always using the right directory in my scripts: Put this code at the top: import sys curdir=os.path.dirname(sys.a

Re: Dabo in 30 seconds?

2005-08-02 Thread Paul McNett
Fernando Perez wrote: > > > You may want to steal the crash handling code from ipython. In order to > address this kind of problem, ipython sticks an exceptionally verbose > traceback printer into sys.excepthook. If ipython ever crashes, the user gets > a LOT of info, and it's all packaged read

Re: Art of Unit Testing

2005-08-02 Thread John Roth
""Björn Lindström"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Christoph Zwerschke <[EMAIL PROTECTED]> writes: > >> Would it make sense to add "globaleSetup" and "globalTearDown" methods >> to the TestCase class? I think at least it would not harm >> anybody. Where should such p

Re: Dabo in 30 seconds?

2005-08-02 Thread Fernando Perez
Ed Leafe wrote: > On Monday 01 August 2005 11:56, Terry Reedy wrote: > >> That is an impossibility.  However, there is a middle path between that and >> no defensive code.  In the present case, you appear to acknowledge a known >> easy way to mis-compile wxWidgets from Dabo's viewpoint.  If there

Re: pre subprocess help needed

2005-08-02 Thread Chris Lambacher
There is a version of subprocess for 2.3. http://www.lysator.liu.se/~astrand/popen5/ http://effbot.org/downloads/#subprocess On Tue, Aug 02, 2005 at 10:05:00AM -0700, chuck wrote: > I need to execute a command shell process obtain the return code and > capture stdout from that shell process. I'v

Re: finding sublist

2005-08-02 Thread Johan Lindberg
Hello. > my target is implement a function controlla(string - a binary string-) > that check if there is in a string two equal not overlapping > subsequences at least of length limitem: > > my code: > [snip] > I may have misunderstood it, but does your function work the way you want it to? >>>co

bug in python/numarray

2005-08-02 Thread meng
Hi, there, I got different results by running the same lines of code on windows and debian. Here is the code: a = kroneckerproduct(ones((4195,1)), identity(12)) print a.mean() This works perfectly well in windows but it gave the following error while running it in debian: Traceback (most recen

Re: py2exe windows apps path question

2005-08-02 Thread vincent wehren
"Grant Edwards" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] |I have several python apps (some wxPython, some plain text-mode | stuff) that I distribute internally for installation on Win32 | machines. They're bundled/installed using py2exe and inno | setup. | | I followed w

Re: a pickle's pickle

2005-08-02 Thread [EMAIL PROTECTED]
I intended to pickle the class instance I call trainer...from my code, also in the first post: trainerString = trainDB.read() trainer = loads(trainerString) except EOFError: trainer = TrainingMatrix() ... trainerString = dumps(trainer) ... So basically trainer always gets an

Re: Printing Docstrings Without Importing

2005-08-02 Thread Bengt Richter
On 1 Aug 2005 06:50:23 -0700, "Fuzzyman" <[EMAIL PROTECTED]> wrote: >This seems to scratch several people's itches. > >Care to develop/maintain it ? > Are you talking to me? ;-) (My news server is having some problem. I saw my post on google groups but my normal news client isn't seeing it.) Ass

Pythoncom scripting Windows Media Player & visible

2005-08-02 Thread Bill Eldridge
I'm trying to make Windows Media Player visible and control it from Python. It seems when I call it below, I get only the console version, and there's no Visible method like with Internet Explorer. I do catch events, but I need it visible. Should it be put into a panel instead? Should a different

pre subprocess help needed

2005-08-02 Thread chuck
I need to execute a command shell process obtain the return code and capture stdout from that shell process. I've done this with 2.4 using subprocess. How do I do it with 2.3? -- http://mail.python.org/mailman/listinfo/python-list

pre subprocess module help

2005-08-02 Thread chuck
I need to execute a command shell process obtain the return code and capture stdout from that shell process. I've done this with 2.4 using subprocess. How do I do it with 2.3? -- http://mail.python.org/mailman/listinfo/python-list

pre subprocess module help

2005-08-02 Thread chuck
I need to execute a command shell process obtain the return code and capture stdout from that shell process. I've done this with 2.4 using subprocess. How do I do it with 2.3? -- http://mail.python.org/mailman/listinfo/python-list

Re: Art of Unit Testing

2005-08-02 Thread Björn Lindström
Christoph Zwerschke <[EMAIL PROTECTED]> writes: > Would it make sense to add "globaleSetup" and "globalTearDown" methods > to the TestCase class? I think at least it would not harm > anybody. Where should such proposals be submitted? In general that's not such a good idea. If you build your tests

Re: time.clock() or time.time()

2005-08-02 Thread Magnus Lycka
Shane Hathaway wrote: > time.time() measures real time, while time.clock() measures the time the > CPU dedicates to your program. I suppose that varies with the platform... "help(time.clock)" says: Help on built-in function clock: clock(...) clock() -> floating point number Return t

Re: a pickle's pickle

2005-08-02 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > class TrainingMatrix: > matrix = [] > estimator = {} > wordInfo = {} > contextInfo = {} > totalWordsProcessed = 0 > numWords = 0 > numContexts = 0 > matrixWords = 0 Is there some confusion between the scope of the class object and the sco

Re: Art of Unit Testing

2005-08-02 Thread Grig Gheorghiu
The py.test module offers setup/teardown hooks at the method, class and module level. The scenario you're describing would be covered at the module level. See the py.test documentation for more details:

Art of Unit Testing

2005-08-02 Thread Christoph Zwerschke
In August 2001, there was a thread about the "Art of Unit Testing": http://groups.google.com/group/comp.lang.python/browse_frm/thread/aa2bd17e7f995d05/71a29faf0a0485d5 Paul Moore asked the legitimate question why there is no hook for a "global" fixture code that is run only once for the whole Tes

Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

2005-08-02 Thread Ralf W. Grosse-Kunstleve
--- falcon <[EMAIL PROTECTED]> wrote: > Hello python-list, > > As I Understood, semantic may be next: > > def qwerty(a,a.i,b,b.i,f.j): > pass > > Would work like: > > def qwerty(anonymous1,anonymous2,anonymous3,anonymous4,anonymous5): > > (a,a.i,b,b.i,f.j)=(anonymous1,anonymo

Re: time.clock() or time.time()

2005-08-02 Thread Leonhard Vogt
[EMAIL PROTECTED] schrieb: > What's the difference between time.clock() and time.time() > (and please don't say clock() is the CPU clock and time() is the actual > time because that doesn't help me at all :) clock (depending on the platform ?) measures the time spent by your program. Time gives y

Re: finding sublist

2005-08-02 Thread Ron Adam
giampiero mu wrote: > hi everyone Hi, you appear to be fairly new to Python, so you might want to take a look at the tutorial at Python.org Kents suggestion to use RE is good. This should be faster than your example by quite a bit if you don't want to use RE. def controlla(test, size=4):

Re[2]: 2-player game, client and server at localhost

2005-08-02 Thread Michael Rybak
CS> Michael Rybak wrote: >> That's the problem - "or a player input comes in". As I've explained, >> this happens a dozen of times per second :(. I've even tried not >> checking for player's input after every frame, but do it 3 times more >> rare (if framecount % 3 == 0 : process_players_input()).

Re: Why Tcl/Tk?

2005-08-02 Thread William Park
Thomas Bartkus <[EMAIL PROTECTED]> wrote: > > "William Park" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Jerry He <[EMAIL PROTECTED]> wrote: > > > I'm a little curious, why does most scripting > > > languges(i.e. python and ruby) use Tcl/Tk rather than > > > wx or Fox as its

Re: time.clock() or time.time()

2005-08-02 Thread Shane Hathaway
[EMAIL PROTECTED] wrote: > What's the difference between time.clock() and time.time() > (and please don't say clock() is the CPU clock and time() is the actual > time because that doesn't help me at all :) > > I'm trying to benchmark some function calls for Zope project and when I > use t0=time.cl

Re: Terminate a thread that doesn't check for events

2005-08-02 Thread Chris Lambacher
No. On Linux a separate thread is a separate process with shared memory. You can send a signal to a particular process and catch that signal as an indication that you need to terminate (perhapse something that is set up before running your long running process so that it is generic). In windows

a pickle's pickle

2005-08-02 Thread [EMAIL PROTECTED]
I'm trying to pickle a class, and while I get no errors or anything, almost none of the class instance gets pickled, and I don't know why...Here's the pickled output: (i__main__ TrainingMatrix p0 (dp1 S'matrixWords' p2 I4714 sS'numWords' p3 I4714 sS'totalWordsProcessed' p4 I46735 sS'numContexts' p

RE: Terminate a thread that doesn't check for events

2005-08-02 Thread Liu Shuai
Thanks for the reply Chris. Are you suggesting running the task in a *separate* process instead of a separate *thread*? Because if that's the case, I will have to share data (and possible memory) between that new process and my "master" process since they depend on one other. Yeah I will sure po

time.clock() or time.time()

2005-08-02 Thread [EMAIL PROTECTED]
What's the difference between time.clock() and time.time() (and please don't say clock() is the CPU clock and time() is the actual time because that doesn't help me at all :) I'm trying to benchmark some function calls for Zope project and when I use t0=time.clock(); foo(); print time.clock()-t0 I

Re: Python IDE's

2005-08-02 Thread projecktzero
The thing that nudged me into trying VIM was the book, The Pragmatic Programmer. It mentioned Emacs and VIM and the value of learning a powerful editor and sticking with it. I had tried Emacs three times long ago, and it didn't click with me. I decided to try VIM, and it made a lot more sense to me

RE: Terminate a thread that doesn't check for events

2005-08-02 Thread Jp Calderone
On Tue, 2 Aug 2005 09:51:31 -0400, Liu Shuai <[EMAIL PROTECTED]> wrote: >Can someone please comment on this? > > [snip - how to stop a thread without its cooperation?] There's no way to do this with threads, sorry. Perhaps you could use a child process, instead. Those are typically easy to term

Re: 2-player game, client and server at localhost

2005-08-02 Thread Christopher Subich
Michael Rybak wrote: > That's the problem - "or a player input comes in". As I've explained, > this happens a dozen of times per second :(. I've even tried not > checking for player's input after every frame, but do it 3 times more > rare (if framecount % 3 == 0 : process_players_input()). Well, I

Re: Tkinter, Menu(bar) font size

2005-08-02 Thread Bob Greschke
Yeah. It works on a Sun and Linux, but not Windows. That stinks. We got a bunch of 1400x1050 display laptops in and now I have to run around changing a bunch of programs that looked fine on 1024x768 displays. Thanks! <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Tk tries to u

Class design for parser object

2005-08-02 Thread James Saker
I've been working on a Python class object for APRS (Automatic Position Reporting System - a digital mode used by amateur radio operators) and have been going through David Mertz's Text Processing in Python book to help in the construction of the parser component of the class. I was curious if

Re: finding sublist

2005-08-02 Thread Kent Johnson
giampiero mu wrote: > hi everyone > > my target is implement a function controlla(string - a binary string-) > that check if there is in a string two equal not overlapping > subsequences at least of length limitem: You can do this with a regular expression: >>> import re >>> r=re.compile(r'(?P

  1   2   >