Re: IMAP SEARCH Error

2007-01-17 Thread Thomas Guettler
g with ethereal (wireshark) what other applications (KMail, getmail) do. getmail is like fetchmail, but written in Python. I found some hints by looking at its source. HTH, Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + d

Re: Newbie: Capture traceback message to string?

2007-01-17 Thread Thomas Guettler
port traceback import cStringIO (exc_type, exc_value, tb) = sys.exc_info() exc_file = cStringIO.StringIO() traceback.print_exception(exc_type, exc_value, tb, file=exc_file) exc_string=exc_file.getvalue() print exc_string Why don't you use cgitb? It is one reason

Re: One more regular expressions question

2007-01-18 Thread harvey . thomas
Victor Polukcht wrote: > My pattern now is: > > (?P[^(]+)(?P\d+)\)\s+(?P\d+) > > And i expect to get: > > var1 = "Unassigned Number " > var2 = "1" > var3 = "32" > > I'm sure my regexp is incorrect, but can't understand where exactly. > > Regex.debug shows that even the first block is incorrect. >

Re: Match 2 words in a line of file

2007-01-19 Thread harvey . thomas
Rickard Lindberg wrote: > I see two potential problems with the non regex solutions. > > 1) Consider a line: "foo (bar)". When you split it you will only get > two strings, as split by default only splits the string on white space > characters. Thus "'bar' in words" will return false, even though

Re: Match 2 words in a line of file

2007-01-19 Thread harvey . thomas
Rickard Lindberg wrote: > I see two potential problems with the non regex solutions. > > 1) Consider a line: "foo (bar)". When you split it you will only get > two strings, as split by default only splits the string on white space > characters. Thus "'bar' in words" will return false, even though

Re: OpenOffice 2.0 UNO update Links; need help

2007-01-22 Thread Thomas Guettler
an image format, please use PNG. Jpeg is for images from a digital camera. 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: how to unistall a Python package?

2007-01-26 Thread Thomas Heller
seem > to be a reference to Removal in the distutils document. Packages that are create with distutils bdist_wininst command can be removed using the control panel->add/Software/ Add Remove programs. This calls RemoveXXX.exe (which is undocumented on purpose). Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: python+ncurses: I can't display accents

2007-01-26 Thread Thomas Dickey
x27;s the 8-bit flavor of ncurses, but the limitation is definitely in the python configuration. -- Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net -- http://mail.python.org/mailman/listinfo/python-list

Re: python+ncurses: I can't display accents

2007-01-27 Thread Thomas Dickey
ot;ncursesw" then python can use ncursesw without further change. There are a few patches to the configuration that I've seen mentioned in the bug reports to enable python to do this. Those are patches to python of course... (this was a topic of discussion on this newsgroup about a year

Trouble with max() and __cmp__()

2007-01-28 Thread Thomas Nelson
My code: class Policy(list): def __cmp__(self,other): return cmp(self.fitness,other.fitness) j = Policy() j.fitness = 3 k = Policy() k.fitness = 1 l = Policy() l.fitness = 5 print max([j,k,l]).fitness prints 3, when I was expecting it to print 5. What have I done wrong? Thanks for

Re: Trouble with max() and __cmp__()

2007-01-28 Thread Thomas Nelson
On Jan 28, 3:13 pm, Wojciech Muła <[EMAIL PROTECTED]> wrote: >Define method __gt__. This works, thanks. I was a little surprised though. is __cmp__ used by any builtin functions? Thanks, THN -- http://mail.python.org/mailman/listinfo/python-list

Re: thread and processes with python/GTK

2007-01-30 Thread Thomas Guettler
application. > Usually the behavior is not as expected and I cannot understand why. I > am wondering that it could be a constraint from the use of GTK > (mainloop() existence ???). > Is somebody aware about conflict between GTK use and unix mechanism. > > Thanks for you help -

Re: Sorting a List of Lists

2007-01-30 Thread Thomas Nelson
On Jan 30, 5:55 pm, [EMAIL PROTECTED] wrote: > I can't seem to get this nailed down and I thought I'd toss it out > there as, by gosh, its got to be something simple I'm missing. > > I have two different database tables of events that use different > schemas. I am using python to collate these reco

Re: How to suppress "DeprecationWarning: Old style callback, use cb_func(ok, store) instead"

2007-02-06 Thread Thomas Bellman
for the same #! line. I seem to remember having used some Unix flavor that allowed multiple words as arguments, and thus passed the four words "foo", "bar", "gazonk" and "del" as arguments for the above #! line, but I don't remember what Uni

Re: Running long script in the background

2007-02-06 Thread Thomas Guettler
) self.fd.flush() oldstdout = sys.stdout sys.stdout = FlushFile(sys.stdout) for i in range(5): print "Hello", time.sleep(0.5) print -- 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: Partial 1.0 - Partial classes for Python

2007-02-07 Thread Thomas Heller
in __new__ base.__dict__[k] = v TypeError: Error when calling the metaclass bases 'dictproxy' object does not support item assignment IIUC, wouldn't be 'partial.extend' or something like that be a better name for the base class? Thanks, Thomas -- http://mail.python.org/mailman/listinfo/python-list

python sub interpreter

2007-02-07 Thread Thomas Pollet
while str != 'exit': exec str print 'pydbg>>', str=sys.stdin.readline() etc. Somebody knows if something like this has been done before or an easy way to go about this? Regards, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Partial 1.0 - Partial classes for Python

2007-02-07 Thread Thomas Heller
Carl Banks schrieb: > On Feb 7, 10:17 am, "Carl Banks" <[EMAIL PROTECTED]> wrote: >> On Feb 7, 8:51 am, Thomas Heller <[EMAIL PROTECTED]> wrote: >> >> >> >> > Martin v. Löwis schrieb: >> >> > > I'm happy to an

Re: (n)curses or tcl/tk?

2007-02-07 Thread Thomas Pollet
Hi, you could try wxpython and the wxglade toolkit for building gui Regards, Thomas On 7 Feb 2007 08:35:41 -0800, magnate <[EMAIL PROTECTED]> wrote: Hi All, Just learning Python - my first new language for about 18 years (I'm not a programmer ...). I'm writing a small utili

Re: python linux distro

2007-02-08 Thread Thomas Guettler
. A task list all packages you need. You could make a task all-python-stuff. But I don't think many people will use it. I use Python daily, but at the moment I never use Zope, scipy or twisted. Ubuntu is a very python friendly environment. Thomas -- Thomas Güttler, http://www.thomas-guet

Re: Partial 1.0 - Partial classes for Python

2007-02-08 Thread Thomas Heller
Ziga Seilnacht schrieb: > Thomas Heller wrote: >> >> Do you have a pointer to that post? >> > > I think that he was refering to this post: > http://mail.python.org/pipermail/python-list/2006-December/416241.html > > If you are interested in various implem

Re: LoadLibrary(pythondll) failed

2007-02-10 Thread Thomas Heller
en py2exe'd application. You have to find out where it comes from (AFAIK even viruses or trojaners have been built with Python). Thomas -- http://mail.python.org/mailman/listinfo/python-list

c++ for python programmers

2007-02-12 Thread Thomas Nelson
I realize I'm approaching this backwards from the direction most people go, but does anyone know of a good c/c++ introduction for python programmers? Thanks, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: c++ for python programmers

2007-02-12 Thread Thomas Nelson
On Feb 12, 1:35 pm, andrew clarke <[EMAIL PROTECTED]> wrote: > Thomas, I sent you a message off-list but it bounced due to your mailbox > being full. > > Short answer: Subscribe to the c-prog@yahoogroups.com mailing list and > ask your C/C++ questions there. > > Regards

Which Object Database would you recommend for cross platform application?

2007-02-15 Thread Thomas Ploch
ommend one that (more or less) best fits the described conditions. Thanks in advance, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Replacement for GnomeDateEdit?

2007-02-21 Thread Thomas Bollmeier
st 1970. Since the date to be edited is a birth date this constraint is not acceptable for my application. Does anyone know whether there is another widget around with a pygtk-binding that I could use instead? Best regards, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: list/get methods/attributes of a class?

2007-02-22 Thread Thomas Nelson
Check out the dir() function. It does what you want, I think. Tom On Feb 22, 9:27 am, [EMAIL PROTECTED] wrote: > Hello, > Sorry guys for this newbie questions. But I wonder if there is a > standard or build-in method to know the methods of a class? > > I'm not originally a progrommer and I have

Re: pyinstaller fails to create exe-File

2007-02-23 Thread Thomas Heller
ild_executable > add_resource(unicode(exe_path), script_bytes, u"PYTHONSCRIPT", 1, > True) > RuntimeError: EndUpdateResource: Das System kann das angegebene Gerõt > oder die a > ngegebene Datei nicht ÷ffnen. (=System cannot find the specified > device or the file) That's a different problem; it has nothing to do with the email package. You should try to clean the dist and build directories that py2exe creates, sometimes this helps. If it still does not work, you should try to find out what the error means. Is the file readonly? locked because still in use? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Recreating a char array from a pointer

2007-02-24 Thread Thomas Heller
dule building > in windows? :/ You can use the ctypes package for this. It is in the standard library in Python 2.5, for older versions it is a separate download. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Help Required for Choosing Programming Language

2007-02-24 Thread Thomas Bartkus
is quite correct to ask for a system like VB6 that banishes the problem of user interface coding to the trivial role it deserves. Why should a programmer waste even so much as 10% of his effort to throw together a standard interface with ordinary textboxes, labels, and option buttons? Over and

Re: py2exe, library.zip and python.exe

2007-02-28 Thread Thomas Heller
ctory which can do this, I assume the python.exe will try to load that. There may be other possibilities as well. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Py2EXE problem

2007-02-28 Thread Thomas Heller
. One solution is to run 'setup.py py2exe -p email' Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Curses and resizing windows

2007-02-28 Thread Thomas Dickey
ef main(stdscr): > """just repeatedly redraw a long string to reveal the window > boundaries""" > while 1: > stdscr.insstr(0,0,"abcd"*40) > time.sleep(1) > if __name__=='__main__': > if len(sys.ar

email.get_filename() with newline

2007-11-09 Thread Thomas Guettler
nts how to parse this filename? Thomas -- http://mail.python.org/mailman/listinfo/python-list

PIL question

2007-11-16 Thread Thomas Heller
do I save the images in 4-bit/16-color format? Thanks, Thomas Here is the code; I'm using Python 2.4 and PIL 1.5: import Image img = Image.open("input.bmp") w, h = img.size print img.size, img.mode newimg = Image.new("P", (16*30, 15)) x = 0 i = 1 while x < w:

Re: PIL question

2007-11-16 Thread Thomas Heller
Thomas Heller schrieb: > I'm trying to read an image with PIL, crop several subimages out of it, > and try to combine the subimages again into a combined new one. This is > a test script, later I want to only several single images into a combined one. [...] > Here is the code;

Re: Python web frameworks

2007-11-20 Thread Thomas Wittek
Jeff: > I don't know much about the others. Turbo gears uses Mochikit, which > hasn't had a new stable release in some time. I prefer jQuery myself. You can use jQuery with TurboGears if you develop custom widgets (I do so). No problem here. -- Thomas Wittek Web: http://geda

Re: eof

2007-11-22 Thread Thomas Bellman
files, but on pipes, sockets or terminals, you would have major problems, since suddenly calling the eof() method would block the process. Probably not what you were expecting. -- Thomas Bellman, Lysator Computer Club, Linköping University, Sweden "Life IS pain, highness. Anyone who te

Different kinds of Import Errors

2007-11-27 Thread Thomas Guettler
If you look at this code, you see there are two kind of ImportErrors: 1. app_name has no attribute or file managment.py: That's OK. 2. managment.py exists, but raises an ImportError: That's not OK: reraise # Import the 'management' module within each installed app, to register # d

Re: spawning a process with subprocess

2007-11-27 Thread Thomas Bellman
of "cat" as a test program, I suppose that isn't a problem for you. -- Thomas Bellman, Lysator Computer Club, Linköping University, Sweden "God is real, but Jesus is an integer." ! bellman @ lysator.liu.se ! Make Love -- Nicht Wahr! -- http://mail.python.org/mailman/listinfo/python-list

tcp traceroute

2007-11-28 Thread Thomas Guettler
Hi, I want to write a small tcp traceroute script. I works, but how can I get the IP of the hop that send 'no route to host'? Result: python tmp/tcptraceroute.py a.b.c.d 80 ttl=01: (113, 'No route to host') ttl=02: (113, 'No route to host') ttl=03: (113, 'No route to host') ttl=04: timed out ttl=

Re: Running unmodified CGI scripts persistently under mod_wsgi.

2007-11-28 Thread Thomas Guettler
Istvan Albert schrieb: > It will be awesome if mod_wsgi can run CGI without invoking python on > each access. For SCGI there is something like this: cgi2scgi: it is small executable written in C, which connects to a running SCGI server. Executing this small binary on every request is no big over

Re: Different kinds of Import Errors

2007-11-30 Thread Thomas Guettler
raham Dumpleton schrieb: > On Nov 28, 12:35 am, Thomas Guettler <[EMAIL PROTECTED]> wrote: >> If you look at this code, you see there are two kind of ImportErrors: >> >> 1. app_name has no attribute or file managment.py: That's OK. >> 2. managment.py exis

Re: Different kinds of Import Errors

2007-12-04 Thread Thomas Guettler
Graham Dumpleton schrieb: > What example did you use to test it? What version of Python are you > using? Yes, this changed. Python 2.3 includes the half imported module. Python 2.4 does not. But the traceback of the exception contains the needed information: Here are the two example files: # fo

ANNOUNCE: Resolver One public Beta now live

2007-12-06 Thread giles . thomas
taking a look, please do download it or drop us a line! Best regards, Giles -- Giles Thomas MD & CTO, Resolver Systems Ltd. [EMAIL PROTECTED] +44 (0) 20 7253 6372 17a Clerkenwell Road, London EC1M 5RD, UK VAT No.: GB 893 5643 79 Registered in England and Wales as company number 5467329

Re: Matching XML Tag Contents with Regex

2007-12-11 Thread harvey . thomas
On Dec 11, 4:05 pm, Chris <[EMAIL PROTECTED]> wrote: > I'm trying to find the contents of an XML tag. Nothing fancy. I don't > care about parsing child tags or anything. I just want to get the raw > text. Here's my script: > > import re > > data = """ > > > > here's some text! > > > here's som

Re: looking for gui for python code

2007-12-14 Thread Thomas Lenarz
mplex GUIs. For complex GUIs especially with huge amounts of entry-fields it is better to use a GUI-builder especially for later maintenance. Handcoded GUI-code might get nearly unreadable after it has been changed during the lifetime of a software (, and by different developers) Regards, Tho

Re: 2.5a1 import of .dlls

2006-04-18 Thread Thomas Heller
must have a '.pyd' extension. I don't know why this isn't documented somewhere (although I would expect it in Misc/NEWS instead of in PEP 328) - you should filke a bug report. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: python about mobile game?

2006-04-20 Thread Thomas Nelson
What is a mobile game? Is it a game that can be played on a mobile phone? THN -- http://mail.python.org/mailman/listinfo/python-list

Class __init__ behaviour

2006-04-20 Thread Thomas Bartkus
appen. The ancester object won't be initialized. But If I *don't* insert my own __init__ in my new class, then any declared ancester __init__ will automatically run because I haven't overridden the ancesters __init__ method with my own. Did I get that straight? Thoma

Re: Problem calling math.cos()

2006-04-23 Thread Thomas Bellman
Alex Martelli <[EMAIL PROTECTED]> wrote: > C has no stand on complex numbers. If by that you mean that C does not have complex numbers, then you are wrong. C99 defines the three types float _Complex, double _Complex, and long double _Complex, and also the header . -- Thoma

Re: python application ideas.

2006-04-25 Thread Thomas Bartkus
e nothing to do. What *other* interests do you have? Hobbies? Job Skills? What *does* "blow your hair back" ;-) That's where your programming ideas need to come from. Thomas Bartkus -- http://mail.python.org/mailman/listinfo/python-list

Re: win32com short path name on 2k

2006-04-26 Thread Thomas Heller
2com on XP Professional SP2... >>>> import win32com.client as w32c >>>> fc = w32c.Dispatch('Featurecam.Application') >>>> fc.InstallPath > u'C:\\Program Files\\FeatureCAM' > > Why the short vs long names? > That depends on how the com application was registered. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Importing modules through directory shortcuts on Windows

2006-04-26 Thread Thomas Heller
s. > > Therefore, I wrote a very simple import hook to get around that problem. > If you are interested, the code is here: > http://www.sweetapp.com/shortcut/shortcutimporter.py > > BTW, does anyone else think that this functionality should be part of > core Python? I wonde

Re: (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-26 Thread Mark Thomas
Xah Lee wrote: > Dear John Bokma, > > This is a public notice that what you are trying to do is getting close > to harrassment from the law's perspective. > > Thanks. > >Xah >[EMAIL PROTECTED] > ∑ http://xahlee.org/ > > > John Bokma wrote: >> Eli Gottlieb <[EMAIL PROTECTED]> wrote: >>

Re: modifying iterator value.

2006-04-26 Thread Thomas Nelson
There is also this way: for index in range(len(someList)): someList[index] = 1 This is not as pretty or concise as enumerate(), but if you've never seen that function before this may be more clear. I assume you're familiar with the way range and len work. THN -- http://mail.python.org/mai

Re: print names of dictionaries

2006-04-26 Thread Thomas Nelson
Here's an OO way that may do what you want: >>> class MyD(dict): ... def __init__(self,dic,rep): ... dict.__init__(self,dic) ... self.rep = rep ... def __repr__(self): ... return self.rep ... >>> apps = MyD({'alpha':1,'beta':2},'apps') >>> apps apps >>> a

Re: do while loop

2006-04-26 Thread Thomas Nelson
My usual way of emulating do-while is: started = False while (someBoolean or not started): started = True #whatever else This simply assures "whatever else" happens at least once. Is this Pythonic? THN -- http://mail.python.org/mailman/listinfo/python-list

Re: print names of dictionaries

2006-04-26 Thread Thomas Nelson
Here's an OO way that may do what you want: >>> class MyD(dict): ... def __init__(self,dic,rep): ... dict.__init__(self,dic) ... self.rep = rep ... def __repr__(self): ... return self.rep ... >>> apps = MyD({'alpha':1,'beta':2},'apps') >>> apps apps >>> a

Re: print names of dictionaries

2006-04-26 Thread Thomas Nelson
I meant something like def printdict(dictionaries=[(apps,'apps'), (dirs,'dirs'), (sites,'sites')]): for dictionary,name in dictionaries: print name keys = dictionary.keys() keys.sort() for key in keys: print key, ":

Re: A QFB agent: how to catch C-level crashes and last Python stack ?

2006-04-27 Thread Thomas Heller
shared library, requires no modifications to the target scripting language, introduces no performance penalty, and simplifies the debugging of mixed interpreted-compiled application software. """ It may be an interesting project to port this to Windows. Hope that helps, Thomas -- http://mail.python.org/mailman/listinfo/python-list

String Exceptions (PEP 352)

2006-04-27 Thread Thomas Guettler
fferent from Exception("..."). This could become deprecated. Please keep Python compatible to old versions. Thomas Güttler -- 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: os.startfile() - one or two arguments?

2006-04-28 Thread Thomas Heller
d on directories). The optional second argument was added in Python 2.5 (currently in alpha). These examples work for me, with python 2.5a2: os.startfile("Rechnung-28.10.pdf", "print") os.startfile("c:\\", "explore") Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: pleac

2006-05-04 Thread Thomas Guettler
ease-of-use and power/efficiency of these languages. """ -- 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 for Perl programmers

2006-05-05 Thread Thomas Guettler
ok translated into several languages. 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 rounding problem.

2006-05-08 Thread Thomas Bartkus
y more than you can do it with pencil and paper. You can be precise and write "1/3" or you can surrender to arithmetic convenience and settle for the imprecise by writing "0.3", chopping it off at some arbitrary precision. Which is exactly what you did in your post ;-) Thomas Bartkus -- http://mail.python.org/mailman/listinfo/python-list

Re: python rounding problem.

2006-05-08 Thread Thomas Bartkus
"Grant Edwards" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2006-05-08, Thomas Bartkus <[EMAIL PROTECTED]> wrote: > > >> does python support true rations, which means that 1/3 is a > >> true one-third and not 0.3 rounded of

Re: Python editor recommendation.

2006-05-09 Thread Thomas Guettler
Am Tue, 09 May 2006 14:37:53 +0100 schrieb Dale Strickland-Clark: > Vim. > > Everything else is Notepad. Vi or vim are good for editing config files over ssh. For programming I use XEmacs. HTH, Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas

Re: python rounding problem.

2006-05-09 Thread Thomas Bartkus
"Grant Edwards" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2006-05-08, Thomas Bartkus <[EMAIL PROTECTED]> wrote: > > >> Or you can write 0.1 > >> 3 > >> > >> :) > > > > Ahhh!

Re: MySQLdb trouble

2006-05-10 Thread Thomas Bartkus
x27;s really a matter of style and preference. Some programmers (myself included!) prefer many, very short and simple functions over fewer function with longer blocks of more complex code. It's hard to make a mistake by having too many short and simple functions. And much too easy to make them when you have too few ;-) Thomas Bartkus . -- http://mail.python.org/mailman/listinfo/python-list

Re: MySQLdb trouble

2006-05-10 Thread Thomas Bartkus
"John Salerno" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thomas Bartkus wrote: > > > 1) His code body will be less likely to cause migrane headaches when he > > tries to read and interpret what he did a year from now. If you are trying >

Re: Making all string literals Unicode

2006-05-15 Thread Thomas Heller
Richie Hindle wrote: > Hi, > > Am I imagining it, or is there a switch or an environment variable to > make Python treat all string literals as unicode? I seem to recall > seeing it mentioned somewhere, but now I can't find it anywhere. > > Thanks, > python -U -- http://mail.python.org/mailma

Re: Best way to handle exceptions with try/finally

2006-05-24 Thread Thomas Guettler
You can reraise the exception: try: something() except: cleanup() raise # reraise the caught exception -- 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: usage of file separator

2007-12-31 Thread Thomas Wittek
[EMAIL PROTECTED]: > for x in imagefilenames: > imgfile=folder+"/"+x > newimgfilenamelist.append(imgfile) > > [..] how do i make it work on other os? from os.path import join #.. imgfile=join(folder, x) -- Thomas Wittek Web: http://gedankenkonstrukt.de/

Resetting Signal Mask

2008-01-04 Thread Thomas Guettler
signal mask? I guess it could be done with ctypes (I never used it up to now). Why is sigprocmask not available in Python? Python exposes most of the other POSIX API. Thomas 1 #include 2 #include 3 #include 4 5 int main(int argc, char *argv[]) { 6 sigset_t

Re: ctypes - pointer to array of structs?

2008-01-04 Thread Thomas Heller
s the '*' operator to derefence pointers, Python does not so you have to use p[0] instead of *p): table = ptab[0] symp = table.map for i in range(table.nsymbols): sym = symp[0] print sym.symbol, sym.num, sym.units, sym.baseprice Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: pydepend (checking dependencies like jdepend) ?

2008-01-04 Thread Thomas Heller
Stefan Schukat schrieb: > No, py2exe does not display such information but has an algorithm to > collect such information. > Perhaps this is a starting point for you. If py2exe is run with the -x flag, it does display a cross-reference in a browser window. Thomas -- http://mail.p

Re: for loop without variable

2008-01-09 Thread Thomas Heller
i' to '_', IIRC: for _ in range(10): pass Thomas -- http://mail.python.org/mailman/listinfo/python-list

Embedding python code into text document question.

2008-01-10 Thread Thomas Troeger
"Yes" else: return "No"$$ I've tried several solutions using eval, execfile or compile, but none of those would solve my problem. Does anyone have a solution that works? Any suggestions? Any help will be appreciated :) Regards, Thomas. -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding python code into text document question.

2008-01-10 Thread Thomas Troeger
Ok I've written a small example program to clarify matters: [SNIP] #!/usr/bin/python import os, sys, time def template(src, dst, sep): """ Copy file from src to dst, executing embedded python code. """ try: #

Re: Embedding python code into text document question.

2008-01-11 Thread Thomas Troeger
Thanks guys, you've helped me very much :) Cheers & happy new year! -- http://mail.python.org/mailman/listinfo/python-list

Re: module finalizer - is there such a beast?

2008-01-11 Thread Thomas Troeger
You can execute cleanup code if the interpreter exits: http://docs.python.org/lib/module-atexit.html This will only cover the `Python's exit' part of your question, not the module reloading stuff. On the other hand, if you load a module you could set a global variable and check for it on reload

Re: Embedding Python - Freeing Python Objects Not Using Py_DECREF

2008-01-17 Thread Thomas Heller
gt; dll does not always appear in system folders - sometimes it is in the > python installation directory, thus it is unclear which targets to > specify to the linker to search for the dll). Use the Py_DecRef function, which was added for exactly this purpose. Thomas -- http://mail.python.org/mailman/listinfo/python-list

ANN: Resolver One 1.0 released

2008-01-17 Thread Giles Thomas
l use :-), so if you would like to take a look, you can download it from our website (free registration required): <http://www.resolversystems.com/get-it/> Best regards, Giles -- Giles Thomas MD & CTO, Resolver Systems Ltd. [EMAIL PROTECTED] +44 (0) 20 7253 6372 Try out Reso

Re: ctypes CDLL - which paths are searched?

2008-01-21 Thread Thomas Heller
path) straight to the dlopen(3) call, so your system documentation should tell you. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: ctypes CDLL - which paths are searched?

2008-01-22 Thread Thomas Heller
Helmut Jarausch schrieb: > Thomas Heller wrote: >> Helmut Jarausch schrieb: >>> Hi, >>> >>> how can I specify the paths to be searched for a dynamic library >>> to be loaded by ctypes' CDLL class on a Linux system. >>> >>> Do

Re: sudoku solver in Python ...

2008-01-24 Thread Thomas Thiel
On Wed, 23 Jan 2008 19:02:01 -0800 (PST), Derek Marshall wrote: > This is just for fun, in case someone would be interested and because > I haven't had the pleasure of posting anything here in many years ... > > http://derek.marshall.googlepages.com/pythonsudokusolver > > Appreciate any fee

Re: Python and binary compatibility

2008-01-24 Thread Thomas Heller
could apparently be fixed if I > could acquire a copy of VS 2003, but Microsoft has made it incredibly > difficult to find the download for it (I don't think it exists). > > Any suggestions? Maybe this helps? http://www.develer.com/oss/GccWinBinaries Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: read and readline hanging

2008-01-25 Thread Thomas Bellman
there is a space instead of a dash after the "250" code in the last line above, the SMTP client knows that there won't be any more lines in response to its command. If you can't get the program you are calling to follow some protocol like this, then you can only make guesses.

Re: Windows AVIFile problems

2008-01-25 Thread Thomas Heller
l, it seems it called avifil32.dll. Also I guess to get the AVIFILE.H header file, you need to install some MS SDK or the platform sdk. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: read and readline hanging

2008-01-27 Thread Thomas Bellman
> Yes but my python threading is worse than rudimentary. I will look > into the `trheading` module suggested by the other poster. I think you would be better off looking into the correctly spelled 'threading' module rather than the misspelled 'trheading' module. :-) -- Th

[Q] Is there a way to minimize a Tkinter application to the system tray?

2008-01-28 Thread Thomas Ploch
Hello folks, I already found some answers on the net, which said that the Tk library that Tkinter wraps does not offer functionality to minimize an application to the system tray. But I hope there are some wizards in here that might tell me that how it (possibly) could be done. Thomas

Re: dl module

2008-01-31 Thread Thomas Pani
There's a Debian bug for python2.2 at [1]. You can't use dl on a 64bit machine anyway, because sizeof(int) != sizeof(long). Cheers Thomas Pani [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=141681 Nicola Jean wrote: > Hi everyone, > I'm having a problem compiling Pyt

Re: How to identify which numbers in a list are within each others' range

2008-02-01 Thread Thomas Pani
yield i,j It's still n^2. Or am I missing something? Cheers, thomas -- http://mail.python.org/mailman/listinfo/python-list

Windows Python 2.5.1 IPV6 problems

2008-02-02 Thread Thomas DiZoglio
Hi, I'm trying to get some IPV6 python code running under Windows. I have installed Python 2.5.1 for Windows using the binaries from python.org. I'm a newbie to Python programming as well. The code works fine under Debian and MacOSX (both using Python 2.5) I have rebuilt the python binaries from

Re: Windows Python 2.5.1 IPV6 problems

2008-02-03 Thread Thomas DiZoglio
Hi, Thanks for the help. I had to make family and int. It was defined as socket.AF_INET6 and for some reason not making that an int. It is fix now. --- t0md --- "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > _sock = _realsocket(family, type, proto) > > TypeError: an intege

Re: Python GUI toolkit

2008-02-03 Thread Thomas Pani
eption/ Cheers, thomas pani -- http://mail.python.org/mailman/listinfo/python-list

Re: polling for output from a subprocess module

2008-02-04 Thread Thomas Bellman
hink, Ctrl-Z if you are using MS-Windows). However, the os.read() function will only read what is currently available. Note, though, that os.read() does not do line-based I/O, so depending on the timing you can get incomplete lines, or multiple lines in one read. -- Thomas Bellman, Lysat

Re: polling for output from a subprocess module

2008-02-05 Thread Thomas Bellman
Christian Heimes <[EMAIL PROTECTED]> writes: > Thomas Bellman wrote: >> The readlines() method will read until it reaches end of file (or >> an error occurs), not just what is available at the moment. You >> can see that for your self by running: > Bad idea ;) W

Re: polling for output from a subprocess module

2008-02-06 Thread Thomas Bellman
Ivo <[EMAIL PROTECTED]> wrote: > Thomas Bellman wrote: >> However, the os.read() function will only read what is currently >> available. Note, though, that os.read() does not do line-based >> I/O, so depending on the timing you can get incomplete lines, or &g

<    19   20   21   22   23   24   25   26   27   28   >