Re: Memory problem

2007-11-15 Thread Diez B. Roggisch
Rolf Wester wrote: > Hi, > > I have a strange (for me) memory problem. When running a loop in a > Python program memory usage increases from about 4% up to 100%. I do a > gc.collect() every loop cycle but this doesn't help. There are about > 67000 objects that are tracked by the garbage collector

Re: how to figure out if python was used as a cgi script

2007-11-15 Thread Diez B. Roggisch
ce wrote: > hi, > > is there a way to figure out which scripting language was used in a > cgi. I used to watch extensions (i.e. py, pl, asp or php) nowadays i > hardly see any extensions and really it is hard to find out anything > from the generated HTML or even the HTML being sent out through t

Re: Movement recognition in video file

2007-11-15 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi, > > I am looking for a python tool or module that helps me build a script > that can perceive object moves in a video file captured by a (web) > camera. My main goal is to be able to count people entering a store > using the store's surveillance camera. > > I know

RE: formated local time

2007-11-15 Thread Looney, James B
You could use: import time time.strftime( "%Y-%m-%d %H:%M:%S" ) or time.strftime( "%Y-%m-%d %H:%M:%S", time.localtime() ) Output: '2007-11-15 11:02:34' Both strftime calls are equivalent, in this case. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > ] On

Re: Python Design Patterns - composition vs. inheritance

2007-11-15 Thread Diez B. Roggisch
> As a very simplified example, if I had two classes, Pet and Owner, it > seems that I would not have Pet inherit from Owner, since a pet 'has > an' owner, but not 'is an' owner. If this is correct, does my code > below reflect this? I passed the owner object into the pet object's > constructor -

Re: Python Design Patterns - composition vs. inheritance

2007-11-15 Thread Diez B. Roggisch
> I think my main concern while getting my toes wet on this was to not > reference the owner object out of "thin air" but to pass it in when > pet is instantiated. I'm not sure what 'actor-passed' is yet, but it > gives me something to search for and learn about. I meant ctor, short-hand for const

Re: SOAPpy port reuse

2007-11-18 Thread Diez B. Roggisch
Maurice LING schrieb: > Hi, > > I have a problem: > > 1. Assuming that my application is a SOAP server that uses SOAPpy, > 2. I am given port 35021 for use. > > What I normally do (simply) is: > > functionlist = [] > import SOAPpy > server = SOAPpy.SOAPServer((, 35021)) > for func in functionli

Re: sys.arg whitespace problem

2007-11-18 Thread Diez B. Roggisch
bryan rasmussen schrieb: > Hi, > > Basically I want to get sys.argv[1: ] but the problem is that actually > the argument should maintain whitespace. Thus if the arguments are > something something with only one space between them, or something > something with three spaces between them I should be

Re: regular expression

2007-11-18 Thread Diez B. Roggisch
gardsted schrieb: > I just can't seem to get it: > I was having some trouble with finding the first following with this regex: > > Should these two approaches behave similarly? > I used hours before I found the second one, > but then again, I'm not so smart...: > > kind retards > jorgen / de men

Re: return image in mod python

2007-11-19 Thread Diez B. Roggisch
Abandoned wrote: > Hi i have a problem. > > def showimage(req): > from PIL import Image > im=Image.open("c:\image-2.jpg") > im.thumbnail((800,600), Image.ANTIALIAS) > req.sendfile(im) > > > > give me some error. Really? I don't see any error. So there can't be

Re: What is python?????

2007-11-19 Thread Diez B. Roggisch
> You're having a conversation with a spambot. Spam - certainly. But bot - no. Unless there have been some really remarkable improvements in KI lately. It's amazing that recently so many spam is written by some guys actually _reading_ this group. I presume they somehow want to create credibility

Re: return image in mod python

2007-11-19 Thread Diez B. Roggisch
Abandoned wrote: > On Nov 19, 12:36 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> Abandoned wrote: >> > Hi i have a problem. >> >> > def showimage(req): >> > from PIL import Image >> > im=Image.open(&qu

Re: Python too complex ?!?!?!

2007-11-19 Thread Diez B. Roggisch
alain schrieb: > On Nov 19, 9:44 am, Kay Schluehr <[EMAIL PROTECTED]> wrote: >> On 17 Nov., 14:46, Brian <[EMAIL PROTECTED]> wrote: >> >>> Had a unsettling conversation with a CS instructor that >>> teaches at local high schools and the community >>> college. This person is a long-term Linux/C/Pyth

Re: Python too complex ?!?!?!

2007-11-19 Thread Diez B. Roggisch
Dennis Lee Bieber schrieb: > On Mon, 19 Nov 2007 18:47:37 +0100, "Diez B. Roggisch" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > >> BTW, you can download eggs and install them from files - so while >> teaching easy_install how to deal

Re: Web update library in python?

2007-11-20 Thread Diez B. Roggisch
Jorgen Bodde wrote: > Hi all, > > I want to provide my users the ability to download a repository from > the web, and after that check for updates. I thought of a mechanism > that could do that, but since there is patch and diff readily > available I wondered if there is a python solution that al

Re: VB6 frontend GUI with Python

2007-11-20 Thread Diez B. Roggisch
Claire Blair wrote: > I am trying to write a VB6 (not VB.Net) application that has a console > window that allows Python command to be typed at the prompt. > > The idea is so that, I can have full Python scripting from within my > application. I should be able to type commands from a Python scrip

Re: marked-up Python code

2007-11-20 Thread Diez B. Roggisch
Luc Goossens wrote: > Hi, > > I would like to experiment with marked-up Python source code. A more > elaborate explanation of the use-case is at the end of this mail. The > short story is that I would like to do things like assign colors to > pieces of text in my editor and have this information

Re: VB6 frontend GUI with Python

2007-11-20 Thread Diez B. Roggisch
> Simple. its because my main application (the GUI that is), is written in > VB6. I have a MDI application (i.e. many child windows in the same > application), and I want to use one of these windows as a console to > inteactively type Python commands. If I were to use wxPython, I would > not be ab

Re: Web update library in python?

2007-11-20 Thread Diez B. Roggisch
Jorgen Bodde wrote: > Hi A.T.Hofkamp, > > Using svn still requires the people wanting to offer updates to have a > svn server installed, or use one of the svn services available and > that is simply too limiting. > > I will explain a bit more where I will use this for. I am writing a > tool that

Re: Python web frameworks

2007-11-20 Thread Diez B. Roggisch
> 12/7. Django comes with its own little server so that you don't have > to set up Apache on your desktop to play with it. I was rather shocked to learn that django only has this tiny server and does not come with a stand-alone server and is supposed to run as mod_python/cgi-driven app through ap

Re: Web update library in python?

2007-11-20 Thread Diez B. Roggisch
Jorgen Bodde wrote: > Hi Paul, > > Like I said, I do not want to limit my end users into installing > something in Apache or some other solution in order to get my tool > working. On the end user side (which also are the people who are > creating the repositories for others) there must be no burd

RE: Writing Error in program

2007-11-20 Thread Looney, James B
There could be any number of issues in your code that could cause that problem. Can you post some of the code in question? > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > ] On Behalf Of [EMAIL PROTECTED] > Sent: Tuesday, November 20, 2007 2:03 PM > To: pyth

Re: mimicking a file in memory

2007-11-20 Thread Diez B. Roggisch
p. schrieb: > On Nov 20, 2:06 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: >> On 2007-11-20, Jarek Zgoda <[EMAIL PROTECTED]> wrote: >> Here is my dilemma: I don't want to copy the files into a local directory for mutagen's sake, only to have to remove them afterward. Instead, I'd lik

Re: Python strings question (vertical stack)

2007-11-20 Thread Diez B. Roggisch
dmitrey schrieb: > Thanks all, I have solved the problem: > > a=""" > %s > %s > %s > """ % ('asdf', 'asdf2', 'asdf3') > > print a This is more expensive and not as flexible as the join method. At least for growing string-lengths and number of arguments. Diez -- http://mail.python.org/mailman/

Re: logging module: removing handlers

2007-11-21 Thread Diez B. Roggisch
Michele Simionato schrieb: > I have just discovered a bug in my code using the logging module, due > to > handlers not being closed properly. The issue was that I called the > function > removeHandler and I assumed that it took care of closing the handler, > but it did not. > Looking at the source

Re: logging module: removing handlers

2007-11-21 Thread Diez B. Roggisch
Michele Simionato wrote: > On Nov 21, 10:23 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >> I can only guess - but I'd say if you can do >> >> foo.removeHandler(h) >> >> you can do >> >> foo.removeHandler(h) >> h.

Re: logging and propagation

2007-11-21 Thread Diez B. Roggisch
Paul Rudin wrote: > oj <[EMAIL PROTECTED]> writes: > >> On Nov 21, 11:48 am, Paul Rudin <[EMAIL PROTECTED]> wrote: > >>> Loggers have a "propagate" attribute. If you set this to False in the >>> child then you should get what you want I think. >> >> No, because I want message to propagate usuall

Re: how to change current working directory while using pdb within emacs

2007-11-21 Thread Diez B. Roggisch
duyanning wrote: > I have written a pyhton script that will process data file in current > working directory. > My script is in an different directory to data file. > When I debug this script using pdb within emacs, emacs will change the > current working directory to the directory which include t

RE: the annoying, verbose self

2007-11-21 Thread Looney, James B
There are always tricks. If 5 characters is really too much to type, how about 2 characters "s.". Though I would recommend against that since it violates standard Python convention. def foo( self ): becomes def foo( s ): Otherwise, if you happen to be using self.something a lot, just assign i

Re: eof

2007-11-22 Thread Diez B. Roggisch
braver schrieb: > On Nov 22, 5:32 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: >>> There's nothing special about Python except indentation, which >>> gets screwed up between editors all the time. (It's much >>> easier to flip- flop between TextMate and Emacs with Ruby than >>> with Python, without

Re: How to Teach Python "Variables"

2007-11-25 Thread Diez B. Roggisch
27;t C variables also bindings from names to objects ? Or what ? There are cruicial differences. In C, you have names pointing to physical memory locations - fixed locations, that is. Thus you can do e.g. some_struct a, b; a = b = some_struct_value; a.bar = 10; b.bar = 20; Now a.bar will be

Re: How to write Regular Expression for recursive matching?

2007-11-26 Thread Diez B. Roggisch
lisong wrote: > Hi All, > > I have problem to split a string like this: > > 'abc.defg.hij.klmnop' > > and I want to get all substrings with only one '.' in mid. so the > output I expect is : > > 'abc.defg', 'defg.hij', 'hij.klmnop' > > a simple regular expression '\w+.\w' will only return: >

Re: spawning a process with subprocess

2007-11-26 Thread Diez B. Roggisch
bhunter schrieb: > Hi, > > I've used subprocess with 2.4 several times to execute a process, wait > for it to finish, and then look at its output. Now I want to spawn > the process separately, later check to see if it's finished, and if it > is look at its output. I may want to send a signal at

Re: Should proxy objects lie about their class name?

2007-11-26 Thread Diez B. Roggisch
John J. Lee schrieb: > [EMAIL PROTECTED] (John J. Lee) writes: > >> Not much to add to the subject line. I mean something like this: >> >> ProxyClass.__name__ = ProxiedClass.__name__ >> >> >> I've been told that this is common practice. Is it? Would this >> surprise you if you ran into it in a

Re: spawning a process with subprocess

2007-11-26 Thread Diez B. Roggisch
bhunter schrieb: > On Nov 26, 1:50 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> bhunter schrieb: >> >> >> >>> Hi, >>> I've used subprocess with 2.4 several times to execute a process, wait >>> for it to finish, a

Re: A bug in Python's regular expression engine?

2007-11-27 Thread Diez B. Roggisch
Just Another Victim of the Ambient Morality wrote: > This won't compile for me: > > > regex = re.compile('(.*\\).*') > > > I get the error: > > > sre_constants.error: unbalanced parenthesis > > > I'm running Python 2.5 on WinXP. I've tried this expression with > another RE eng

Re: os.path.islink documentation error?

2007-11-27 Thread Diez B. Roggisch
Giampaolo Rodola' schrieb: > os.path.islink documentation says: > > "Return True if path refers to a directory entry that is a symbolic > link. Always False if symbolic links are not supported." > > It's not clear to me why it is mentioned the DIRECTORY term. > Shouldn't os.path.islink be used to

Re: Unsupported operator for Decimal: + (or -)

2007-11-27 Thread Diez B. Roggisch
y to add or subtract values--which should be > decimal.Decimal objects--we occasionally get an error about the > operator not being supported. It doesn't always happen and we can't > seem to reproduce it when we try to. Try putting an try/except clause around the problem that d

Re: Pulling data from a .asps site

2007-11-27 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > There's a government website which shows public data for banks. We'd > like to pull the data down programmatically but the data is "hidden" > behind .aspx... > > Is there anyway in Python to hook in directly to a browser (firefox or > IE) to do the following... > > 1)

Re: Passing arguments to subclasses of unittest.TestCase

2007-11-27 Thread Diez B. Roggisch
Tom Harris schrieb: > Hi, > > Is there a way to pass arguments to TestCases when running tests? I have > a test suite that need to be configured slightly differently for 3 > different products, and rather than do a hack I wondered if there was a > canonical way to do it. > > I _know_ that py.t

Re: How to debug Python program with GUI (Tkinter)?

2007-11-28 Thread Diez B. Roggisch
Davy wrote: > Hi all, > > How to debug Python program with GUI, especially Tkinter? My debug > environment is PythonWin. > > For example, when I single step in the program, the step will go to > mainloop() and always loop there. How can I know where the program is > processed? You can't - the m

Re: Tip of the day generator.

2007-11-28 Thread Diez B. Roggisch
Joseph king wrote: > Hey i was wondering if any one would know if there was a way to have > python randomly read form a file or would you ahve to know the byte > postion and somehow randomize splicing the file so the sentence you > want show's up. > > i.e have a file with a lot of tips and useles

Optimized Python bytecode

2007-11-28 Thread Looney, James B
I'm using SCons to build all kinds of things, and part of our build process involves creating a "release" version of our software. In the case of Python, that means compiling the .py into a .pyc or .pyo. Because I'm placing the compiled script into a different location from the .py, I have to figu

Re: Listing subtypes

2007-11-28 Thread Diez B. Roggisch
anything.) Not right. These special children are under a more demanding goverment. class A(object): pass class B(A): pass print A.__subclasses__() http://www.mail-archive.com/[email protected]/msg67979.html Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Bundling Python on Mac

2007-11-29 Thread Diez B. Roggisch
Benjamin schrieb: > Hello, I'm writing a Python/PyQt application. For my Mac distribution. > I would like to include all the needed libraries in the Mac bundle. > How should I go about doing this? The py2app distutils extension should do that for you. It works flawless for PyObjc-apps for me - it

Re: How do I not make a list?

2007-11-29 Thread Diez B. Roggisch
Just Another Victim of the Ambient Morality schrieb: > It may sound like a strange question but that's probably only because I > don't know the proper terminology. I have an iterable object, like a list, > and I want to perform a transform on it (do an operation on each of the > elements) a

Re: Tkinter, wxPython, PyGtk, or PyQt...

2007-11-29 Thread Diez B. Roggisch
gsal schrieb: > is PyQt related to Qt? I presume so. > > is Qt needed for PyQt? Sure. > is PyQt usable in all platforms Python is available and is it GPLed, > too? Yes. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: setters and getters in python 2.6 and 3.0

2007-11-29 Thread Diez B. Roggisch
Daniel Fetchinson schrieb: > Hi list, I've been following a discussion on a new way of defining > getters and setters on python-dev and just can't understand what the > purpose is. Everybody agreed on the dev list that this is a good idea > so I guess it must be right :) > > The whole thing starte

Re: Bundling Python on Mac

2007-11-30 Thread Diez B. Roggisch
Benjamin schrieb: > On Nov 29, 2:34 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> Benjamin schrieb: >> >>> Hello, I'm writing a Python/PyQt application. For my Mac distribution. >>> I would like to include all the needed libraries i

Re: Can't Find Headers on OSX

2007-11-30 Thread Diez B. Roggisch
Calvin Spealman schrieb: > I'm still on 10.4 and I'm trying to build pyOpenSSL, but I'm failing > with Python.h trying to include and failing to find any of the shared > libraries. I can't figure this one out because i just don't compile > anything non trivial often. > > ironfroggy:~/Desktop/pyOpe

Re: Unicode string formating

2007-11-30 Thread Diez B. Roggisch
nico schrieb: > Hi, > I need to do a lot of string formating, and I have strings and/or > unicode strings and when I do the following: > "%s %s" % (u'Salut', 'H\xe4llo'), I get an exception : > UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position > 1: ordinal not in range(128) > >

Re: C++2py

2007-12-02 Thread Diez B. Roggisch
farsheed schrieb: > I,m looking for a tool for converting c++ to python. Any Ideas? Python to C++ - that's shedskin. But the other way round, you don't stand a chance. The semantics of C++ are so rich - even _if_ somebody would try and create a C++2python-converter, the result would be less th

Re: Thread

2007-12-03 Thread Diez B. Roggisch
Gianmaria Iaculo - NVENTA wrote: > > Hi all, > i'm using python 1.5.2. > > Is it possible to use the Thread module? I need it for the Timer library. According to http://www.python.org/doc/1.5.2/lib/lib.html it's there. Why don't you just import it and try? Would have cost less time than posting

Re: python 2.5 - f=open('a_file.txt','w') gives [Errno 2]

2007-12-03 Thread Diez B. Roggisch
dirkheld wrote: > Hi, > > I upgraded my system from tiger to leopard. With leopard came a new > version of python 2.5 > > Now I trying to run some python code that previously worked on tiger > (which included an older version of python). > > This is the error I'm receiving : > > Traceback (mos

Re: python 2.5 - f=open('a_file.txt','w') gives [Errno 2]

2007-12-03 Thread Diez B. Roggisch
dirkheld wrote: > On 3 dec, 14:54, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> dirkheld wrote: >> > Hi, >> >> > I upgraded my system from tiger to leopard. With leopard came a new >> > version of python 2.5 >> >>

Re: "Python" is not a good name, should rename to "Athon"

2007-12-03 Thread Diez B. Roggisch
Russ P. schrieb: > On Dec 3, 1:58 pm, "Dan Upton" <[EMAIL PROTECTED]> wrote: > >> ...and thus, maybe the joke is on you? Just to play devil's advocate... > > Yes, the joke *is* on me -- every time I have to explain to someone > why I am using this funny-sounding language. That's the point. Yeah

Re: Problems with import

2007-12-04 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi, > > I have some problems when importing a library. Suppose I have a > directory /home/user/pythonlib/package in which I have a python- > library called test.py. Now I want to import that, so I put the > following directory into the PYTHONPATH: /home/user/pythonlib a

Re: reloading modules and isinstance()

2007-12-04 Thread Diez B. Roggisch
Tlis wrote: > I am using a software system with an embedded Python interpreter > (version 2.3) for scripting. The KcsPoint2D.py module contains a > Point2D class with the following method: > > def SetFromMidpoint(self, p1, p2): >if not isinstance(p1, Point2D) or not isinstance(p2, Point2D): >

Re: Escaping the semicolon?

2007-12-04 Thread Diez B. Roggisch
Nick wrote: > Hi all, > > Is this expected behavior? > s = '123;abc' s.replace(';', '\;') > '123\\;abc' > > I just wanted a single backslash. I can see why this probably happens > but i wondered if it is definitely intentional. There is only a single backslash. But the interactive pr

Re: using pdb and catching exception

2007-12-04 Thread Diez B. Roggisch
Amit Gupta schrieb: > On Dec 3, 11:10 am, Amit Gupta <[EMAIL PROTECTED]> wrote: >> >> Thanks Frank. But again, this results into stack-track when the >> exception is caught. On the other hand, I would like the debug-trace >> just before throwing the exception. As a case, I might be debugging >> cod

Re: reloading modules and isinstance()

2007-12-05 Thread Diez B. Roggisch
Steven D'Aprano wrote: > On Tue, 04 Dec 2007 15:41:48 +0100, Diez B. Roggisch wrote: > >> You just discovered one reason why reload() is a bad idea and IMHO >> shouldn't be used at all - as tempting it might be. > > > I disagree -- I find reload() extre

Re: An Object's Type

2007-12-05 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi, > > Is it possible to find out if an object is of a certain type or of a > type derived from this type? http://docs.python.org/lib/built-in-funcs.html Look for isinstance. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: reloading modules and isinstance()

2007-12-06 Thread Diez B. Roggisch
Tlis schrieb: > On 5 Dec, 13:18, Steven D'Aprano <[EMAIL PROTECTED] > cybersource.com.au> wrote: >> On Tue, 04 Dec 2007 15:41:48 +0100, Diez B. Roggisch wrote: >>> You just discovered one reason why reload() is a bad idea and IMHO >>> shouldn't

Re: reloading modules and isinstance()

2007-12-06 Thread Diez B. Roggisch
Jean-Paul Calderone schrieb: > On Thu, 06 Dec 2007 12:21:01 +0100, "Diez B. Roggisch" > <[EMAIL PROTECTED]> wrote: >> Tlis schrieb: >>> On 5 Dec, 13:18, Steven D'Aprano <[EMAIL PROTECTED] >>> cybersource.com.au> wrote: >>>>

Re: An Object's Type

2007-12-06 Thread Diez B. Roggisch
paul schrieb: > Bruno Desthuilliers schrieb: >> [EMAIL PROTECTED] a écrit : >>> Hi, >>> >>> Is it possible to find out if an object is of a certain type or of a >>> type derived from this type? >>> >> You have the answer, thanks to Diez and Christian. Now unless you have >> a *very* compelling rea

Re: pipeline encoding

2007-12-06 Thread Diez B. Roggisch
Tomasz Toczyski schrieb: > My locale is set to UTF-8. The command: > python -c "print u'\u03A9'" > gives me the desired result and doesn't produce any error. > > But when I want to redirect the output to a file I invoke: > python -c "print u'\u03A9'" > file.txt > I get an error: > > File "", line

Re: pipeline encoding

2007-12-06 Thread Diez B. Roggisch
Tomek Toczyski schrieb: > Diez B. Roggisch: > >> >> Python tries and guesses the stdout-encoding based on the terminal >> settings. So the first print works. >> >> However, piping to a file means that it can't do so, because it >> doesn'

Re: __iadd__ useless in sub-classed int

2007-12-06 Thread Diez B. Roggisch
samwyse schrieb: > For whatever reason, I need an inproved integer. Sounds easy, let's > just subclass int: > class test(int): > pass > > Now let's test it: > zed=test(0) zed.__class__ > zed > 0 > > So far, so good. Now let's try incrementing: > zed+=1 ze

Re: Newbie edit/compile/run cycle question

2007-12-09 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Thanks for all the help. Thought I'd spend my newbie days right in the > Python shell (there's lots to test when you're just starting) but I > guess that's not going to happen. > > Everyone told me to get out of the Python shell, one way or another. > OK. But this mean

Re: Is a "real" C-Python possible?

2007-12-09 Thread Diez B. Roggisch
Jack schrieb: > I understand that the standard Python distribution is considered > the C-Python. Howerver, the current C-Python is really a combination > of C and Python implementation. There are about 2000 Python files > included in the Windows version of Python distribution. I'm not sure > how mu

Re: GUI development with 3D view

2007-12-10 Thread Diez B. Roggisch
Achim Domma wrote: > Hi, > > I'm looking for quite some time now for a gui library for python, > which allows me to display 3D graphics. Main OS is windows, Mac OS X > and Linux would be nice to have. I want to use python 2.5. My first > try was wx + pyOpenGL but there are no working binaries for

Re: GUI development with 3D view

2007-12-10 Thread Diez B. Roggisch
Achim Domma wrote: > On 10 Dez., 15:24, "Méta-MCI \(MVP\)" > <[EMAIL PROTECTED]> wrote: >> Hi! >> >> > no idea how it works with windows. >> >> On XP: fine. >> On Vista: very difficult... >> >> @+ >> >> MCI > > Also with Python 2.5? If PyOpenGL would work with Python 2.5, I could > use wx too. B

Re: Newbie edit/compile/run cycle question

2007-12-10 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Bruno, > > Please explain why the NOP import is a GoodThing. Use small words > please. I'm not as young as I used to be. Because otherwise every import would result in overhead without any benefit. Think of a module like this: A_GLOBAL_VARIABLE = extremely_

Re: "do" as a keyword

2007-12-11 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > First off let me state that I really enjoy using Python. I am a 3rd > year student and have been using python for 3 months, (thanks to > trac!). I do not consider myself an experienced or clever programmer, > but I am able to get by. > > Something I love about Python is

Re: need the unsigned value from dl.call()

2007-12-11 Thread Diez B. Roggisch
Larry Bates wrote: > eliss wrote: >> I'm using dl.call() to call a C function in an external library. It's >> working great so far except for one function, which returns an >> unsigned int in the C version. However, in python it returns a signed >> value to me. How can I get the unsigned value fro

Re: problem parsing lines in a file

2007-12-11 Thread Diez B. Roggisch
barronmo wrote: > I'm having difficulty getting the following code to work. All I want > to do is remove the '0:00:00' from the end of each line. Here is part > of the original file: > > 3,3,"Dyspepsia NOS",9/12/2003 0:00:00 > 4,3,"OA of lower leg",9/12/2003 0:00:00 > 5,4,"Cholera NOS",9/12/200

Re: Matching XML Tag Contents with Regex

2007-12-11 Thread Diez B. Roggisch
Chris wrote: > On Dec 11, 11:41 am, garage <[EMAIL PROTECTED]> wrote: >> > Is what I'm trying to do possible with Python's Regex library? Is >> > there an error in my Regex? >> >> Search for '*?' onhttp://docs.python.org/lib/re-syntax.html. >> >> To get around the greedy single match, you can add

Re: Is a "real" C-Python possible?

2007-12-11 Thread Diez B. Roggisch
John Nagle schrieb: > sturlamolden wrote: >> On 10 Des, 23:49, [EMAIL PROTECTED] (Aahz) wrote: >> >>> "Premature optimization is the root of all evil in programming." >>> --C.A.R. Hoare (often misattributed to Knuth, who was himself quoting >>> Hoare) > >We're ten years into Python, and it's s

Building Python2.4.1 with idle on HPUX11

2007-12-11 Thread Looney, James B
I've been trying to build Python 2.4.1 on an HPUX11. Python builds ok, but idle has issues. And what I don't know is how to determine whether or not Python discovers the tcl/tk libraries (.sl) and headers, or if there's some other problem. If someone has thoughts on either how to invoke 'configu

Re: Matching XML Tag Contents with Regex

2007-12-11 Thread Diez B. Roggisch
> I was hoping a simple pattern like .*text.* wouldn't be too > complicated for Regex, but now I'm starting to agree with you. Parsing > the entire XML Dom would probably be a lot easier. That's one of the common problems with rexes and XML/HTML. They start out fast and easy, but at some point t

Re: determining bytes read from a file.

2007-12-13 Thread Diez B. Roggisch
vineeth wrote: > Hello all, >I have come across a weird problem, I need to determine the amount > of bytes read from a file, but couldn't figure it out , >My program does this : > __ >file = open("somefile") >data = file.read() >print "bytes read ", len(data) > --- > > But t

Re: how to include a tiny debug feature in my project ?

2007-12-13 Thread Diez B. Roggisch
Stef Mientki wrote: > hello, > > I've large program based, with a GUI based on wxPython, > where the user can add small parts, which I call Bricks. > A new Brick is created by inheriting from the standard-Brick. > The user should only override 1 or 2 functions from the standard-Brick. > The main

Re: reloading modules and isinstance()

2007-12-14 Thread Diez B. Roggisch
Tlis schrieb: > Hi, > > I have found that it is possible to reassign the instance.__class__ > reference to the same class (but after reloading) to make the > isinstance() test work again! I know that it is a kind of hacking of > the Python interpreter, but it works :-) It's not especially "hackin

Re: programming container object

2007-12-17 Thread Diez B. Roggisch
Steven D'Aprano wrote: > On Mon, 17 Dec 2007 18:18:11 +1100, bambam wrote: > >> I wish to create a generic container object, devlist, such that >> >> devlist.method(arguments) >> >> runs as >> >> for each dev in devlist.pool: >> dev.method(arguments) >> >> and >> s = devli

Re: Deleting lines from a file

2007-12-17 Thread Diez B. Roggisch
Horacius ReX wrote: > Hi, > > I need to write a program which reads an external text file. Each time > it reads, then it needs to delete some lines, for instance from second > line to 55th line. The file is really big, so what do you think is the > fastest method to delete specific lines in a tex

Re: Deleting lines from a file

2007-12-17 Thread Diez B. Roggisch
Horacius ReX wrote: > and regardless of the speed, what do you think would be the best > method to do this ? Without more information about the contents of the file and who's reading them, we can't say more. if the reader is not under your control & doesn't deal with deletion-marks or anything s

Debugging pipe IPC

2007-12-17 Thread Jim B. Wilson
I have the mother (of all) application(s, written in C++) that occasionally outsources certain tasks to a child Python script. The mother fork/execs (or equivalent) the child and then begins serving the child's requests. The child/client sends requests on its stdout and receives responses on

Re: Debugging pipe IPC

2007-12-17 Thread Jim B. Wilson
Ian Clark pointed me to: > ... the cmd module. > Yes, I found that, but I could only get it to print a nice interactive prompt, "(Cmd)", read a line of input and discard it. Apparently, I'm too stupid to figure out how to hook it into python. Jim

Re: Another newbie design question

2007-12-17 Thread Jim B. Wilson
[EMAIL PROTECTED] wrote: > If you can only [block comments] or [multi-line strings] the other, > which is more helpful? I'm afraid no one would use a language that didn't feature block comments. However, inspection of a vast corpus of code might lead one to believe that any commenting capabili

Re: Debugging pipe IPC

2007-12-17 Thread Jim B. Wilson
Ian Clark wrote: > Jim B. Wilson wrote: > ... >> The child/client sends requests on its stdout and receives responses >> on stdin. > > So, why can't you just run this client on the command line and let the > shell handle stdin/stdout for you? I'm not s

Re: Debugging pipe IPC

2007-12-18 Thread Jim B. Wilson
Ian Clark wrote: > ... whatever 'mother' was sending it ("Clean your room!" most like) :) > If it's very verbose ... Alas, it is quite verbose. Constructing a single instance of a class (from the Pyrex extension acting as the child's two-way radio) could involve tens of thousands of more-or-le

Re: Newbie observations

2007-12-19 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: >> My 2 cents. > > Eurozone? That would be 3 cents US. > > I meant colon, not semi-colon. I did the tutorial. I did objects 3 > times. > > In Java, the agreed convention is to use lowerAndUpper naming for > member variables. (See > http://www.MartinRinehart.com/article

Re: Static linking of python and pyqt

2007-12-19 Thread Diez B. Roggisch
Markus Dahlbokum wrote: >> > I just want the qt libs linked to the interpreter without accessing >> > them by a module. I tried the configure option '--with-libs='lib ...''. >> > The make did fine but the executable is too small and the qt symbols >> > are not known by it. How can I just link qt s

Re: In an inherited class, "embedded" classes is referenced?

2007-12-19 Thread Diez B. Roggisch
Christian Joergensen schrieb: > Hello > > I stumpled upon this "feature" during my work tonight, and found it > a bit confusing: > >>>> class A(object): > ... class C: > ... foobar = 42 > ... >>>> class B(A): p

Re: Debugging pipe IPC

2007-12-20 Thread Jim B. Wilson
Ian Clark wrote: > import os > os.system("netcat -l -p 1234 localhost") > > HTH, Nope, but the network theme got me thinking about how one might run Python on a remote host. After a few false starts, Googling "remote python shell" led me to Guido's "ripshell.py" (not *that* Guido, a diffe

Re: Detecting memory leaks on apache, mod_python

2007-12-21 Thread Diez B. Roggisch
>> So, anyone who hit's on this thread via a search will think >> >> a) that there's really no memory leak detection for python >> b) that this community is not very helpful c) That finally people in this forum are smart enough to detect your flamebai

Re: Releasing malloc'd memory using ctypes?

2007-12-24 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > I am starting to experiment with ctypes. I have a function which returns a > pointer to a struct allocated in heap memory. There is a corresponding free > function for that sort of struct, e.g.: > > from ctypes import * > > cdll.LoadLibrary("libthing.so") >

Re: convert pdf to png

2007-12-25 Thread Diez B. Roggisch
Carl K schrieb: > Grant Edwards wrote: >> On 2007-12-24, Carl K <[EMAIL PROTECTED]> wrote: >> If it is a multi page pdf Imagemagick will do: convert file.pdf page-%03d.png >>> I need python code to do this. It is going to be run on a >>> someone else's shared host web server, securi

Re: convert pdf to png

2007-12-26 Thread Diez B. Roggisch
Carl K schrieb: > Diez B. Roggisch wrote: >> Carl K schrieb: >>> Grant Edwards wrote: >>>> On 2007-12-24, Carl K <[EMAIL PROTECTED]> wrote: >>>> >>>>>> If it is a multi page pdf Imagemagick will do: >>>>>> >&g

Re: freakin out over C++ module in python

2006-04-18 Thread Diez B. Roggisch
> and so, i guess the main question i have is is there a module or > program that will parse these classes and duplicate them for a python > module ? Some kind of code translator ? Or is that just way out there? No, there isn't. > i would go thru it line by line, but i just dont know enough a

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