Re: file locking...

2009-03-02 Thread Thomas Guettler
done it before. If the process is done it moves the file/directory to "done". To avoid stressing the directories, too much, It might be good to use subdirectories like todo/NN/MM/. I think git (version control system created by Linus Torvalds) does something like this. Thomas [

Bizarre import duplication.

2009-03-06 Thread Richard Thomas
Say I have a project like this: ./run.py ./package/__init__.py ./package/mod1.py ./package/subpackage/__init__.py ./package/subpackage/mod2.py ./package/subpackage/mod3.py And suppose that "." and "package" (or their absolute paths) are in sys.path. Now mod1.py and mod2.p

Uploading a file using POST

2009-03-18 Thread Thomas Robitaille
nstead, the content of the file is all contained inside the $_POST variable. What I would like is essentially the equivalent of enctype="multipart/form-data"> which does result in the file being uploaded and the path placed in $_FILES. What am I doing wrong? Thanks for any

How to port Python to an ARM running NucleusPlus OS

2009-03-28 Thread Thomas Ng
ng VC++. But no idea how to proceed from here. Since I am not familiar with Linux, I would prefer to do the porting work on Windows. Thanks! Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: How to port Python to an ARM running NucleusPlus OS

2009-03-28 Thread Thomas Ng
Hi Thanks, probably I will start with cross-compiling the python and see what happen. And to compile a minimal python, what are the list of source files that need to be compile? Any makefile (or other files) that's included in the download package that I should refer to? Thanks again! T

pyreadline, InteractiveConsole, and tab completion on Windows

2009-04-03 Thread Thomas Heller
UserWarning ArithmeticError assertSystemExitfilter str break StandardError range property [...] >>> import sys >>> sys. How can I get the same tab-completion? Thanks, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Hash of None varies per-machine

2009-04-04 Thread Thomas Bellman
Steven D'Aprano wrote: > You can hash numbers no matter how big they are. > >>> hash(float('inf')) > 314159 Cute. And hash(float('-inf')) is -271828... -- Thomas Bellman, Lysator Computer Club, Linköping University, Sweden "God is

Re: named pipe and Linux

2009-04-08 Thread Thomas Bellman
message with an octet sequence that cannot occur within a message. For example, a linefeed without a backslash before it (and you would probably want a way to escape the backslash, in case you want to end a message with a backslash). - Have small header of a fixed size at the start of eac

IronPython newbie: not clear on imports and assemblies

2009-04-15 Thread Thomas Gagne
OK--I also haven't programmed on .NET before. My goal is to play with the "EssentialPDF" libraries inside IronPython. But I'm not clear on how to import (load?) Essential's .dll files. Of course, all the samples files are in C# and VB. I guess I"m wondering if Essential's libraries (assembl

Re: ANN: PyGUI 2.0.1

2009-04-17 Thread Thomas Heller
tspot is in the middle of the image. > > That's okay too, it's meant to be there. > Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows Shell Extensions - Out of Proc

2009-04-23 Thread Thomas Heller
s, without much > success. I couldn't even find a good example for any other language, > only references saying it's possible for C#. I think that for whatever reasons, explorer always tries to create shell extensions as InProc. CoCreateInstance, which is the usual API to create CO

Re: Windows Shell Extensions - Out of Proc

2009-04-23 Thread Thomas Heller
Ralf schrieb: >> I think that for whatever reasons, explorer always tries to create >> shell extensions as InProc. CoCreateInstance, which is the usual >> API to create COM instances, allows to specify which one you want. >> >> Thomas > > So there is no wa

Re: Failed to build these modules:_ctypes

2009-04-24 Thread Thomas Heller
PS schrieb: > Hello all > > I can't install neither python 2.6.1 nor 2.6.2 because an error during > compilation of _ctypes module, I don't need the module but I don't > know how to instruct to skip it. You only get a warning, right? So a subsequent 'make install' should work. -- http://mail.pyt

Re: pythonCE GetSystemPowerState windows api

2009-04-25 Thread Thomas Heller
16EC60> >>> p=create_unicode_buffer(256) >>> flags=c_ulong() >>> f=d.GetSystemPowerState >>> f(p,256,byref(flags)) 0 >>> p.value u'on' >>> flags c_ulong(268500992L) >>> hex(flags.value) '0x1001L' >>> Thomas -- http://mail.python.org/mailman/listinfo/python-list

Web framework for embedded system

2009-04-28 Thread Thomas Heller
tions? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Web framework for embedded system

2009-04-29 Thread Thomas Heller
Thomas Heller schrieb: > I'm looking for a lightweight web-framework for an embedded system. > The system is running a realtime linux-variant on a 200 MHz ARM > processor, Python reports a performance of around 500 pystones. > > The web application will not be too fancy, n

json vs. simplejson

2009-05-13 Thread Thomas Heller
s anyone have an explanation for that? Thanks, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Fwd: Re: Unable to install Pywin32 for Python 2.6.2

2009-05-13 Thread Thomas Heller
he windows installer than you can always install from the sources. Please go ahead and try it out. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: json vs. simplejson

2009-05-13 Thread Thomas Heller
Diez B. Roggisch schrieb: > Thomas Heller wrote: > >> Python 2.6 contains the json module, which I thought was the renamed (and >> improved?) simplejson module that also works on older Python versions. >> >> However, it seems the json is a lot slower than simplejso

Re: json vs. simplejson

2009-05-13 Thread Thomas Heller
Ned Deily schrieb: > In article <[email protected]>, > Thomas Heller wrote: >> Diez B. Roggisch schrieb: >> > Thomas Heller wrote: >> >> Python 2.6 contains the json module, which I thought was the renamed (and >> >> improved?

UDP reading on multiple sockets

2009-05-16 Thread Thomas Vogel
n m else: return None def __del__(self): self.close() Thanks a lot in advance Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: UDP reading on multiple sockets

2009-05-19 Thread thomas . vogel
On 17 Mai, 04:22, Grant Edwards wrote: > On 2009-05-17, Thomas Vogel wrote: > > > I'm currently have the problem that I try to read UDP messages from > > multiple sockets in parallel. So let's say I get UDP packets from the > > same IP on the ports 2000, 2001

Re: Advanced Python books?

2009-05-19 Thread Thomas Guettler
magic of all web apps into one chapter. GUI-apps: You can use tkinter, qt or gtk again it would be hard to put something useable into one chapter. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-28 Thread Thomas Bellman
nclosed, no matter what you do. Not using SO_REUSEADDR means forcing a service interruption of half an hour (IIRC) if for some reason the service must be restarted, or having to reboot the entire machine. No thanks. I have been in that situation. -- Thomas Bellman, Lysator Academic Computer

Re: How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-30 Thread Thomas Bellman
Lawrence D'Oliveiro wrote: > In message , Thomas Bellman wrote: >> Speaking as a sysadmin, running applications for production, >> programs not using SO_REUSEADDR should be taken out and shot. >> Not using SO_REUSEADDR means forcing a service interruption of >>

ANN: Resolver One 1.5 released

2009-06-03 Thread Giles Thomas
load it from our website: <http://www.resolversystems.com/download/> If you want to use Resolver One in an Open Source project, we offer free licenses for that: <http://www.resolversystems.com/opensource/> Best regards, Giles -- Giles Thomas [email protected]

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-04 Thread Thomas Heller
ers mailing list, most of them have the word 'cpptypes' in the subject line. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-04 Thread Thomas Heller
[Please keep the discussion on the list] Joseph Garvin schrieb: > On Thu, Jun 4, 2009 at 3:43 AM, Thomas Heller wrote: >> There have been some attempts to use ctypes to access C++ objects. >> We (Roman Yakovenko and myself) made some progress. We were able to >> handle C

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-04 Thread Thomas Heller
Philip Semanchuk schrieb: > Hi Thomas, > We're weighing options for accessing C++ objects via Python. I know of > SIWG and Boost; are there others that you think deserve consideration? I haven't used any of them myself. A common suggestion is SIP, less known are pybind

Re: ctype question

2009-06-04 Thread Thomas Heller
ook for undefined symbols > in B.so as well? You could try to pass ctypes.RTLD_GLOBAL as the 'mode' parameter to ctypes.CDLL when you load the library. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-05 Thread Thomas Heller
Joseph Garvin schrieb: > On Thu, Jun 4, 2009 at 3:23 PM, Brian wrote: >> What is the goal of this conversation that goes above and beyond what >> Boost.Python + pygccxml achieve? > > I can't speak for others but the reason I was asking is because it's > nice to be able to define bindings from wit

Re: compressing short strings?

2008-05-20 Thread Thomas Troeger
t does it ... but if you can't find any, LZ78 is implemented in 1 or 2 hours. There was a rather good explanation of the algorithm in German, unfortunately it's vanished from the net recently (I have a backup if you're interested). Cheers, Thomas. -- http://mail.python.org/mailman/listinfo/python-list

Embedding Python question.

2008-05-20 Thread Thomas Troeger
to documentation where a similar problem is explained in detail. Does anyone have such information? Thanks! Thomas. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie In Python

2008-05-20 Thread Thomas Troeger
[EMAIL PROTECTED] wrote: I have Heard About "Python" its a OOD Language. i have to Learn it where from i should start it. i have python compiler at linux Platform. anyone can suggest me about it. Thanks In advance. How about http://docs.python.org/tut/tut.html? -- http://mail.python.org/mailma

Re: Misuse of list comprehensions?

2008-05-20 Thread Thomas Bellman
t you *also* create a 17 long list with all elements set to None, that is immediately thrown away. -- Thomas Bellman, Lysator Computer Club, Linköping University, Sweden "I refuse to have a battle of wits with an ! bellman @ lysator.liu.se unarmed person."! Make Love -- Nicht Wahr! -- http://mail.python.org/mailman/listinfo/python-list

Re: Accumulating values in dictionary

2008-05-20 Thread Thomas Bellman
en to defaultdict will be called the first time a key is mentioned, and if the keys are mostly unique, that will be the majority of the times, and calling a pure Python function is fairly slow in CPython. (It probably won't matter unless you have many thousands of unique keys, though.) -- Thom

Re: Misuse of list comprehensions?

2008-05-20 Thread Thomas Bellman
ntain the list. Unlikely, but not entirely impossible, and just a small change of the problem size can change the balance again. -- Thomas Bellman, Lysator Computer Club, Linköping University, Sweden "What sane person could live in this world ! bellman @ lysator.liu.se and not be crazy?" -- Ursula K LeGuin ! Make Love -- Nicht Wahr! -- http://mail.python.org/mailman/listinfo/python-list

Re: Accumulating values in dictionary

2008-05-20 Thread Thomas Bellman
his, then I believe the warning I gave about performance does not apply; my understanding is that calling built-in functions (like the int constructor) is fast. -- Thomas Bellman, Lysator Computer Club, Linköping University, Sweden "Beware of bugs in the above code; I have! be

Re: Access to sysctl on FreeBSD?

2008-05-20 Thread Thomas Heller
size = c_uint(0) libc.sysctlbyname("net.inet.ip.stats", None, byref(size), None, 0) buf = create_string_buffer(size.value) libc.sysctlbyname("net.inet.ip.stats", buf, byref(size), None, 0) Thomas -- http://mail.python.org/mailman/listinfo/python-list

Minimal Python installation?

2008-05-21 Thread Thomas Troeger
want a complete Python install, but without all the batteries :-) Any pointers? Regards, Thomas. -- http://mail.python.org/mailman/listinfo/python-list

Re: [ctypes] convert pointer to string?

2008-05-21 Thread Thomas Heller
the structure may contain '0' values. > ctypes instances support the buffer interface, and you can convert the buffer contents into a string: >>> from ctypes import * >>> c_int(42) c_long(42) >>> buffer(c_int(42)) >>> buffer(c_int(42))[:] '*\x00\x00\x00' >>> Thomas -- http://mail.python.org/mailman/listinfo/python-list

Decorator metaclass

2008-05-22 Thread thomas . karolski
inside __new__ to have Decorator as one of its bases, but then for some reason impl(*args, **dargs) asks for 4 arguments (just like __new__) and I have no clue as to why that happens. Any help on this? Regards, Thomas K. -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorator metaclass

2008-05-23 Thread Thomas Karolski
ed. Does this prove to be a problem? Probably the best piece of advice is "Don't try to use Decorator pattern". :) Well, I decided on the decorator pattern, because I want to be able to change the behavior of classes during run-time. I did not really find any other pattern which w

Re: Decorator metaclass

2008-05-23 Thread Thomas Karolski
the different possibilities. Composite pattern does not help in this case, since I lose the ability to choose in what order I call the decorator's and the decorated's methods. I'll just keep trying. Any input greatly appreciated. Regards, Thomas K. -- http://mail.python.org/mailman/listinfo/python-list

Image Processing (batch)

2008-06-03 Thread Thomas Guettler
there are these alternatives: - Python binding for image magick - python-gtk - python-gdk-imlib - call convert (imagemagick) with subprocess. This is how I did it up to now. But I want to avoid it. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-gue

Re: defaultdict.fromkeys returns a surprising defaultdict

2008-06-04 Thread Thomas Bellman
27;], 0) >>> d.default_factory = list >>> d defaultdict(, {'y': 0, 'x': 0}) >>> d['z'] [] >>> d defaultdict(, {'y': 0, 'x': 0, 'z': []}) The keys you give to the fromkeys() method

Re: Image Processing (batch)

2008-06-04 Thread Thomas Guettler
Weinhandl Herbert schrieb: Thomas Guettler schrieb: Hi, I tried PIL for image batch processing. But somehow I don't like it - Font-Selection: You need to give the name of the font file. - Drawing on an image needs a different object that pasting and saving. - The handbook is from Dec.

ANN: Resolver One 1.1 released

2008-06-04 Thread Giles Thomas
gt; It's free for non-commercial use (and quite cheap for commercial 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

Re: Exit from os.chroot()

2008-06-04 Thread Thomas Bellman
cess can do even when chroot:ed, like creating device files or setuid binaries. All this is of course assuming that the chroot is done for security reasons. There are other reasons one might want to run in chroot. -- Thomas Bellman, Lysator Computer Club, Linköping University, Sweden

Re: ANN: Resolver One 1.1 released

2008-06-04 Thread Giles Thomas
Stefan Behnel wrote: > Giles Thomas wrote: > > We are proud to announce the release of Resolver One, version 1.1 - the > > largest IronPython application in the world, we think, at 38,000 lines > > of production code backed up by 130,000 lines of unit and functional > &

Re: Exit from os.chroot()

2008-06-05 Thread Thomas Bellman
symlinks from the chroot jail that try to point to things outside the chroot, you are at least guaranteed that you won't give the chroot:ed process to much information. Unfortunately, you won't be giving it the tools it needs to do its designed job, either, since symlinks can't esca

Getting current screen resolution

2008-06-09 Thread Thomas Morton
This is a "thing" that has been annoying me all morning: and I can't work out how to do it. I need a way to get the DPI or screen resolution of the monitor that a script is currently runnign on. I have a way in Windows but it doesnt port to Unix (which is important). Any ide

Re: Getting current screen resolution

2008-06-10 Thread Thomas Morton
To: Subject: Re: Getting current screen resolution Thomas Morton wrote: This is a "thing" that has been annoying me all morning: and I can't work out how to do it. I need a way to get the DPI or screen resolution of the monitor that a script is currently runnign on. I have a way in

Re: unable to import modules from other folders

2008-06-10 Thread morton . thomas
ort from this.however, "foo" is in D:\foo. > > foo.py : > > from bigbee import * > > The error i get is: > > ImportError: No Module bigbee. > > Please provide a solution. > -- > http://mail.python.org/mailman/listinfo/python-list > -- Thomas Morton Lea

Re: Instructions on how to build py2exe 0.6.8 (or an installer would be nice, too!)

2008-06-10 Thread Thomas Heller
ions.) Easy - download the sources, and enter 'python setup.py bdist_wininst' in the top-level directory. You need the same compiler that was used to build the Python that you use. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: problems with opening files due to file's path

2008-06-10 Thread Thomas Morton
maybe try string substitution... not sure if that's really the BEST way to do it but it should work startfile(r"%s"%variable) -- From: "Alexnb" <[EMAIL PROTECTED]> Sent: Tuesday, June 10, 2008 7:05 PM To: Subject: Re: problems with opening files

Re: problems with opening files due to file's path

2008-06-10 Thread Thomas Morton
, and the output startfile(r"%s"%full)***full is the path*** startfile(r"%s"%full) WindowsError: [Error 2] The system cannot find the file specified: '"C:\\Documents and Settings\\Alex\\My Documents\\My Music\\Rhapsody\\Bryanbros\\Jason Mraz\\I\'m Yours

Re: problems with opening files due to file's path

2008-06-11 Thread Thomas Morton
@Mike and the others yesterday I did think after I posted that code (the string substitution thing) that it might do that. Thanks for clarifying that it was rubbish :P @ Alexnb I'm do a lot of support on a community forum that uses Python as it's language - I can tell you from experience tha

Re: newbie question: for loop within for loop confusion

2008-06-16 Thread Thomas Hill
On Jun 15, 6:23 pm, takayuki <[EMAIL PROTECTED]> wrote: > def hasnolet(avoid): > fin = open('animals.txt') > for line in fin: > word = line.strip() > for letter in avoid: > if letter in word: > b

Re: newbie question: for loop within for loop confusion

2008-06-16 Thread Thomas Hill
On Jun 16, 2:34 pm, Thomas Hill <[EMAIL PROTECTED]> wrote: > On Jun 15, 6:23 pm, takayuki <[EMAIL PROTECTED]> wrote: > > > def hasnolet(avoid): > > fin = open('animals.txt') > > for line in fin: > > word =

Re: Calling pcre with ctypes

2008-06-18 Thread Thomas Heller
now how to convert parameter 7 > > What is the correct way to construct and pass ovector? 'ctypes.c_int * OVECOUNT' does not create an array *instance*, it creates an array *type*, comparable to a typedef in C. You can create an array instance by calling the type, with zero or more initializers: ovector = (ctypes.c_int * OVECOUNT)(0, 1, 2, 3, ...) Thomas -- http://mail.python.org/mailman/listinfo/python-list

Scripting SAP GUI (Windows)

2008-07-02 Thread Thomas Guettler
. - pyHook - user pywin32 and SetWindowsHookEx I develop with python since seven years, but only on linux. Any hints? -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: Scripting SAP GUI (Windows)

2008-07-02 Thread Thomas Guettler
I just got this link in a german newsgroup: http://pywinauto.openqa.org/ Seems to be what I was looking for. Nevertheless feedback still welcome. Thomas Guettler schrieb: Hi, I need to script SAP GUI running on MS-Windows: Open SAP GUI window, if it is not already open, and then batch input

Static Class Initialization Question.

2008-07-04 Thread Thomas Troeger
Hello, I have a class that looks like this: class A(object): def __init__(self, a=0, b=1): self.a, self.b=a, b def __str__(self): return "%s(%d,%d)" % (type(a).__name__, self.a, self.b) I want to have a list of such classes instantiated a

Re: Static Class Initialization Question.

2008-07-04 Thread Thomas Troeger
Bruno Desthuilliers wrote: return "%s(%d,%d)" % (type(self).__name__, self.a, self.b) Er, yes exactly! I noticed it a few seconds after I had sent the message ;-( I want to have a list of such classes instantiated automatically on Of course I meant class instances ... sorry :) It'

Python embedding question.

2008-07-15 Thread Thomas Troeger
gs to libraries like cairo, Qt or similar? Is there a site that helps with those decisions? I've really looked at a lot of places but haven't found a suitable solutions yet, so I'm asking here in hope that someone has experience with that topic. Regards, Thomas. -- http://ma

Re: Python embedding question.

2008-07-15 Thread Thomas Troeger
Kay Schluehr wrote: On 15 Jul., 11:51, Thomas Troeger <[EMAIL PROTECTED]> wrote: I've really looked at a lot of places but haven't found a suitable solutions yet, so I'm asking here in hope that someone has experience with that topic. Which solutions did you rule

Re: Testing for Internet Connection

2008-07-15 Thread Thomas Troeger
print "Horray!" else: print "We've lost headquarters!" == I hope the code is ok, but there is always something you can do better. Comments? :) Cheers, Thomas. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python embedding question.

2008-07-17 Thread Thomas Troeger
using a very small Linux system with busybox, running from a compact flash drive. I'll investigate PyGame, it sounds as if it is a good candidate :P Thanks so far, Thomas. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python embedding question (2).

2008-07-17 Thread Thomas Troeger
orithm. - hardware caching of bitmaps for faster graphics operations (needed for tool tips or similar tasks). I'll try to find that out myself (I'm pretty excited about the thing already ^^), but I'd be happy to hear of people who have used it already. Cheers, Thomas. -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Tcl extensions with Python?

2008-07-18 Thread Thomas Troeger
C Martin wrote: How do you setup a Tcl extension to be accessible through Python? I understand that I'll have to use native Tcl calls to use it (tk.call() etc), but I can't figure out where to put the files or how to initialize them so I can call them. The package I would like to use is TkPNG:

Re: Python embedding question (2).

2008-07-22 Thread Thomas Troeger
Carl Banks wrote: On Jul 17, 9:57 am, Thomas Troeger <[EMAIL PROTECTED]> wrote: I'd say that PyGame could be a solution. Or otherwise you could do your own audio/graphics programming (you don't tell us which OS you use, but there exist python modules that allow you to do ba

Re: Function editing with Vim throws IndentError

2008-07-23 Thread Thomas Troeger
ptn wrote: Hi everybody, I have a weird problem. Say I have a .py file with some functions in it, like this: [...] Could someone provide some pointers? Thanks, Pablo Torres N. Have you enabled the `list' option to see which characters are acutally on the lines of interest? Try out `:se

Re: python.exe crash and ctypes use

2008-07-23 Thread Thomas Heller
"Error." > === You need the callback function instance - what the CBFUNC(mycallback) call returns - alive as long as some C code is calling it. If you don't sooner or later the Python garbage collector will free it since it seems to be no longer used. c

Re: ctypes and reading value under pointer passed as param of a callback

2008-07-24 Thread Thomas Heller
ssume that the buffer consist of 4 bytes 4 bytes 8 bytes. > > I tried unpack("ii8s", data[0]) and nothing. I tried different ctypes > passed to callback and nothing. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Working with ctypes and char** data type

2008-07-24 Thread Thomas Heller
s + char pointers together in > python with ctypes please? # create an array that holds two pointers to 'char *', and fill it with data: pData = (c_char_p * 2)() pData[0] = "ADDR" pData[1] = "POSTCODE" # Another way: pData = (c_char_p * 2)("ADDR", "POSTCODE") Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Function editing with Vim throws IndentError

2008-07-25 Thread Thomas Troeger
Lawrence D'Oliveiro wrote: Specified by whom? The most common setting these days is 4 columns. Where? I've randomly seen code snipplets that indent using spaces or, worse, tabstop != 8, but most code I've come across uses tabstop width 8, which is how it was meant to be from the beginning of

Re: ctypes and how to copy data passed to callback

2008-07-28 Thread Thomas Heller
: > def callback(data, size): > myqueue.put(data[:size]) > while True: > data = myqueue.get() > print "***", data Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Standard module for parsing emails?

2008-07-30 Thread Thomas Guettler
Phillip B Oldham schrieb: Is there a standard library for parsing emails that can cope with the different way email clients quote? What do you mean with "quote" here? 1. Encode utf8/latin1 to ascii 2. Prefix of quoted text like your text above in my mail Thomas -- Thomas Guet

Re: Difference between type and class

2008-07-31 Thread Thomas Troeger
es share a common type, namely the type that has a `bar' method), but not with an instance of C because it has no method `bar'. Btw, this example shows the use of duck typing (http://en.wikipedia.org/wiki/Duck_typing). HTH, Thomas. -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between type and class

2008-07-31 Thread Thomas Troeger
That would imply that I cannot create instances of a type, only of a class that implements the type, wouldn't it? But Python denotes 'int' as a type *and* I can instantiate it. Now I start getting confused also ;-) >>> a=5 >>> a.__class__ >>> a.__class__.__class__ >>> dir(a) ['__abs__', '__a

Re: Difference between type and class

2008-08-01 Thread Thomas Troeger
Steven D'Aprano wrote: class A: def bar(self): print "A" Alas, you've chosen the worst-possible example to "clarify" matters, because old-style classic classes are *not* unified with types, and will disappear in the future: Of course I wanted to write `class A(objec

DB-API corner case (psycopg2)

2008-08-01 Thread Thomas Guettler
#x27; ''', ()) # Does fail Traceback (most recent call last): File "/localhome/modw/tmp/t.py", line 5, in cursor.execute('''SELECT '%' ''', ()) # Does fail IndexError: tuple index out of range Is this a bug in psycopg2? How d

Re: DB-API corner case (psycopg2)

2008-08-01 Thread Thomas Guettler
eturn self.cursor.execute(sql) What do you think? Thomas Thomas Guettler schrieb: > Hi, > > I discovered this: > > import psycopg2 > connection=psycopg2.connect("dbname='...' user='...'") > cursor=connection.cursor() > cursor.execute(&#

Teething troubles with Python on a Mac

2008-08-02 Thread Thomas Philips
sed. I never thought I'd say this, but it actually seemed a lot easier to get Python and any associated programs up and running on Windows! I suspect that a large fraction of my troubles are due to the fact that I am brand new to the Mac and to Unix, but I bought the Mac in part because I th

Re: How to concatenate datetime.date object and datetime.time object

2008-08-05 Thread Thomas Wright
Will Rocisky wrote: > Actually I am trying to save both date and time in one cell but they > are given separately by user. http://docs.python.org/lib/datetime-datetime.html indicates that the function you're looking for is datetime.datetime.combine(d, t). HTH! -- I'm at CAMbridge, not SPAMbridg

Re: CAB files

2008-08-08 Thread Thomas Heller
a cab and open it with winzip. Thomas from ctypes import * import sys, os, tempfile, glob BOOL = c_int ULONG = c_ulong UINT = c_uint USHORT = c_ushort class ERF(Structure): _fields_ = [("erfOper", c_int), ("erfType", c_int), (&

Re: Trying ZODB, background in Relational: mimic auto_increment?

2008-08-14 Thread Thomas Guettler
witched from ZODB to Postgres. HTH, Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Self-referencing decorator function parameters

2008-04-02 Thread Thomas Dimson
the "call=DecorateMe.callMe" to "call=lambda x: DecorateMe.callMe(x)" everything goes along its merry way. Nesting the call in a lambda seems to allow it to recognize the class definition. Any ideas as to what is going on here (other than ugly code)? Thank you, Thomas Dimson -- http://mail.python.org/mailman/listinfo/python-list

wsdl (soap) without code generation

2008-04-02 Thread Thomas Guettler
ith my eyes and make a fitting soap call... Any thoughts? -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: Self-referencing decorator function parameters

2008-04-02 Thread Thomas Dimson
On Apr 2, 10:31 am, George Sakkis <[EMAIL PROTECTED]> wrote: > On Apr 2, 8:30 am, Thomas Dimson <[EMAIL PROTECTED]> wrote: > > > > > > > Hello, > > > Originally I posted this as a bug but it was shot down pretty quickly. > > I am stil

Re: State of ctypes Support on HP-UX?

2008-04-03 Thread Thomas Heller
ean it works fine, but prior experience > with HP means I'd like more specific assurances). > > Thanks, > Phil I cannot answer your question, but if you want to try it out yourself there is the HP testdrive program: http://www.testdrive.hp.com/ Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: State of ctypes Support on HP-UX?

2008-04-03 Thread Thomas Heller
Phil Thompson schrieb: > On Thursday 03 April 2008, Thomas Heller wrote: >> Phil Thompson schrieb: >> > Could somebody confirm how well ctypes is supported on HP-UX (for both >> > PA-RISC and Itanium) for both Python v2.4 and v2.5? >> I cannot answer your questi

Re: Ignoring windows registry PythonPath subkeys

2008-04-04 Thread Thomas Heller
or you to force the lookup of PythonPath to a different registry key. You can choose something that probably does not exist. py2exe does this also for 'frozen' executables, and so has complete control over sys.path. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: wsdl (soap) without code generation

2008-04-04 Thread Thomas Guettler
... Thank you for your answers. I tried to parse the wsdl with two libraries. (axis2 (java) and SOAPPy). Both fail because there is no entry for 'service'. The wsdl is from SAP XI. Has someone hints? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli

Re: Destructor?

2008-04-08 Thread Thomas Guettler
Duncan Booth schrieb: > [*] except of course for things like power failure. You simply cannot > catch *all* terminations. And 'kill -SIGKILL' can't be caught, since this signal never reaches the process. The os just removes the processes. Thomas -- Thomas Guettl

Ctypes and C Infinite Callback Loops

2008-04-08 Thread Thomas Dimson
_run_exitfuncs func(*targs, **kargs) File "/usr/lib/python2.4/threading.py", line 634, in __exitfunc t.join() File "/usr/lib/python2.4/threading.py", line 532, in join assert self is not currentThread(), "cannot join current thread" AssertionError

Re: Ctypes and C Infinite Callback Loops

2008-04-09 Thread Thomas Dimson
On Apr 9, 1:24 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Tue, 8 Apr 2008 16:49:27 -0700 (PDT), Thomas Dimson > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > > I assume there is some issue with the global interpreter lo

Re: subprocess.Popen() output to logging.StreamHandler()

2008-04-10 Thread Thomas Dimson
logging.DEBUG) s = subprocess.Popen( ['ls','-la'], stdout=subprocess.PIPE ) while 1: ch.info( s.stdout.readline() ) if s.poll() == None: break Perhaps not the most efficient or clean solution, but that is how I usually do it (note: I didn't test the above code). -Thomas Dimson -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess.Popen() output to logging.StreamHandler()

2008-04-10 Thread Thomas Dimson
On Apr 10, 3:05 pm, svensven <[EMAIL PROTECTED]> wrote: > Vinay Sajip wrote: > >  > On Apr 10, 1:11 pm, "sven _" <[EMAIL PROTECTED]> wrote: >  >> My goal is to have stdout and stderr written to a logginghandler. >  > >  > Thomas was

<    21   22   23   24   25   26   27   28   29   30   >