Unicode problem with exec

2006-06-23 Thread Thomas Heller
return codecs.charmap_encode(input,errors,encoding_map) UnicodeEncodeError: 'charmap' codec can't encode character u'\x84' in position 0: character maps to >>> ^Z Why does the exec call fail, and is there a workaround? Thanks, Thomas -- http://mail.python.org/mailman/listinfo/python-list

how can I avoid abusing lists?

2006-07-07 Thread Thomas Nelson
I have this code: type1 = [0] type2 = [0] type3 = [0] map = {0:type1, 1:type1, 2:type3, 3:type1, 4:type2} # the real map is longer than this def increment(value): map[value][0] += 1 increment(1) increment(1) increment(0) increment(4) #increment will actually be called many times through

Re: how can I avoid abusing lists?

2006-07-07 Thread Thomas Nelson
Thanks to everyone who posted. First, I don't think my question was clear enough: Rob Cowie, Ant, Simon Forman, [EMAIL PROTECTED], and Jon Ribbens offered solutions that don't quite work as-is, because I need multiple values to map to a single type. Tim Chase and Bruno Destuilliers both offer ver

Re: Py_NewInterpreter(), is this a bug in the python core?

2006-07-10 Thread Thomas Heller
if (check && check != new) > Py_FatalError("Invalid thread state for this thread"); > } > #endif > > The variable 'check' looks as if it is the 'previous' thread state, as > if changing the thread state > is not

Re: Best command for running shell command

2006-07-11 Thread Thomas Nelson
Yes, I highly recommend the subprocess module. subprocess.call() can do almost anything you want to do, and the options are all pretty intuitive Whenever I need to write quick scripts for myself, it's what I use. THN Roy Smith wrote: > In article <[EMAIL PROTECTED]>, > Donald Duck <[EMAIL PRO

Re: Segmentation Fault

2006-08-28 Thread thomas . samson
dependant... So, at least on unix-like platform, you can use the signal module to detect segfault: import signal def handler(signum, frame): print 'Segfault detected' # you may use the stack frame here to help debugging signal.signal(signal.SIGSEGV, handler) -- Thomas SAMSO

Re: genetic algorithms package for python ?

2006-08-31 Thread Thomas Samson
in genetic algorithms, but here are some links : http://pygp.sourceforge.net/ http://packages.qa.debian.org/g/genetic.html and of course, http://www.freenet.org.nz/python/pygene/ -- Thomas Samson BOFH Excuse #420: Feature was not beta tested -- http://mail.python.org/mailman/listinfo/python-list

Re: Threads and Progress Bar

2006-09-15 Thread Thomas Guettler
ake it thread > aware. You need some kind of lock. Look at the module threading. There is a class called "Lock". PS: If you use pygtk: I switched from using threads to idle_add and (*). This is much easier and you don't need any locking. # (*) while gtk.events_pending(): gt

Re: PIL 2.5 win32 binaries?

2006-09-18 Thread Thomas Heller
ilable? > > Best wishes, > > Harald > http://effbot.org/downloads/#PIL Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: new string method in 2.5 (partition)

2006-09-19 Thread Thomas Heller
ator returned as > well. Well, x.split(":", 1) returns a list of one or two elements, depending on x, while x.partition(":") always returns a three-tuple. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Using py2exe to wrap a service?

2006-09-20 Thread Thomas Heller
r, but worth a try. Maybe another possibility is that py2exe fails to include makepy generated modules. Could that lead to this error? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: what is the best practice to separate Pygtk and long running thread code

2006-09-22 Thread Thomas Guettler
called if there are no actions in the event-loop. HTH, Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about the article "py2exe compiler" in Python Cookbook by Alexander Semenov

2006-09-22 Thread Thomas Heller
In newer py2exe-versions, you have to use 'console=[name]' in the above script. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe compression not working with Python 2.5

2006-09-22 Thread Thomas Heller
"C:\Python25\lib\site-packages\py2exe\build_exe.py", line 591, > in create_ > binaries > bytes = zlib_file.read() > AttributeError: 'NoneType' object has no attribute 'read' > > This is a standard Python 2.5 installation. Doing the same thing with > 2.4 works like a charm. > > Did I miss anything? > Patches for this have been posted to the py2exe-users list. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: what is the best practice to separate Pygtk and long running thread code

2006-09-25 Thread Thomas Guettler
seb wrote: > The best thing would be to have a queue feature that would be be shared > between processes but as far as I know It does not exists in python. There is a queue class to share data between threads: http://docs.python.org/lib/module-Queue.html -- Thomas Güttler, http://www.

Re: Python CTypes translation of (pv != NULL)

2006-09-26 Thread Thomas Heller
have a False boolean value, so 'if pv: ' should work. Except for c_void_p, c_char_p and c_wchar_p instances. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Survival of the fittest

2006-09-26 Thread Thomas Bartkus
your stated "policy" leave you still wasting 20-30% of your programming efforts on other languages? We would be curious to know about those things you can do in C++ but can't do in Python. (Doubting) Thomas Bartkus -- http://mail.python.org/mailman/listinfo/python-list

Re: Python CTypes translation of (pv != NULL)

2006-09-27 Thread Thomas Heller
False in a boolean >> expression (and you could assume that non-NULL pointers are True, as >> any other object in general), > > I see this now that you show the clueless newbie me, yes thank you. > Except now by showing me here we have provoked the authority Thomas > Hell

Re: ctypes.c_void_p(-1) might not be C return (void *) -1

2006-09-28 Thread Thomas Heller
alue, but it is -1 not 0x. Worse, on 64-bit systems c_void_p(-1).value is 184467440737009661615, which is the same as 0x. So, to be portable, INVALID_HANDLE_VALUE should be defined like this: INVALID_HANDLE_VALUE = c_void_p(-1).value and your test would become (ctypes.cast(pv, ctype

Re: ctypes.c_void_p(-1) might not be C return (void *) -1

2006-09-29 Thread Thomas Heller
the .value of a c_void_p instance is signed on >> 32-bit systems, and unsigned on 64-bit systems, but it seems we have to live >> with that. Obviously, as you discovered, and I confirmed, this is no longer true. In the Python2.5 ctypes, the value of c_void_p is always unsigned. I just meant that we have to live for quite some time with the behaviour of ctypes as implemented, because only bug fixes can be made to Python 2.5. Thomas (I'll probably leave for a few days now) -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter to mpeg

2006-10-02 Thread Thomas Jollans
rograms designed for the job, such as vnc2swf (which produces macromedia flash), vncrec (which produces a special format readable by transcode) or istanbul (which produces ogg/theora). I doubt Tk would have a special mechanism to do this. -- Thomas Jollans alias free-zombie -- http://mail.python.org/mailman/listinfo/python-list

Re: moving limewire music to my itunes library

2006-10-02 Thread Thomas Jollans
> player, how do i also get that music into my itunes library > ta all > jen What does this have to do with python ? -- Thomas Jollans alias free-zombie -- http://mail.python.org/mailman/listinfo/python-list

Re: php and python: how to unpickle using PHP?

2006-10-02 Thread Thomas Jollans
e as serialization format, akin to pickle. -- Thomas Jollans alias free-zombie -- http://mail.python.org/mailman/listinfo/python-list

Re: CGI -> mod_python

2006-10-02 Thread Thomas Jollans
(specified in PEP 333: http://www.python.org/dev/peps/pep-0333/) you should be able to convert your app to WSGI, which will run on mod_python, relatively easily (depending on your code; 'print' won't work anymore) -- Thomas Jollans alias free-zombie -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help with an array problem.

2006-10-03 Thread Thomas Bellman
printf("Pointer cast: %d %10.6f\n", *(int*)&f, *(float*)&i); to the program. It should output the same numbers as the "Bitcopy" printf(). But what is cast here is the *address* of the variables, not the actual contents of them. It is the *dereferencing* of thos

Re: array tofile fromfile tosocket? fromsocket?

2006-10-03 Thread Thomas Jollans
e you looking for sockets' makefile method ? -- Thomas Jollans alias free-zombie -- http://mail.python.org/mailman/listinfo/python-list

Re: What value should be passed to make a function use the default argument value?

2006-10-03 Thread Thomas Jollans
but what if I absolutely want to pass a > value to f()? "None" doesn't seem to work.. > > Thanks in advance. a) if you feel that your program needs to pass a value, fix the program. b) >>> def f(v=1): ... return v*2 ... >>> f() 2 >>> f(1) 2 >

Re: dictionary of list from a file

2006-10-04 Thread Thomas Jollans
x27;ll want to convert the data when reading using int() and long(). > i get > 2 None > 7 None > > data file is: > 2 1 > 2 2 > 2 3 > 2 4 > 7 7 > 7 8 > 7 9 > 7 10 -- Thomas Jollans alias free-zombie -- http://mail.python.org/mailman/listinfo/python-list

Re: Where to I find files: gtk.py _gtk.py and GDK.py

2006-10-04 Thread Thomas Jollans
t /usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.pyc . On your system, __import__('gtk').__file__ knows more than you. -- Thomas Jollans alias free-zombie -- http://mail.python.org/mailman/listinfo/python-list

Understanding Python Source Code - where to start?

2006-11-17 Thread Thomas Ploch
Hello folks, I am thinking about reading and understanding the Source Code of Python, but where would it be best to start? Possibly someone can give me a little hint. I am getting into socketmodule.c a little bit at the moment, but thats not what I want. Greetz, Thomas -- Der GMX

failure building python 2.5 on mac os x 10.3.9

2006-11-19 Thread Thomas Ploch
in a library) make: *** [Python.framework/Versions/2.5/Python] Error 1 What does that mean? Thanks, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: how to print pdf with python on a inkjet printer.

2006-11-19 Thread Thomas Heller
ests printing. > > Or just let Windows do the dirty work of locating Adobe Reader, > figuring out the parameters and such: > > import win32api > win32api.ShellExecute(0, "print", path/to/document.pdf, None, None, 0) > Note that in Pyhton2.5, os.startfile was

Re: select() on WinXP

2006-11-23 Thread Thomas Heller
docs for select.select say: Empty sequences are allowed, but acceptance of three empty sequences is platform-dependent. (It is known to work on Unix but not on Windows.) Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Pimping the 'cgi' module

2006-11-24 Thread Thomas Guettler
one else who can do this) will decide to choose one soon. Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: synching with os.walk()

2006-11-24 Thread Thomas Ploch
g into a class, then you can traverse two directory trees at once and can do funny things with it? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: working with files and directories

2006-11-27 Thread Thomas Ploch
; > Have you actually even tried to find some "documentation"? Have you placed a google search "python directories rename files"? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Dynamic/runtime code introspection/compilation

2006-11-28 Thread Thomas W
Maybe a stupid subject, but this is what I want to do : I got some python code stored in a string: somecode = """ from somemodule import ISomeInterface class Foo(ISomeInterface): param1 = ... param2 = """ and I want to compile that code so that I can use the Foo-class and check w

Re: Dynamic/runtime code introspection/compilation

2006-11-28 Thread Thomas W
Great !!! That works like charm. Thanks alot. Thomas Leo Kislov wrote: > Thomas W wrote: > > Maybe a stupid subject, but this is what I want to do : > > > > I got some python code stored in a string: > > > > somecode = """ > > >

Re: HTML Table-of-Content Extraction Script

2006-11-28 Thread Thomas Guettler
robert wrote: > I'm looking for a function which extracts a table of contents of HTML file(s) > from ... and possibly auto-creates the ancors. > Maybe something already exists? You can try mine: http://www.thomas-guettler.de/scripts/number-html-headings.py.txt -- Thomas

Re: Reading text labels from a Win32 window

2006-11-29 Thread Thomas Heller
straight-forward conversion of the code in the above article to Python. Needs ctypes and comtypes. Python 2.5 already includes ctypes; comtypes can be installed with 'easy_install comtypes'. Thomas import sys, time from ctypes import windll, oledll, WinError, byref, POINTER from ctypes.wint

Re: SPE refuses.

2006-11-30 Thread Thomas Ploch
__init__ GIFAnimationCtrl.__init__(self,statusBar,-1,info.imageFile(fileName)) File "//Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/wx-2.7.1-mac-unicode/wx/animate.py", line 242, in __init__ self.LoadFile(filename) File "/Library/Frameworks/Python.fra

Re: Python Worship

2006-11-30 Thread Thomas Ploch
rships python. That just tells me Python is right. Whatever angle you look at it. :-D Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: failure building python 2.5 on mac os x 10.3.9

2006-11-30 Thread Thomas Ploch
Markus Rosenstihl schrieb: > On 2006-11-19 15:50:14 +0100, Thomas Ploch <[EMAIL PROTECTED]> said: > >> Hello, >> >> I followed the instructions in the Mac/README file. >> >> I ran ./configure --enable-framework >> >> But when I try

Re: Automatic increment

2006-11-30 Thread Thomas Ploch
re a way to get rid of the manual incrementation of the 2 counters? > > Thanks, for counter in xrange(len(lineList)): for itemCounter in xrange(len(lineList[counter].split())) myArray[counter, itemCounter] Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there an easier way to express this list slicing?

2006-11-30 Thread Thomas Ploch
contains *lots* > of things like this. It makes the code very unreadable. > > Thanks, > Nothing in your code actually __is__ a list. they are all tuples... A list is: aList = [a,b,c1,c2,c3,d1,d2,d3,d4,d5] Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: DDE (eSignal)

2006-11-30 Thread Thomas Heller
ed. > > '1402.6700\x00\x12\x00*\x00\x00\x004\xfb\x12\x00\xfd\x1a\xd9w4\xc1\x00' > > Any thoughts on this? > > TIA, > > jab > Looks like a bug, either in the dde module or the dde server. But it's easy to find a workaround: >>>

Re: Python spam?

2006-11-30 Thread Thomas Heller
f ;-) with forged headers. But I'm not sure what you mean with Python-related... Not the contents, IIRC. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there an easier way to express this list slicing?

2006-11-30 Thread Thomas Ploch
,5,itemList) >>>print a,b,c,d ['a'] ['b'] ['c1', 'c2', 'c3'] ['d1', 'd2', 'd3', 'd4', 'd5'] >>>a,b,c,d = getSlices(3,1,1,0,itemList2) >>>print a,b,c,d ['a1', 'a2', 'a3'] ['b'] ['c'] [] %-) Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there an easier way to express this list slicing?

2006-11-30 Thread Thomas Ploch
John Henry schrieb: > Thomas Ploch wrote: > >> I had a little bit of fun while writing this: >> >> itemList = (a,b,c1,c2,c3,d1,d2,d3,d4,d5) and >> itemList2 = (a1,a2,a3,b,c,d1,d2,d3,d4,d5) the next time. >> > > Huh? What's a,b,d5? > John H

Re: PythonTidy

2006-11-30 Thread Thomas Heller
stead of working as a filter only. Thanks, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to align words?

2006-11-30 Thread Thomas Ploch
Robert R. schrieb: > Hello, > > i would like to write a piece of code to help me to align some sequence > of words and suggest me the ordered common subwords of them > > s0 = "this is an example of a thing i would like to have".split() > s1 = "another example of something else i would like to hav

Open and closing files

2006-11-30 Thread Thomas Ploch
bj.write(process(foo)) fileobj.close() Which one is the 'official' recommended way? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: python vs java & eclipse

2006-12-01 Thread Thomas Ploch
Thomas Ploch schrieb: > Amir Michail schrieb: >> Hi, >> >> It seems to me that measuring productivity in a programming language >> must take into account available tools and libraries. >> >> Eclipse for example provides such an amazing IDE for java that it

[no subject]

2006-12-01 Thread Thomas Ploch
orts PyLint and PyChecker, manages the python path when new modules are added, but can be improved (as can everything :-) )). But as I said, often my system hangs when having quite a few files opened, so that brought me off using it too often. Thomas -- "Ein Herz für Kinder" - Ihr

Re: good documentation about win32api ??

2006-12-01 Thread Thomas Heller
s. > I am pritty well to do with windows API, I am an a good python > programmer, but I can't find the link between the two. > there are modules but no good documentation. > krishnakant. Maybe then ctypes is the right thing for you? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: PythonTidy

2006-12-01 Thread Thomas Heller
Chuck Rhode schrieb: > Thomas Heller wrote this on Thu, Nov 30, 2006 at 09:50:25PM +0100. My > reply is below. > >> The two things that bother me at the moment are how the comments are >> formatted (dunno if that can be customized or changed easily), and >> it would

Re: Python, PostgreSQL, What next?

2006-12-02 Thread Thomas Bartkus
hing licked. Get SQL in your head and all you will need would be the db-api interface with Postgres that Frederick Lundh pointed you to. All you want to do is throw SQL commands at Postgres and recover result sets into Python. It's a cinch. Thomas Bartkus -- http://mail.python.org/mailman/listinfo/python-list

Re: Why not just show the out-of-range index?

2006-12-05 Thread Thomas Ploch
er than a feature > in the interpreter itself. > I read the whole thread and this is more or less the first post which actually has a good thing to say without saying any bad thing about anyone. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: PythonTidy

2006-12-05 Thread Thomas Heller
up, regularizes, and reformats the text of > Python scripts: > > http://www.LacusVeris.com/PythonTidy/PythonTidy.python > > What next? Is it appropriately submitted to the Cheese Shop? > Of course. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: About the 79 character line recommendation

2006-12-06 Thread Thomas Ploch
please, stay true to that. And don't forget those, who actually view source code in a terminal. :-) Thomas -- http://mail.python.org/mailman/listinfo/python-list

len() and PEP 3000

2006-12-06 Thread Thomas Guettler
call .__len__() but that is ugly. I have read the FAQ to the len function: http://www.python.org/doc/faq/general/#why-does-python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list -- Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/ E

Re: PythonTidy

2006-12-07 Thread Thomas Heller
Chuck Rhode schrieb: > Thomas Heller wrote this on Tue, Dec 05, 2006 at 07:06:30PM +0100. My > reply is below. > >> There is still one major issue. pythonTidy uses open(input-file, >> "rb") to open the Python module to tidy up. That does not work on >> Win

comtypes

2006-12-07 Thread Thomas Heller
... - the python-win32 mailing list - the ctypes-users mailing list - or should I create a new comtypes-users mailing list, mirrored on gmane, of course? Thanks for any opinions, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: A Call to Arms for Python Advocacy

2006-12-07 Thread Thomas Ploch
Some of the >> material exists scattered about and just needs locating and organizing. >> >>http://wiki.python.org/moin/Advocacy > > > I think it also appears to need faster hardware. It's running glacially > slow. I hope you are _not_ using IE... (So

Re: A Call to Arms for Python Advocacy

2006-12-07 Thread Thomas Ploch
Thomas Ploch schrieb: > Roy Smith schrieb: >> In article <[EMAIL PROTECTED]>, >> Jeff Rush <[EMAIL PROTECTED]> wrote: >> >>> As the Python Advocacy Coordinator, I've put up some wiki pages on the >>> Python >>> website f

Re: os.popen3 hangs in Windows XP SP1, SP2. Python 2.5 & 2.4. Consistent test case.

2006-12-12 Thread Thomas Guettler
fer of stderr will get full. The child will block. The parent will wait for ever. See http://docs.python.org/lib/popen2-flow-control.html My hint: Always use popen4 You can get dead locks with popen4, too. But only if you write to pipe.tochild. Thomas -- Thomas Güttler, http://www.thomas

Re: Non greedy regex

2006-12-14 Thread Thomas Nelson
There's an optional count argument that will give what you want. Try re.sub('a.*b','','ababc',count=1) Carsten Haese wrote: > On Thu, 2006-12-14 at 06:45 -0800, [EMAIL PROTECTED] wrote: > > Can someone please explain why these expressions both produce the same > > result? Surely this means that

Re: Has comparison of instancemethods changed between python 2.5 and 2.4?

2006-12-15 Thread Thomas Heller
; It seems so: python -c "o = object(); print o.__str__ == o.__str__" prints True with Python 2.5, and False with Python 2.4. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: regular expression

2006-12-19 Thread Thomas Ploch
Asper Faner schrieb: > I seem to always have hard time understaing how this regular expression > works, especially how on earth do people bring it up as part of > computer programming language. Natural language processing seems not > enough to explain by the way. Why no eliminate it ? > Erm, I am

Re: Fall of Roman Empire

2006-12-20 Thread Thomas Ploch
Ben Finney schrieb: > "John Machin" <[EMAIL PROTECTED]> writes: > >> Ben Finney wrote: >> >>> \ "...one of the main causes of the fall of the Roman Empire was | >>> `\that, lacking zero, they had no way to indicate successful | >>> _o__) termination of their C program

Re: regexp

2006-12-20 Thread Thomas Ploch
aving VI key commands Back into "Learning Python", and DIP... Yes, I love that, too. The Komodo Rx Toolkit is really good for people who are new to regular expressions just to try them out, to get to know grouping, to see how MULTILINE and other flags work. I can recommend this to anyone

Re: Fall of Roman Empire

2006-12-20 Thread Thomas Ploch
> Ben Finney schrieb: >> "John Machin" <[EMAIL PROTECTED]> writes: >> >>> Ben Finney wrote: >>> \ "...one of the main causes of the fall of the Roman Empire was | `\that, lacking zero, they had no way to indicate successful | _o__) termination of their C

Re: Fall of Roman Empire

2006-12-20 Thread Thomas Ploch
Felix Benner schrieb: > Thomas Ploch schrieb: >>> Ben Finney schrieb: >>>> "John Machin" <[EMAIL PROTECTED]> writes: >>>> >>>>> Ben Finney wrote: >>>>> >>>>>> \ "...one of the main causes

Re: perl better than python for users with disabilities?

2006-12-20 Thread Thomas Ploch
;m not supposed to be funny. Argh, I am writing to President Horst Köhler to take away your German citizenship. You _need_ to stay true to German attributes (like not being funny, what you have been...)! This is the last warning! :-D Regarding the topic: I can't see where Perl should be more

Re: Does any one know of any good folder/directory modules

2006-12-20 Thread Thomas Ploch
have a look here: http://docs.python.org/lib/os-file-dir.html#os-file-dir Thomas (This could have been done by yourself, but I am in a christmasly mood) -- http://mail.python.org/mailman/listinfo/python-list

Re: How a script can know if it has been called with the -i command line option?

2006-12-21 Thread Thomas Heller
ould > I look? > TIA, > > Michele Simionato > I don't know how to get the command line flags, but the variable you are interested in is this one: from ctypes import * print c_int.in_dll(pythonapi, "Py_InteractiveFlag") ;-) Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Generating all permutations from a regexp

2006-12-23 Thread Thomas Ploch
the matching engine implemented then? I thought regular languages can be described by deterministic / non-deterministic finite state machines. I am just curious ... Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Fall of Roman Empire

2006-12-23 Thread Thomas Ploch
orking hard on reverse-engineering it though. I hope no one > slaps them with a DMCA-style lawsuit ... > > Tim Delaney I heard Steve Ballmer recently made an offer to the pope for purchasing the license for an apple and an egg (Apfel und Ei). Thomas -- http://mail.python.org/mailman/listinfo/python-list

Merry Christmas and a happy new year!

2006-12-24 Thread Thomas Ploch
I wish everybody a merry Christmas and a happy new year. Have a good and beautiful new year. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Question concerning this list

2006-12-30 Thread Thomas Ploch
.? Or is this a blatantly idiotic idea? I hope I am not the idiot of the month right now... Thanks in advance, Thomas P.S.: I might give some of my Christmas chocolate away as a donation to this list... :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Question concerning this list

2006-12-30 Thread Thomas Ploch
Steven D'Aprano wrote: > On Sun, 31 Dec 2006 02:03:34 +0100, Thomas Ploch wrote: > >> Hello fellow pythonists, >> >> I have a question concerning posting code on this list. >> >> I want to post source code of a module, which is a homework for >&

Re: Question concerning this list [WebCrawler]

2006-12-31 Thread Thomas Ploch
Marc 'BlackJack' Rintsch schrieb: > In <[EMAIL PROTECTED]>, Thomas Ploch > wrote: > >> Alright, my prof said '... to process documents written in structural >> markup languages using regular expressions is a no-no.' (Because of >> nested El

Re: WebCrawler (was: 'Question concerning this list')

2006-12-31 Thread Thomas Ploch
Marc 'BlackJack' Rintsch schrieb: > In <[EMAIL PROTECTED]>, Thomas Ploch > wrote: > >> This is how my regexes look like: >> >> import re >> >> class Tags: >> def __init__(self, sourceText): >> self.source = sourceText

Re: Question concerning this list [WebCrawler]

2006-12-31 Thread Thomas Ploch
uot; is unreasonably expensive. In Python, at least > you can index through a string. > > John Nagle I take it with LALR(0) you mean that HTML is a language created by a Chomsky-0 (regular language) Grammar? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Wrapper for C# Com Object

2007-01-02 Thread Thomas Heller
can use the CoClass from the typelibrary, look into the generated module in the comtypes\gen directory for a class derived from comtypes.CoClass. InternetExplorer, for example, can be started in these ways: # using the progid: ie = CreateObject("InternetExplorer.Application") # using the clsid: ie = CreateObject("{0002DF01---C000-0046}") # using the coclass from the generated module: mod = GetModule("shdocvw.dll") ie = CreateObject(mod.InternetExplorer) Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does Python never add itself to the Windows path?

2007-01-02 Thread Thomas Heller
o, it > will work if you type "setup.py install" but not if you type "python > setup.py install". For instance, I have an entry for Firefox in that > part of the registry, but if you try executing "firefox" at the command > line, it fails. Not really. It

Re: C/C++, Perl, etc. to Python converter

2007-01-03 Thread Thomas Ploch
definitely *is* possible. Something like this doesn't exist yet, but people (especially Computational Linguists) are working on this. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: M. Hammonds python panel

2007-01-03 Thread Thomas Heller
t; > Maybe Mark is around here somewhere... It may be better to mail him directly. You should be able to find his email address. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: static object

2007-01-03 Thread Thomas Ploch
self.data = data dataVault = DataStorage(data) dataVault1 = dataVault dataVault2 = dataVault ... but why not use a static_data.py (put your data in there) file and do: >>> from static_data.py import DATA This way you only load it once and it will be accessible throughout your program. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: question on creating class

2007-01-04 Thread Thomas Heller
ry for instance variables (if defined) | | __weakref__ = | list of weak references to the object (if defined) >>> TestClass() Creating object of TestClass... <__main__.TestClass object at 0x00AED0B0> >>> TestClass().method1() Creating object of TestClass... This is a method >>> Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: where to ask questions related to comtypes?

2007-01-04 Thread Thomas Heller
wcc schrieb: > Hello group, > > Is there a separate mailing list for comtypes? Or this is the > appropriate place to post questions related to this package(from Thomas > Heller)? It seems the python-win32 mailing list is the place where the most COM knowledge is, so tha

Best way to implement a timed queue?

2007-01-04 Thread Thomas Ploch
es, how is the best way to implement it? Thanks, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is proper way to require a method to be overridden?

2007-01-04 Thread Thomas Ploch
it__(self) # Has to be defined to override the base class's method # when inheriting from class Foo. Otherwise: SPAM def foo(self): print 'foo' I don't know any other way. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is proper way to require a method to be overridden?

2007-01-04 Thread Thomas Ploch
mplementedError in > the base class (apart from documenting how your class is supposed to be > used). > > I learn so much from this list. I didn't even know this error existed. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is proper way to require a method to be overridden?

2007-01-04 Thread Thomas Ploch
Grant Edwards schrieb: > On 2007-01-05, Thomas Ploch <[EMAIL PROTECTED]> wrote: > >>>> I am writing a class that is intended to be subclassed. What >>>> is the proper way to indicate that a sub class must override a >>>> method? >

Re: program deployment

2007-01-05 Thread Thomas Ploch
at might get others that rely on that (commercial) to use python for more projects as it is done now. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Dividing integers...Convert to float first?

2007-01-05 Thread Thomas Ploch
[EMAIL PROTECTED] schrieb: > I'm still pretty new to Python. I'm writing a function that accepts > thre integers as arguments. I need to divide the first integer by te > second integer, and get a float as a result. I don't want the caller of > the function to have to pass floats instead of integers

Re: Dividing integers...Convert to float first?

2007-01-05 Thread Thomas Ploch
Jonathan Smith schrieb: > Thomas Ploch wrote: >> [EMAIL PROTECTED] schrieb: >>> I'm still pretty new to Python. I'm writing a function that accepts >>> thre integers as arguments. I need to divide the first integer by te >>> second integer, and get a

Re: Dividing integers...Convert to float first?

2007-01-05 Thread Thomas Ploch
4.6-r1, ssp-3.4.5-1.0, pie-8.7.9)] on linux2 >Type "help", "copyright", "credits" or "license" for more >information. >>>> from __future__ import LotteryNumbers > File "", line 1 >SyntaxError: future feature Lo

Re: PyGreSQL Install

2007-01-05 Thread Thomas Ploch
thon2.5 setup.py install Normally it gets installed into the directory of the python version you use when running setup.py. Is python 2.3 still the default on MAC OS X 10.4? I thought they switched to python 2.4. Thomas -- http://mail.python.org/mailman/listinfo/python-list

<    15   16   17   18   19   20   21   22   23   24   >