Re: Using Python with COM to communicate with proprietary Windows software

2005-09-13 Thread Thomas Heller
Andrew MacIntyre <[EMAIL PROTECTED]> writes: > On Fri, 09 Sep 2005 08:36:00 +0200, Thomas Heller <[EMAIL PROTECTED]> > wrote: > > {...} > >>(I have released and announced this 3 weeks ago, but haven't got a >>single feedback. So it seems the need to ac

Re: Using Python with COM to communicate with proprietary Windows software

2005-09-13 Thread Thomas Heller
Joakim Persson <[EMAIL PROTECTED]> writes: > On Fri, 09 Sep 2005 08:36:00 +0200, Thomas Heller <[EMAIL PROTECTED]> > wrote: > >>Sounds like a perfect job for comtypes, which is a COM library >>implemented in pure Python, based on ctypes. comtypes should mak

Re: improvements for the logging package

2005-09-13 Thread Thomas Heller
Peter Otten <[EMAIL PROTECTED]> writes: > Thomas Heller wrote: > >>> OK, it's not right at the top of the docs, but the example at >>> >>> http://docs.python.org/lib/minimal-example.html >>> >>> has been there for a while, a

Re: p2exe using wine/cxoffice

2005-09-13 Thread Thomas Heller
d_error: (120, 'Call not implemented', > 'C:\\Python23\\DLLs\\_sre.pyd') > I guess this means that wine does not implement some function in imagehlp.dll (which py2exe_util uses). It *may* be possible to write a pure Python version of the binary dependency analysis (afaik, McMillan installer has such code) - but since I don't run py2exe on linux I won't do it myself. Even better would be to fix wine ;-), if my guess is correct. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: improvements for the logging package

2005-09-13 Thread Thomas Heller
"Vinay Sajip" <[EMAIL PROTECTED]> writes: > Thomas Heller wrote: >> Yes, it seems so. Although I would have expected the documentation to >> inform me about incompatible changes in the api. > > It does, in the "in-development" version of the docume

Re: Removing duplicates from a list

2005-09-14 Thread Thomas Guettler
huge list and mine's going to typically have less than 1000 > elements. > > What do you think? Hi, I would use "set": mylist=list(set(mylist)) Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: PyGTK or wXPython?

2005-09-14 Thread Thomas Guettler
I don't know if you can create standalone applications for windows, without installing gtk on the client. Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: stdin and py2exe

2005-09-14 Thread Thomas Heller
t; > input = sys.stdin.read() # Throws a bad descriptor exception. > print input Can it be that you're building a windows exe of subprogram.py? I get the error you describe when I do that, for console programs it works - both in the Python script and in the py2exe'd version. This is, afaik, standard windows behaviour: GUI programs start with stdin, stdout and stderr closed. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: stdin and py2exe

2005-09-14 Thread Thomas Heller
The problem was that passing 'stdin=None' didn't work, for whatever reason. I don't think it is a py2exe problem although the comment above may suggest it. Hope that helps, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: python optimization

2005-09-15 Thread Thomas Heller
urn i + amount ... yield adder ... >>> >>> for f in getadders(3): ... print f(42) ... 42 43 44 >>> Seems to work. But observe this: >>> def getadders(to): ... for i in range(to): ... def adder(amount): ... return i

Re: Self reordering list in Python

2005-09-15 Thread Thomas Guettler
the bisect module is what you need: "This module provides support for maintaining a list in sorted order without having to sort the list after each insertion." HTH, Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de S

Re: re and escape character

2005-09-15 Thread Thomas Guettler
oes not match a newline. You have to use the re.DOTALL option if you want this. HTH, Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Search Engine app

2005-09-15 Thread Thomas Guettler
gt; guys' minds on this. Hi, I use ZODB (not ZOPE) with ZCTextIndex. HTH, Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

IDE, widget library

2005-09-15 Thread Thomas Jollans
I guess questions like this come all the time here ... well: I a looking for a python IDE for gnu/linux that : - has decent sytax highlighting (based on scintilla would be neat) - has basic name completition, at least for system-wide modules - has an integrated debugger - is open source, or at lea

Re: IDE, widget library

2005-09-15 Thread Thomas Jollans
Diez B. Roggisch wrote: > Thomas Jollans wrote: >> PyQT obviously doesn't count because qt3 is not free on windows. > > > Not true, there exists a qt free edition port for windows. And I've had > close to no troubles rolling out apps developed under linux. &

/usr/lib/python2.3/site-packages/_mysql.so: undefined symbol: mysql_rollback

2005-09-16 Thread thomas Armstrong
Hello. Python 2.3.4 (#1, Feb 2 2005, 12:11:53) [GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2 MySQL-python-1.2.0 I'm trying to execute this script: -- #!/usr/bin/python import MySQLdb conn = MySQLdb.connect (host = "localhost", user = "root", passwd = "", db = "tes

Re: Accessing shared library file...

2005-09-16 Thread Thomas Jollans
Ernesto wrote: > The .dll file is a shared library file that is associated with a > programming interface for a semi-conductor chip. The chip drivers come > in two different flavors: One is a .dll (for Windows) and the other is > a shared library file for Linux. The name of the Linux file is > "

Re: Python 2.5 alpha

2005-09-18 Thread Thomas Jollans
D.Hering wrote: > under gentoo linux 2.6. that does not exist. gentoo labels installers 2005.0 etc, but I have never heard of version numbers. do you mean gentoo with linux 2.6 ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Roguelike programmers needed

2005-09-18 Thread Thomas Jollans
what exactly is RPG/roguelike etc ? (what debian package provides an example?) -- http://mail.python.org/mailman/listinfo/python-list

Re: How does f=open('mytext.txt', 'w+') work?

2005-09-18 Thread Thomas Jollans
I have no idea what is happening, but to the subject line: I guess it's a plain wrapper around fopen fron -- http://mail.python.org/mailman/listinfo/python-list

Re: Searching for a working example of a curses application that resizes in xterm

2005-09-19 Thread Thomas Guettler
t;mutt" or "less". HTH, Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe 0.6.2 version resources

2005-09-20 Thread Thomas Heller
or any help. In py2exe 0.5 and 0.6 you can no longer specify the versionresource in setup.cfg. The advanced sample in lib\site-packages\py2exe\samples\advanced demonstrated how to do it. > Greets, > Klaus Thomas -- http://mail.python.org/mailman/listinfo/python-list

Getting tired with py2exe

2005-09-20 Thread Thomas Heller
also Philip Eby's setuptools (that's why I post to distutils-sig as well)... Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: /usr/lib/python2.3/site-packages/_mysql.so: undefined symbol: mysql_rollback

2005-09-21 Thread thomas Armstrong
l.so*" (no results) - Must I install some extra tool? Thank you very much. 2005/9/16, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > thomas> ImportError: /usr/lib/python2.3/site-packages/_mysql.so: undefined > thomas> symbol: mysql_rollback > > ski

Re: Choosing the right parser for parsing C headers

2005-02-08 Thread Thomas Heller
call "shaking > the broken tree" :) IMO, for parsing 'real-world' C header files, nothing can beat gccxml. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Efficient checksum calculating on lagre files

2005-02-08 Thread Thomas Heller
give or take as md5sum itself. This isn't suprising since md5sum is > dominated by CPU usage of the MD5 routine (in C in both cases) and/or > io (also in C). Your code won't work correctly on Windows, since you have to open files with mode 'rb'. But there's a perfect working version in the Python distribution already: tools/Scripts/md5sum.py Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: variable declaration

2005-02-08 Thread Thomas Bartkus
ct, let alone trace! Before one even tries, it behooves one to spell check his variables. An additional step that counters Python's procedural simplicity. "i" comes before "e" except after "c" OR whenever I make a typo! Thomas Bartkus -- http://mail.python.org/mailman/listinfo/python-list

Re: Performance Issues of MySQL with Python

2005-02-09 Thread Thomas Bartkus
language you select. The 2 functions, database server and programming language, do not interact in ways that raise unique performance issues. You can choose each one without worrying about the other. They two quite separate design choices. Thomas Bartkus -- http://mail.python.org/mailman/listinfo/python-list

Re: pyFMOD writing a callback function in Python

2005-02-10 Thread Thomas Heller
Python and have zero idea what the problem is nor how to > solve it. In some of my other languages I would have to explicitly make a > function pointer and possibly have to cast that to an int to pass it to > SetEndCallback, but that seems very inappropriate in Python... Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: PyINI : Cross-Platform INI parser

2005-02-11 Thread Thomas Heller
ng, without removing user commands, etc. This is what > Windows APIs do, and it is what I am missing from most INI parsing libraries > out there. You can easily access the windows apis either with pywin32, or with ctypes for those functions that aren't wrapped in pywin32. Thomas -- http://mail.python.org/mailman/listinfo/python-list

StringIO objects sharing a buffer

2005-02-15 Thread Thomas Lotze
O for this purpose? (An alternative would be a tokenizer class that has a StringIO instead of being one and do the file pointer housekeeping in there.) -- Thomas -- http://mail.python.org/mailman/listinfo/python-list

Copying data between file-like objects

2005-02-15 Thread Thomas Lotze
g, only without having to create and throw away anything while overwriting a copy buffer, and being used to doing everything the pedestrian way, anyway.) -- Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: PythonCard and Py2Exe

2005-02-15 Thread Thomas Heller
ox is central > to the script's use. > > My computer runs the script fine, so the radiogroup module must be > there. I must just have the imports written wrong. You should move these 'import ...' statements to your *script* so that py2exe doesn find them, not to the setup script. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Copying data between file-like objects

2005-02-15 Thread Thomas Lotze
I admit, is why the difference between holding data two or three times in memory matters that much, especially if the latter is only for a short time. But as I'm going to use the code that handles the long string as a core component to some application, I'd like to make it behave as well as possible. -- Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Copying data between file-like objects

2005-02-16 Thread Thomas Lotze
ead, so I may be able to avoid reading stuff into memory altogether in certain places without worrying about special cases. > use a plain string and slicing. (if you insist on using StringIO, use > seek and read) OK. -- Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: low-end persistence strategies?

2005-02-16 Thread Thomas Guettler
o read or write) with file locking. This means your cgi application can only serve one request after the other. HTH, Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ -- http://mail.python.org/mailman/listinfo/python-list

supress creation of .pyc files

2005-02-16 Thread Thomas Guettler
Hi, Is there a way to import a file without creating a .pyc file? Of course you can delete the pyc in my script after the import statement, but maybe there is a switch that I have not found yet. The imported file is a config file, not a script. Thomas -- Thomas Güttler, http://www.thomas

Re: Why doesn't join() call str() on its arguments?

2005-02-16 Thread Thomas Heller
Skip Montanaro <[EMAIL PROTECTED]> writes: > John> 4. For consistency, would you like "1" + 2 to produce "12"? > > No, the correct answer is obviously 3. ;-) > > S No, '"1"2' is correct. Or '"1"+2'. -- http://mail.python.org/mailman/listinfo/python-list

Re: Stable GUI

2005-02-17 Thread Thomas Guettler
The reference is good: http://www.pygtk.org/pygtk2reference/index.html Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert a raw pointer to IDispatch

2005-02-17 Thread Thomas Heller
using a C++ DLL to do the > stuff). Do you know a way to do it ? What do you want to do with this pointer? Pass it to a function called via ctypes? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: [newbie]How to install python under DOS and is there any Wxpython can be installed under dos?

2005-02-17 Thread Thomas Heller
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > Maybe somehow the pygame sdl wrapper can be used for gui-stuff. SDL has had > a DOS mode. But it is discontinued. What exactly is discontinued? pygame? SDL? Thomas -- http://mail.python.org/mailman/listinfo/python-list

error in non-existing code?

2005-02-17 Thread Thomas Newman
Hi all, I have added a few files to my project in eric3. When I want to open the tree that (supposedly) shows me the classes, I get an error: Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/UI/Browser

Re: how can i randomly choose keys in dictionary

2005-02-18 Thread Thomas Guettler
random mydict={1: "one", 2: "two"} print mydict[random.choice(mydict.keys())] -- Thomas Güttler, http://www.thomas-guettler.de/ -- http://mail.python.org/mailman/listinfo/python-list

COM+metaclass+property issue

2005-02-18 Thread Thomas Lilley
I'm trying to manufacture a class that provides attributes which mimic the HTML collections offered by the Internet Explorer COM object.  My platform is Win32 (Windows XP) and ActiveState's latest Python 2.3.  The problem is, my attributes are based on properties, which work fine except for when I

Re: unicode encoding usablilty problem

2005-02-18 Thread Thomas Heller
takes ascii strings, but returns a unicode string. - _winreg.OpenKey takes ascii strings - the os.environ["PATH"] accepts an ascii string. And I won't guess what happens when there are registry entries with unlauts (ok, they could be handled by 'mbcs' encoding), and with

Re: unicode encoding usablilty problem

2005-02-18 Thread Thomas Heller
ly, the primary string type should be the Unicode > string. If you are curious how far we are still off that goal, > just try running your program with the -U option. Is it possible to specify a byte string literal when running with the -U option? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode encoding usablilty problem

2005-02-18 Thread Thomas Heller
Traceback (most recent call last): File "", line 1, in ? TypeError: f() keywords must be strings >>> Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: error in non-existing code?

2005-02-19 Thread Thomas Newman
Michael Hoffman wrote: > Thomas Newman wrote: > >> I wanted to look at the code that gives me the error, but there is no >> line 447 in /usr/lib/python2.3/pyclbr.py: > > > Try deleting pyclbr.py[co]. No change there. ttn -- http://mail.python.org/mailman/listinfo/python-list

Re: how to interrupt time.sleep ?

2005-02-22 Thread Thomas Heller
canceled what's the other solution to > "wait certain time/or press any button to continue" problem ? On windows at least, pressing ^C interrupts time.sleep(). print "Press ^C if you don't want to wait" try: time.sleep(60) except KeyboardInterrupt: pass Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: user interface for python

2005-02-23 Thread Thomas Guettler
orm independent? Hi, I like pygtk. It should be portable to windows, but I have not tried this yet. Up to now I only used it under linux. Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ -- http://mail.python.org/mailman/listinfo/python-list

assert 0, "foo" vs. assert(0, "foo")

2005-02-23 Thread Thomas Guettler
ert statement, it never raises an exception. Up to now I raised strings, but since this is deprecated, I switched to use the second argument for the assert statement. Is it possible to change future python versions, that assert accept parenthesis? Thomas -- Thomas Güttler, http://www.thomas-g

Re: running a shell command from a python program

2005-02-23 Thread Thomas Guettler
the answer. I recommend popen4 because it avoids deadlocks if there is output on stdout and stderr. Example: stdout, stdin = popen2.popen4("tidy -q -errors '%s'" % htmlfile) HTH, Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ -- http://mail.python.org/mailman/listinfo/python-list

Re: rounding problem

2005-02-24 Thread Thomas Bartkus
always exhibit "arithmetic slop" at the last significant digit. This is a property inherent to floating point numbers and has nothing to do with how it is stored on any machine. Thomas Bartkus -- http://mail.python.org/mailman/listinfo/python-list

Re: automatic nesting and indentation in emacs

2005-02-25 Thread Thomas Heller
rt-indent" which will automatically align highlighted text to have > the correct indentation. Does Emacs have something similar? Mark the lines to be readjusted, then hit 'C-c >' or 'C-c <'. Or hit 'C-h m' to get an overview for Python mode. Thomas -- http://mail.python.org/mailman/listinfo/python-list

[solved] Re: error in non-existing code?

2005-02-26 Thread Thomas Newman
Thomas Newman wrote: >Michael Hoffman wrote: > > > >>Thomas Newman wrote: >> >> >> >>>I wanted to look at the code that gives me the error, but there is no >>>line 447 in /usr/lib/python2.3/pyclbr.py: >>> >>&

Re: Converting HTML to ASCII

2005-02-27 Thread Thomas Dickey
w, try w3m or links. Both do a better > job of rendering anyway. They lay out tables more/less as expected (though navigation in tables for links seems to be an afterthought). -- Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net -- http://mail.python.org/mailman/listinfo/python-list

Re: accessor/mutator functions

2005-02-28 Thread Thomas Lotze
onically, methods. Accessing methods means to access a callable attribute, after all, with all the stuff going on behind the scenes on attribute access. -- Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython/IEHtmlWindow documentation (what events are available ?)

2005-03-01 Thread Thomas Ganss
anyone point me information please ? That sounds a lot like WebBrowser or (HTML)Document Object Model [DOM]. HTH thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: memory leaks with ctypes LoadLibrary ?

2005-03-01 Thread Thomas Heller
gc: uncollectable > 4 > > What am I doing wrong? Nothing ;-) You could delete or comment out the __del__ method of class CDLL, in the file ctypes/__init__.py. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: memory leaks with ctypes LoadLibrary ?

2005-03-01 Thread Thomas Heller
gc: uncollectable > 4 > > What am I doing wrong? Nothing ;-) You could delete or comment out the __del__ method of class CDLL, in the file ctypes/__init__.py. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Distributing applications

2005-03-02 Thread Thomas Heller
t solution to update applications. Install a client on the target computer, it may be invisible to the user, copy the CVS or SVN directories, and provide a script the does (also invisible) 'cvs up -r version_a_b'. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: How to delete a module file

2005-03-03 Thread Thomas Heller
, but the delete still has to be done after all users of > the file have closed it. Even if you are able to remove/rename the file, it won't help you anyway, because there's no way to reload an extension module in a sane way. AFAIK. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: win32 COM and data types / direction

2005-03-04 Thread Thomas Heller
> Does anybody have experiences in this ? Since there is no type library, the client code has to guess. And it will pass the server whatever the client calls with. That could even be a string or anything else - but why not try it out? *IF* there is a type library that the server implements, you will get and return what it describes. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: parsing a date string

2005-03-07 Thread Thomas Guettler
y %Z: time.mktime(time.strptime("Sat Mar 5 10:38:07 2005 UTC", "%a %b %d %H:%M:%S %Y %Z")) --> 1110015487.0 time.mktime(time.strptime("Sat Mar 5 10:38:07 2005 CEST", "%a %b %d %H:%M:%S %Y %Z")) --> 1110011887.0 HTH, Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe error: 2.4.2.4: No such file or directory

2005-03-07 Thread Thomas Heller
; > The only thing that I can think of is that perhaps I've upgraded my > wxWindows version. I checked and 2.4.2.4 is the version, but I don't > know why py2exe is looking for such a directory. Old versions of wxWindows put an entry in the registry under the HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.x\Modules key. This registry entry is (was) used to extend the Python path, but wxWindows used it to register it's version number. You should try to remove this entry and run py2exe again. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Speeding up CGIHTTPServer (Tim Roberts)

2005-03-08 Thread Thomas Guettler
low. Is there >> anything I can do to make sure I'm getting the best performance out of >> CGIHTTPServer? Hi, Maybe a personal firewall or virus-checker slows it down. Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ -- http://mail.python.org/mailman/listinfo/python-list

determine directories with wildcard

2005-03-08 Thread Thomas Rademacher
Hello, I want to collect with the wildcard '*' all existing directories. For example: /dir/dir/*/dir/*/dir/* or C:\dir\dir\*\dir\*\dir\* How can I resolve this problem? Thanks for your hints, Thomas. -- http://mail.python.org/mailman/listinfo/python-list

Re: determine directories with wildcard

2005-03-08 Thread Thomas Rademacher
Thanks. It works fine! Thomas "Vincent Wehren" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Thomas Rademacher wrote: > > Hello, > > > > I want to collect with the wildcard '*' all existing directories. > > For examp

Re: Accessing files installed with distutils

2005-03-08 Thread Thomas Heller
kages >> but on Windows, it's in >> {sys.prefix}/Lib/site-packages. >> Do I need to use sys.platform (along with sys.version) to check what >> type of machine I'm on, or is there some better method to get the >> location of site-packages? >> > This is

Running doctests with unittest

2005-03-08 Thread Thomas Heller
ys seem to succeed - I have no idea why. Any ideas? Thomas ---snip--- """ >>> print "Hi" >>> print 1213 """ def func(): """ >>> print "spam" >>> print blah """ impo

Re: firefox python plugin

2005-03-09 Thread Thomas Ganss
for most use cases creating the processed file on the server and offering a link to download would be a better solution... HTH thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: running a C program with python script

2005-03-09 Thread Thomas Ganss
you can inline the code. google for scipy, weave, inline and python HTH thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.4, distutils, and pure python packages

2005-03-10 Thread Thomas Heller
exception: if the install-script prints something the output will be lost instead of displayed on the last screen. At least that's better than crashing the process. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: modifiable config files in compiled code?

2005-03-11 Thread Thomas Heller
Stephen Thorne <[EMAIL PROTECTED]> writes: > On 10 Mar 2005 06:02:22 -0800, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote: >> Hi All, >> >> I've been trying to come up with an elegant solution to this problem, >> but can't seem to think of anything better than my solution below. >> >> I have a P

Re: Python 2.4, distutils, and pure python packages

2005-03-11 Thread Thomas Heller
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: > Thomas Heller wrote: >>>This means that if you build a windows installer using >>>distutils - it *requires* msvcr7.dll in order to run. This is true even >>>if your package is a pure python package.

[Ann] ctypes 0.9.5 released

2005-03-12 Thread Thomas Heller
the Python version you are using. Homepage <http://starship.python.net/crew/theller/ctypes/> Enjoy, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Generating data types automatically

2005-03-14 Thread Thomas Heller
_type_triplett(ViUInt32, c_ulong) > > > However, this doesn't work, probably because the defined type exist > only locally within the function. Others have answered your question already, but I would like to note one thing: The POINTER() function caches its results, so you

Re: Getting the process list on win98

2005-03-14 Thread Thomas Heller
147221014, 'Moniker cannot open file', None, None) > > The program is in python v2.3 and packaged using pyexe, and inno setup. It seems WMI is not installed per default in Win 95/98 and NT: http://msdn.microsoft.com/library/en-us/wmisdk/wmi/system_requirements.asp If pywin32 also d

Re: How do I pass structures using a C extension?

2005-03-14 Thread Thomas Heller
pass into that. > > I haven't looked at the ctypes module yet, but it looks like it not one > of the modules Python comes with, so I'm a little reluctant to use it. ctypes does only support shared libraries, not static libraries. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Downloading all files older than 3 hours from a ftp-server.

2005-03-15 Thread Thomas W
I need to download all files older than 3 hours from a ftp-server. What's the easiest way to this? I've looked into the standard ftplib, but it seems like the only way to go is to parse the ftp.retrlines('LIST') command and that seems to be very easy to mess up. any hints?

Re: pre-PEP: Print Without Intervening Space

2005-03-15 Thread Thomas Bellman
parrot() with a one-element tuple either. However, 'parrot(1)' and 'parrot(1,)' means exactly the same thing, while 'print 1' and 'print 1,' does not. -- Thomas Bellman, Lysator Computer Club, Linköping University, Sweden "Adde parvum parvo magnus

Re: Python becoming less Lisp-like

2005-03-15 Thread Thomas Bellman
r using the package. If some authors write bad books, do you blame the English language for allowing them to write such books, or do you blame the writers for using English in a bad way? -- Thomas Bellman, Lysator Computer Club, Linköping University, Sweden "We don't understand

Re: Simple XML-to-Python conversion

2005-03-17 Thread Thomas Guettler
ry start-tag and for every end-tag. The class which handles the events can build the structure if your XML file. The online version of the python cookbook has some python and SAX examples, Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python becoming less Lisp-like

2005-03-17 Thread Thomas Bellman
t it's not really fair to say "ignore it > and it won't affect you" -- there's still a cost associated with such > features that can't be ignored away. There is a "local" cost with it, for learning Python, but I'm not sure there really is

Re: Splitting with Regular Expressions

2005-03-17 Thread Thomas Guettler
'] > considering "a.string" as a word. Hi, try this: re.findall(r'[\w\.]+', s) ['This', 'that', 'a.string'] If you use r'...' you don't need to use \\ if you mean \ \w matches a-zA-Z0-9_ \W matches all except \w Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory mapped File (Python win32 extensions)

2005-03-17 Thread Thomas Heller
ot really obvious from the mmap description, but calling shmem = mmap.mmap(0, 32000, "spam") creates (or opens, if it already exists) a shared memory block, not based an any existing file. In other words, the fileno (first parameters) must be 0, and the last one specifies the sys

Re: Import mechanism to support multiple Python versions

2005-03-18 Thread Thomas Heller
used. You may manipulate the package path in the __init__.py file. pkgutil may also be useful. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows question from Mac guy

2005-03-18 Thread Thomas Heller
/freeze def get_main_dir(): if main_is_frozen(): return os.path.dirname(sys.executable) return os.path.dirname(sys.argv[0]) Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Class methods in Python/C?

2004-11-30 Thread Thomas Heller
ied free functions, but class methods > > participate usefully in inheritence hierarchies - why would anyone > > want the former? Same for me. To answer the original question: To create class methods in C code, you use the METH_CLASS flag in the PyMethodDef structure. Supported in Python 2.3 and above, in 2.2 it is more complicated. If needed, I can post a snippet for 2.2 as well. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Win32 Silent Install

2004-12-01 Thread Thomas Heller
; Maybe there is a better way to do an unattended install of the Win32 > extensions (that is, perhaps without using the binary)? I should be quite easy to write a Python script that opens the binary as a zipfile, and then does what the gui does without showing a gui. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2)

2004-12-02 Thread Thomas Heller
Gerrit <[EMAIL PROTECTED]> writes: > Cameron Laird wrote: >> Subject: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2) > > What is the frequency of the weekly Python-URL? (-; According to the name, about 1.6 µHz. Thomas -- http://mail.python.org/mailman/listinfo/python-list

python-mode question

2004-12-03 Thread Thomas Heller
tters. Thanks, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: How did you learn Python?

2004-12-03 Thread Thomas Guettler
ned a lot by reading the python cookbook. Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ -- http://mail.python.org/mailman/listinfo/python-list

Re: python-mode question

2004-12-06 Thread Thomas Heller
Skip Montanaro <[EMAIL PROTECTED]> writes: > Thomas> When I edit a Python script with XEmacs, then hit C-c C-c, the > Thomas> script is executed, the output is shown in a *Python Output* > Thomas> buffer, and the cursor is moved into this buffer. > >

Re: Loading a file only once into an object and being able to access it from other modules

2004-12-07 Thread Thomas Guettler
the class __init__. Hi, You have this module (mymod.py) print "First import" xmlfile= If you import mymod the second time, you won't see "First import" again. The code without indentation gets executed only once. You can access your file with mymod.xmlfile. HTH,

Re: error on crude test of embedding python in c++ HELP PLEASE

2004-12-07 Thread Thomas Heller
"Donnie Leen" <[EMAIL PROTECTED]> writes: > I wrote a program to test calling c function from python code embedding in c > as following, it cause error after running a while(about 398 circle). I > test it in msvc6, python2.3, windows 2k, could anyone tell me why this > happened since i just work

Re: writing to mailboxes

2004-12-08 Thread Thomas Guettler
re is a script called "getmail". It is a fetchmail replacement written in python. It can write to maildir mailboxes. HTH, Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Parse XML using Python

2004-12-09 Thread Thomas Guettler
Am Wed, 08 Dec 2004 23:25:49 -0800 schrieb anilby: > Hi, > > I wanted to write a script that will read the below file: Hi, Here is an example how to use sax: http://pyxml.sourceforge.net/topics/howto/node12.html Thomas -- Thomas Güttler, http://www.thomas-guettler.de/

Re: Building Windows debug distribution

2004-12-10 Thread Thomas Heller
ing msi.py shouldn't be hard (replace xyz.pyd by xyz_d.pyd, basically) Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: need some help quickly

2004-12-13 Thread Thomas Guettler
screen which alter image when a key is > pressed. What operating system do you use? Please choose a better subject next time. "need some help quickly": I don't think the application you are looking for is done quickly. Thomas -- Thomas Güttler, http://www.thomas-guettle

<    11   12   13   14   15   16   17   18   19   20   >