Re: "pickle" vs. f.write()

2005-02-02 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Martin Miller wrote: > I've found extending this property to your own classes often fairly easy > to implement (and useful). For example: > >> class person: >> def __init__(self, name="", age=0, friends=None, comment=""): >> if friends is None: >> f

Re: test_socket.py failure

2005-02-02 Thread Marc Christiansen
[EMAIL PROTECTED] wrote: > Nick Coghlan <[EMAIL PROTECTED]> wrote: >> Hmm, when the second argument is omitted, the system call looks like: >> >> getservbyname("daytime", NULL); >> >> Based on "man getservbyname" on my Linux PC, that should give >> the behaviour we >> want - any protocol will ma

continuous plotting with Tkinter

2005-02-02 Thread Martin Blume
I have a number-crunching application that spits out a lot of numbers. Now I'd like to pipe this into a python app and plot them using Tkinter, such as: $ number_cruncher | myplot.py But with Tkinter once I call Tkinter's mainloop() I give up my control of the app and I can't continue to read in

Re: how to write a tutorial

2005-02-02 Thread A.M. Kuchling
On Wed, 2 Feb 2005 12:22:24 -0500, Dan Perl <[EMAIL PROTECTED]> quoted: > "Xah Lee" <[EMAIL PROTECTED]> wrote in message >> I suggest it be dropped in both places. The mentioning of this book in >> the Perl/Python community is mostly a fawning behavior and confession >> that the author is

Re: Suggesion for an undergrad final year project in Python

2005-02-02 Thread Alan Kennedy
[Sridhar] I am doing my undergrade CS course. I am in the final year, and would like to do my project involving Python. Our instructors require the project to have novel ideas. Can the c.l.p people shed light on this topic? PyPy is chock full of novel ideas, given that two of the main developers

Re: Python Code Auditing Tool

2005-02-02 Thread Peter Hansen
Roy Smith wrote: Skip Montanaro wrote: 246 ValueError 227 aetools.Error 216 Error 124 TypeError 101 error 75 RuntimeError 53 IOError 36 NotImplementedError 36 ImportError 36 EOFError 31 SyntaxError 23 KeyError 23 AttributeError 22 DistutilsPlatform

Re: new style exception handleing

2005-02-02 Thread Peter Hansen
Ola Natvig wrote: Does anybody know why it's not possible to raise Exceptions which are types (new-style-classes). I know all standard exceptions are classic classes, but if you make a custom exception which both inherits from a exception class and a new-style one the it causes a type error when

Re: Awkwardness of C API for making tuples

2005-02-02 Thread Fredrik Lundh
Dave Opstad wrote: > This would certainly be simpler, although I'm not sure I'm as clear as > to what happens if, say, in the middle of this loop a PyInt_FromLong > fails. I know that PyTuple_SetItem steals the reference; does that mean > I could just Py_DECREF the tuple and all the pieces will be

Inflex scan report [020220054666]

2005-02-02 Thread victor
Administrator Email Reply Address: victor Email sent to: [EMAIL PROTECTED] Inflex ID: 020220054666 Report Details --- AntiVirus Results... 00:03 _headers_ 00:03 text.zip 00:03 Text.bat >>> Virus 'W32/MyDoom-O' found in file >>> /usr/local/inflex/tmp/in

Re: Hash of class from instance

2005-02-02 Thread Mick Krippendorf
Joakim Storck wrote: > [...] the hash values of classes will be used as > keys in a dictionary that serve as an object pool. [...] That does seem unwise (as Teal'c would have uttered). The spec says: hash( object) Return the hash value of the object (if it has one). Hash values are in

Re: Reference count question

2005-02-02 Thread Fredrik Lundh
"cedric paille" wrote: > I'm making python's modules to extend my application's functions with a built > in script editor. > At now all works very well, but i'd like to know if i'm not forgetting some > references inc/dec > > Here is a portion of my code: > > static PyObject * > Scene_GetNod

XML with Unicode: what am I doing wrong?

2005-02-02 Thread Kevin Dangoor
This is a followup to a blog post I wrote the other day http://www.blueskyonmars.com/archives/2005/01/31/using_unicode_with_elementtidy.html I started out working in the context of elementtidy, but now I am running into trouble in general Python-XML areas, so I thought I'd toss the question out h

Two classes problem

2005-02-02 Thread Gurpreet Sachdeva
I have two classes; a.py --> #!/usr/bin/python global test test ='' class a(b): def __init__(self,test): print test print 'Outside: '+test b.py --> #!/usr/bin/python import a a.a('Garry') I want to pass this string (or any object later) to a.py and that too outside the

Re: Remove HTML tags (except anchor tag) from a string using regular expressions

2005-02-02 Thread Gabriel Cooper
Max M wrote: If it's not to learn, and you simply want it to work, try out this library: http://zope.org/Members/chrisw/StripOGram/readme >>> stripogram.html2safehtml('''first > last''',valid_tags=('i','a','br')) 'first > last' >>> stripogram.html2safehtml('''first < last''',valid_tags=('i','a',

Re: hotspot profiler experience and accuracy?

2005-02-02 Thread Irmen de Jong
aurora wrote: But the numbers look skeptical. Hotspot claim 71.166 CPU seconds but the actual elapsed time is only 54s. When measuring elapsed time instead of CPU time the performance gain is only 13% with the profiler running and down to 10% when not using the profiler. Is there something I

Re: Python Code Auditing Tool

2005-02-02 Thread Skip Montanaro
>> 246 ValueError >> 227 aetools.Error >> 216 Error >> 124 TypeError >> 101 error >> 75 RuntimeError >> 53 IOError >> 36 NotImplementedError >> 36 ImportError >> 36 EOFError >> 31 SyntaxError >> 23 KeyError >> 23 AttributeError >> 22 Distutil

Re: Python for S60 mentioned in a mainstream Finnish e-news website

2005-02-02 Thread Irmen de Jong
Ville Vainio wrote: "Thomas" == Thomas Heller <[EMAIL PROTECTED]> writes: >> (Yeah, ctypes will probably be a problem because of the way Symbian >> handles DLLs) Thomas> How *does* symbian handle DLLs? By ordinal, so the dll does not include the symbol name (in order to keep the size s

Re: XML with Unicode: what am I doing wrong?

2005-02-02 Thread Diez B. Roggisch
> I started out working in the context of elementtidy, but now I am > running into trouble in general Python-XML areas, so I thought I'd toss > the question out here. The code below is fairly self-explanatory. I have > a small HTML snippet that is UTF-8 encoded and is not 7-bit ASCII > compatible.

Re: Python for S60 mentioned in a mainstream Finnish e-news website

2005-02-02 Thread Diez B. Roggisch
> > Heh, this somehow reminds me about the way shared libraries were > implemented on the Amiga. > No linking step; the function entry points were essentially a > big jump table in the library structure with every function having > a unique offset from the library's base. > Proved to make it very

Re: XML with Unicode: what am I doing wrong?

2005-02-02 Thread Just
In article <[EMAIL PROTECTED]>, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > I started out working in the context of elementtidy, but now I am > > running into trouble in general Python-XML areas, so I thought I'd toss > > the question out here. The code below is fairly self-explanatory. I h

Re: Two classes problem

2005-02-02 Thread [EMAIL PROTECTED]
If you create a.py like -test = 'Spam' - -class a: -def __init__(self, arg): -global test -test = arg -self.result = arg + ' added' -def __call__(self): -return self.result and b.py like -import a -a.test = 'donkey' -x = a.a('dinosaur') -print a.test It will

ANN: MayaVi-1.4 released

2005-02-02 Thread Prabhu Ramachandran
Hi, This is to announce the availability of the (long overdue) MayaVi Data Visualizer version 1.4. MayaVi is a free, easy to use, scientific data visualizer. It is written in Python, uses the Visualization Toolkit (VTK) for the graphics and provides a GUI written using Tkinter. MayaVi is distri

Finding user's home dir

2005-02-02 Thread Nemesis
Hi all, I'm trying to write a multiplatform function that tries to return the actual user home directory. I saw that os.path.expanduser("~") works on Linux but on Windows2000 (at least on the win I used) it returns %USERPROFILE%, so I tried os.environ["HOME"] and it gave me the same results. So I e

Re: Hash of class from instance

2005-02-02 Thread Steven Bethard
Mick Krippendorf wrote: In Python there seems to be no guarantee that different objects also have different hash values. Well, it's true that you can override the __hash__ method to do whatever you want, but I believe the default for class __hash__ methods is to return the class id, which should

Re: Advice on OSX cocoa app with Python backend

2005-02-02 Thread Alan Gauld
On Tue, 01 Feb 2005 12:12:15 -0500, Socheat Sou <[EMAIL PROTECTED]> wrote: > the RDBMS, but some have suggested looking into OODBMS, like PostgreSQL, > but from what I know of OODBMS they don't seem like the right fit for > this project. Calling PostGres an OODBMS might be stretching it a wee bit,

Re: Finding user's home dir

2005-02-02 Thread Mark Nenadov
On Wed, 02 Feb 2005 19:26:00 +, Nemesis wrote: > Please, could you test it on your systems and tell me what you got? > I'd like to know what it returns on different operating systems because > I'm developing a multiplatform software. > > Thank you all. I tried your function in my environment

Re: Hash of class from instance

2005-02-02 Thread Joakim Storck
So I guess it might be a little bit less unwise to use id() instead then... /Joakim -- http://mail.python.org/mailman/listinfo/python-list

Re: Hash of class from instance

2005-02-02 Thread Just
In article <[EMAIL PROTECTED]>, "Joakim Storck" <[EMAIL PROTECTED]> wrote: > So I guess it might be a little bit less unwise to use id() instead > then... Why don't you use the class objects themselves as dict keys? Just -- http://mail.python.org/mailman/listinfo/python-list

Integrated Testing - Peppable?

2005-02-02 Thread [EMAIL PROTECTED]
Hi, Please excuse the intrusion from an admirer, but not a user, of Python. I've got an idea that I think could improve the language and might be relatively simple to implement. I've developed a prototype with a toy language here: , with screenshot here:

Re: hotspot profiler experience and accuracy?

2005-02-02 Thread aurora
Thanks for pointing me to your analysis. Now I know it wasn't me doing something wrong. hotspot did lead me to knock down a major performance bottleneck one time. I found that zipfile.ZipFile() basically read the entire zip file in instantiation time, even though you may only need one file f

Re: Two classes problem

2005-02-02 Thread Caleb Hattingh
Hi It would help if you could describe the purpose you have in mind for doing this. There is a cute way of doing what you want: ===file: a.py=== # module a.py test = 'first' class aclass: def __init__(self, mod, value): mod.test = value# Is there another way to refe

Re: Finding user's home dir

2005-02-02 Thread [EMAIL PROTECTED]
on win xp home, python 2.4 its also correct for me -- http://mail.python.org/mailman/listinfo/python-list

Re: Hash of class from instance

2005-02-02 Thread Joakim Storck
Simply because it didn't occur to me. So now I have >>> class A: pass ... >>> d = {A:[A(),A(),A()]} >>> a = d[A].pop() >>> a <__main__.A instance at 0x00F09A58> >>> Thanks all! /Joakim -- http://mail.python.org/mailman/listinfo/python-list

Re: CONTEST - What is the (best) solution?

2005-02-02 Thread Steven Bethard
[EMAIL PROTECTED] wrote: In a file there can be several dictionaries like this {Key11: Value11 Key12: Value12 Key13: Value13, ... ... Key1n:Value1n} {Key21: Value21 Key22: Value22 Key23: Value23, ... ... Key2n:Value2n} {Key31: Value31 Key32: Value32 Key33: Value33, ... ... Key3n:Value3n}

Re: python and visual C++

2005-02-02 Thread Caleb Hattingh
Olivier If you consider using the ctypes module, you can write a dll (windows) or a shared object (linux) using anything that can make one of those. For example, I have successfully used FreePascal to make a dynamic library on both windows and linux and use that library within python on both

Re: Printing Filenames with non-Ascii-Characters

2005-02-02 Thread vincent wehren
Marian Aldenhövel wrote: But wouldn't that be correct in my case? This is what I get inside Eclipse using pydev when I run: import os dirname = "c:/test" print dirname for fname in os.listdir(dirname): print fname if os.path.isfile(fname): print fname : c:/test straßenschild.png te

Re: Two classes problem

2005-02-02 Thread Steven Bethard
Caleb Hattingh wrote: ===file: a.py=== # module a.py test = 'first' class aclass: def __init__(self, mod, value): mod.test = value# Is there another way to refer to the module this class sits in? ===end: a.py=== You can usually import the current module with: __import_

forms, xslt and python

2005-02-02 Thread øystein
Hi! I got an xml file that goes like this. Answer 1 Answer 2 Answer 3 Answer 4 I've made an xslt transformation and put the alternatives into radio buttons (html form) so the user can choose the correct answer by I am able to list all the questions and the id's via via python and return them

Where is WSAEnumNetworkEvents???

2005-02-02 Thread elbertlev
I was trying to write an asyncronous TCP server for win32 using WSAEventSelect (which lives if win32file). Such events require WaitForMultipleObjects (which lives if win32event) and WSAEnumNetworkEvents WHICH IS NOT EXPOSED. This makes WSAEventSelect useless. Does somebody know how to add the WSAEn

Generating modul classes with eval

2005-02-02 Thread Axel Straschil
Hello! I was fooling around with creating classes for a module with eval, something like: MyModule.py: class Base: init(self, name): self._name = name for myclass in ['A', 'B', 'C']: code="class %s(Base):\n\tinit(self, name='%s')\n\t\tsuper(%s, self).__in

Re: Finding user's home dir

2005-02-02 Thread Timothy Grant
On Wed, 02 Feb 2005 11:30:34 -0800 (PST), Nemesis <[EMAIL PROTECTED]> wrote: > Hi all, I'm trying to write a multiplatform function that tries to > return the actual user home directory. I saw that > os.path.expanduser("~") works on Linux but on Windows2000 (at least on > the win I used) it returns

Compilation problems for Python 2.4 on SGI machines

2005-02-02 Thread Dan Smyth
Hey,   I'm trying to compile python 2.4 on an SGI machine running IRIX 6.5.  The configure program shot back this error and told me to post it to the Python lists.  Anyone know what's going on?   configure: WARNING: stropts.h: present but cannot be compiledconfigure: WARNING: stropts.h: c

REMINDER: Python proposals due February 13th for OSCON / Python 13

2005-02-02 Thread Kevin Altis
Please submit your tutorial and session proposals for the Python track by February 13th. The information and relevant URLs are below. ka --- The Call for Proposals has just opened for the 7th Annual O'Reilly Open Source Convention http://conferences.oreillynet.com/os2005/ OSCON is headed back

Re: Crude statistics on the standard library

2005-02-02 Thread Fredrik Lundh
F. Petitjean wrote: > sre_compile and sre_parse should be coded with a __all__ attribute they're implementation modules, and shouldn't be used by user code. -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding user's home dir

2005-02-02 Thread Steve Holden
Nemesis wrote: Hi all, I'm trying to write a multiplatform function that tries to return the actual user home directory. I saw that os.path.expanduser("~") works on Linux but on Windows2000 (at least on the win I used) it returns %USERPROFILE%, so I tried os.environ["HOME"] and it gave me the same

Re: Generating modul classes with eval

2005-02-02 Thread Steve Holden
Axel Straschil wrote: Hello! I was fooling around with creating classes for a module with eval, something like: MyModule.py: class Base: init(self, name): self._name = name for myclass in ['A', 'B', 'C']: code="class %s(Base):\n\tinit(self, name='%s')\n\t\tsuper(%s,

Re: Generating modul classes with eval

2005-02-02 Thread Jeremy Bowers
On Wed, 02 Feb 2005 20:49:07 +, Axel Straschil wrote: You are doing several things wrong. > I was fooling around with creating classes for a module with eval, You shouldn't create classes with eval, because you don't need to. "class" isn't a declaration, it is an executable statement that c

python-dev Summary for 2004-12-16 through 2004-12-31

2005-02-02 Thread Brett C.
This is a summary of traffic on the `python-dev mailing list`_ from December 16, 2004 through December 31, 2004. It is intended to inform the wider Python community of on-going developments on the list. To comment on anything mentioned here, just post to `comp.lang.python`_ (or email python-l

Basic file operation questions

2005-02-02 Thread alex
Hi, I am a beginner with python and here is my first question: How can I read the contents of a file using a loop or something? I open the file with file=open(filename, 'r') and what to do then? Can I use something like for xxx in file: Thanks for help Alex -- http://mail.python.org/m

Re: Integrated Testing - Peppable?

2005-02-02 Thread Jeremy Bowers
On Wed, 02 Feb 2005 11:52:29 -0800, [EMAIL PROTECTED] wrote: > So... Should I turn this into a PEP? I would think a much more productive step one would be to put together the proposed functionality with unittest and the trace module, and use the output of your tool to drive some sort of simple ou

Re: Generating modul classes with eval

2005-02-02 Thread Jeremy Bowers
On Wed, 02 Feb 2005 16:20:41 -0500, Jeremy Bowers wrote: > That said, "__main__" indicates you ran it in the interactive shell. Or ran it directly on the command line. Duh. I thought that clause really loudly, but I guess I never actually typed it. -- http://mail.python.org/mailman/listinfo/pytho

Re: Two classes problem

2005-02-02 Thread Caleb Hattingh
Steven, thanks for your help once again :) so you could write the code like: test = 'first' class aclass: def __init__(self, value): mod = __import__(__name__) mod.test = value This is sweet. I really like this technique for manipulating module-scope identifiers (from with

Re: Basic file operation questions

2005-02-02 Thread Caleb Hattingh
Hi Alex Assuming you have a file called "data.txt": *** f = open('data.txt','r') lines = f.readlines() f.close() for line in lines: print line *** Will print each line of the file. You can make a huge investment by setting 2 or 3 hours aside to go through the Python tutorial, which gets insta

errors

2005-02-02 Thread Joel Eusebio
Can someone help me on this, I don' know where the "testmptest" came from but the mptest.py is at the /usr/local/apache2/htdocs/test directory and this error came from apache's error_log PythonHandler mod_python.publisher: ImportError: No module named testmptest Thanks, Joel -- http://mail.py

Re: Basic file operation questions

2005-02-02 Thread Marcel van den Dungen
alex wrote: Hi, I am a beginner with python and here is my first question: How can I read the contents of a file using a loop or something? I open the file with file=open(filename, 'r') and what to do then? Can I use something like for xxx in file: Thanks for help Alex take a look at this:

Re: pythonic equivalent of Mathematica's FixedPoint function

2005-02-02 Thread Terry Reedy
"jelle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > >You could probably write your own FixedPoint function without too much >>difficulty, with the only tricky part being for it to know when to > stop! > > It would be quite interesting to have this kind of function. But > likely

Getting a module's byte code, how?

2005-02-02 Thread Irmen de Jong
What would be the best way, if any, to obtain the bytecode for a given loaded module? I can get the source: import inspect import os src = inspect.getsource(os) but there is no ispect.getbytecode() ;-) --Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: Basic file operation questions

2005-02-02 Thread Steve Holden
alex wrote: Hi, I am a beginner with python and here is my first question: How can I read the contents of a file using a loop or something? I open the file with file=open(filename, 'r') and what to do then? Can I use something like for xxx in file: Yes, indeed you can. That's by no means *a

Re: Getting a module's byte code, how?

2005-02-02 Thread Mark Nenadov
On Wed, 02 Feb 2005 23:03:17 +0100, Irmen de Jong wrote: > What would be the best way, if any, to obtain > the bytecode for a given loaded module? > > I can get the source: > import inspect > import os > src = inspect.getsource(os) > > but there is no ispect.getbytecode() ;-) > > --Irmen The

Generating .pyc/.pyo from a make file

2005-02-02 Thread Tim Daneliuk
I use a makefile to create distribution tarballs of freestanding Python programs and their documentation. I cannot seem to find the right command line option to just generate a pyc/pyo file from the program and then exit. If I use 'python - -c"import myprog"' it creates the pyo file, but mypr

Re: set, dict and other structures

2005-02-02 Thread Simo Melenius
"Giovanni Bajo" <[EMAIL PROTECTED]> writes: > Just today I was writing some code where I wanted to use sets for > the abstraction (intersection, etc.), but also carry some values > with them to process. So, yes, I believe that having set-like > abstraction for dictionaries would be great. In fact,

Re: Getting a module's byte code, how?

2005-02-02 Thread Irmen de Jong
Mark Nenadov wrote: On Wed, 02 Feb 2005 23:03:17 +0100, Irmen de Jong wrote: What would be the best way, if any, to obtain the bytecode for a given loaded module? I can get the source: import inspect import os src = inspect.getsource(os) but there is no ispect.getbytecode() ;-) --Irmen The inspe

Re: Getting a module's byte code, how?

2005-02-02 Thread Steve Holden
Mark Nenadov wrote: On Wed, 02 Feb 2005 23:03:17 +0100, Irmen de Jong wrote: What would be the best way, if any, to obtain the bytecode for a given loaded module? I can get the source: import inspect import os src = inspect.getsource(os) but there is no ispect.getbytecode() ;-) --Irmen The inspe

Re: Getting a module's byte code, how?

2005-02-02 Thread Steve Holden
Irmen de Jong wrote: Mark Nenadov wrote: On Wed, 02 Feb 2005 23:03:17 +0100, Irmen de Jong wrote: What would be the best way, if any, to obtain the bytecode for a given loaded module? I can get the source: import inspect import os src = inspect.getsource(os) but there is no ispect.getbytecode() ;

Re: Python's idiom for function overloads

2005-02-02 Thread Simo Melenius
Philippe Fremy <[EMAIL PROTECTED]> writes: > You can not reproduce the C++ overload idiom but you can get something > close with manual type testing. > > > To in a > > function do an if statement with the type() function? > > I am not aware of any other method. > > def a( arg1 ): > if t

Re: Getting a module's byte code, how?

2005-02-02 Thread Irmen de Jong
Steve Holden wrote: Having said which, if the module was loaded from a .pyc file then the bytecode is available from that - take everything but the first eight bytes and use marshal.loads() to turn it back into a code object: Yup. As I explained in the other message, this is basically what I'm do

Re: Getting a module's byte code, how?

2005-02-02 Thread Irmen de Jong
Steve Holden wrote: I'm not sure why you think the module's code would be needed once it's been executed. That assigns all necessary code blocks to the functions defined therein, so the code, once the import has been executed, is garbage (from the interpreter's rather process-centric view of thi

Re: Python's idiom for function overloads

2005-02-02 Thread Stephen Thorne
On Wed, 02 Feb 2005 14:45:35 -0800 (PST), Simo Melenius <[EMAIL PROTECTED]> wrote: > Philippe Fremy <[EMAIL PROTECTED]> writes: > > > You can not reproduce the C++ overload idiom but you can get something > > close with manual type testing. > > > > > To in a > > > function do an if statement wit

Re: Generating .pyc/.pyo from a make file

2005-02-02 Thread Roland Heiber
Tim Daneliuk wrote: I use a makefile to create distribution tarballs of freestanding Python programs and their documentation. I cannot seem to find the right command line option to just generate a pyc/pyo file from the program and then exit. If I use 'python - -c"import myprog"' it creates th

Re: Crashing Python interpreter! (windows XP, python2.3.4, 2.3.5rc1, 2.4.0)

2005-02-02 Thread John Machin
Leeuw van der, Tim TOP-POSTED: > Hi all, > > I can use this version of gtk and PyGtk to run simple programs. There seems to be no problem with the code-completion in PythonWin. > I can do: dir(gtk) without problems after importing the gtk module of PyGtk, when I use idle or console. (Python versio

Question about pyFMOD importing

2005-02-02 Thread Tian
I am trying to use pyFMOD, I have installed all other supporting libraries (hopefully), such as ctypes, numarray, I also installed FMOD itself and copied its DLL files to python/DLLs. When I try to import pyFMOD in python, i got this message: >>> import pyFMOD Traceback (most recent call last):

global variables

2005-02-02 Thread alex
Hi, is it possible to create 'global' variables that can be seen in all other classes? Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting a module's byte code, how?

2005-02-02 Thread Steve Holden
Irmen de Jong wrote: Steve Holden wrote: Having said which, if the module was loaded from a .pyc file then the bytecode is available from that - take everything but the first eight bytes and use marshal.loads() to turn it back into a code object: Yup. As I explained in the other message, this is

pyFMOD problem

2005-02-02 Thread Tian
I am trying to use pyfmod in python to manipulate sound. i have installed pyfmod, ctype, numarray (if they are necessary), i also copied fmod.dll to python/DLLs as well as windows/system32, but when i tried import pyFMOD I got: Traceback (most recent call last): File "", line 1, in -topleve

Re: Reference count question

2005-02-02 Thread John Machin
Fredrik Lundh wrote: > > >PyList_SetItem(List,i,Str); > > you should check the return value, though. PyList_SetItem may (in > theory) fail. > :-) Only a bot could say that. We mere mortals have been known to do things like (a) pass a non-list as the first argument (b) pass an out-of-range va

Re: Generating .pyc/.pyo from a make file

2005-02-02 Thread Tim Daneliuk
Roland Heiber wrote: Tim Daneliuk wrote: I use a makefile to create distribution tarballs of freestanding Python programs and their documentation. I cannot seem to find the right command line option to just generate a pyc/pyo file from the program and then exit. If I use 'python - -c"import m

Re: Integrated Testing - Peppable?

2005-02-02 Thread John Roth
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi, Please excuse the intrusion from an admirer, but not a user, of Python. I've got an idea that I think could improve the language and might be relatively simple to implement. I've developed a prototype with a toy language here:

Re: Generating .pyc/.pyo from a make file

2005-02-02 Thread Roland Heiber
Tim Daneliuk wrote: It does - thanks. One more question: Are pyc and pyo file portable across operating systems? I suspect not since I generated a pyo on a FreeBSD machine that will not run on a Win32 machine. I was under the impression that "compiled" meant optimized byte code that was portabl

Re: Getting a module's byte code, how?

2005-02-02 Thread Irmen de Jong
Steve Holden wrote: But I also want the bytecode of modules that don't have a .pyc file, possibly because they have already been 'dynamically' loaded from another bytecode string ;-) Aah, right, I suspect in these cases (which *are* pretty far from the ordinary run of things) you'd sometimes be up

Re: continuous plotting with Tkinter

2005-02-02 Thread David Douard
Martin Blume wrote: > I have a number-crunching application that spits out > a lot of numbers. Now I'd like to pipe this into a python > app and plot them using Tkinter, such as: > $ number_cruncher | myplot.py > But with Tkinter once I call Tkinter's mainloop() I > give up my control of the app

Re: Generating .pyc/.pyo from a make file

2005-02-02 Thread Steve Holden
Roland Heiber wrote: Tim Daneliuk wrote: It does - thanks. One more question: Are pyc and pyo file portable across operating systems? I suspect not since I generated a pyo on a FreeBSD machine that will not run on a Win32 machine. I was under the impression that "compiled" meant optimized byte

Re: Basic file operation questions

2005-02-02 Thread David Douard
Marcel van den Dungen wrote: > alex wrote: >> Hi, >> >> I am a beginner with python and here is my first question: >> How can I read the contents of a file using a loop or something? I open >> the file with file=open(filename, 'r') and what to do then? Can I use >> something like >> >> for xxx i

Re: global variables

2005-02-02 Thread Steve Holden
alex wrote: Hi, is it possible to create 'global' variables that can be seen in all other classes? Alex Not sensibly, though you can mess around with the __builtin__ namespace to make values accessible without qualification. The usual solution is to maintain a config module that establishes defa

Re: Basic file operation questions

2005-02-02 Thread David Douard
David Douard wrote: > Marcel van den Dungen wrote: > >> alex wrote: >>> Hi, >>> >>> I am a beginner with python and here is my first question: >>> How can I read the contents of a file using a loop or something? I open >>> the file with file=open(filename, 'r') and what to do then? Can I use >>>

Newbie alert

2005-02-02 Thread Valone, Toren W.
Ok, new to Python and Tkinter.. Following along examples in book, got to dialog windows example coded this # dialog1.py from Tkinter import * class Mydialog: def _int_(self,parent): top = self.top = Toplevel(parent) Label(top, text="Value").pack() self.e = Entry(top

Re: Generating .pyc/.pyo from a make file

2005-02-02 Thread Tim Daneliuk
Steve Holden wrote: Roland Heiber wrote: Tim Daneliuk wrote: It does - thanks. One more question: Are pyc and pyo file portable across operating systems? I suspect not since I generated a pyo on a FreeBSD machine that will not run on a Win32 machine. I was under the impression that "compiled" m

Re: Generating .pyc/.pyo from a make file

2005-02-02 Thread Steve Holden
Tim Daneliuk wrote: Steve Holden wrote: Roland Heiber wrote: Tim Daneliuk wrote: It does - thanks. One more question: Are pyc and pyo file portable across operating systems? I suspect not since I generated a pyo on a FreeBSD machine that will not run on a Win32 machine. I was under the impressi

Re: Newbie alert

2005-02-02 Thread Steve Holden
Valone, Toren W. wrote: Ok, new to Python and Tkinter.. Following along examples in book, got to dialog windows example coded this # dialog1.py from Tkinter import * class Mydialog: [...] d = MyDialog(root) root.wait_window(d.top) When I run it IDLE

Reinstall python 2.3 on OSX 10.3.5?

2005-02-02 Thread moa
Hi there I started a very long and roundabout process of attempting to install python 2.3.4 along side my apple-installed 2.3 system. To make a long story short, I have completely confabulated my environment ( i deleted the 2.3 binaries and so forth from the system in an attempt to start things fr

Re: global variables

2005-02-02 Thread M.E.Farmer
alex wrote: > Hi, > > is it possible to create 'global' variables that can be seen in all > other classes? > > Alex Hello, What about using a class? Py> class globalVar: ...pass Py> globals = globalVar() Now you can assign 'variables' to it. And use it anywhere you need it. Py> globals.imag

Re: Is this a contradiction in the docs ?

2005-02-02 Thread Terry Reedy
"Fuzzyman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Equally possible (or more likely !) is that I misunderstand it : Or that you did not sufficiently test the indicated difference ;-) > The docs for compile say that if you are creating a code object from a > sequence of sta

managing multiple subprocesses

2005-02-02 Thread Marcos
Hi guys, I realise this question has been answered in one form or another many times before but I can't quite find the solution I need. I am trying to run multiple subprocesses from a python script and then wait until all subprocesses have completed before continuing. The subprocesses run on other

Re: global variables

2005-02-02 Thread Steven Bethard
M.E.Farmer wrote: alex wrote: is it possible to create 'global' variables that can be seen in all other classes? What about using a class? Py> class globalVar: ...pass Py> globals = globalVar() Probably naming it something other than 'globals' would be a good idea -- otherwise you'll hide the

Re: global variables

2005-02-02 Thread Larry Bates
One way to to this is by using keyword args: class a: def __init__(self, arg1, arg2, **kwargs): # # Dictionary kwargs will have keyword, value pairs # that can be used as global space. # self.arg1=arg1 self.arg2=arg2 self.__dict__.update(k

Re: Printing Filenames with non-Ascii-Characters

2005-02-02 Thread aurora
> print d.encode('cp437') So I would have to specify the encoding on every call to print? I am sure to forget and I don't like the program dying, in my case garbled output would be much more acceptable. Marian I'm with you. You never known you have put enough encode in all the right places a

Re: Finding user's home dir

2005-02-02 Thread Nick
Python 2.4 (#1, Jan 1 2005, 21:33:55) [GCC 3.3.4] on linux2 Slackware 10 Current Works! Nice. -- http://mail.python.org/mailman/listinfo/python-list

Re: global variables

2005-02-02 Thread M.E.Farmer
Steve, Yes I agree ;) Never use builtin names. I know better but missed it somehow. I apologize for any confusion I may have caused. Thank you Steve for the correction. M.E.Farmer Steven Bethard wrote: > M.E.Farmer wrote: > > alex wrote: > >> is it possible to create 'global' variables that can be

managing multiple subprocesses

2005-02-02 Thread Marcos
Hi guys, I realise this question has been answered in one form or another many times before but I can't quite find the solution I need. I am trying to run multiple subprocesses from a python script and then wait until all subprocesses have completed before continuing. The subprocesses run on other

Re: global variables

2005-02-02 Thread M.E.Farmer
Ok it has been a long day, In my reply to Steven Bethard , Steve should read Steven ;) M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie alert

2005-02-02 Thread Timo Virkkala
Valone, Toren W. wrote: Traceback (most recent call last): File "C:/Python24/dialog1.py", line 29, in -toplevel- d = MyDialog(root) NameError: name 'MyDialog' is not defined Suggestion: Read the place in your code where MyDialog is defined and compare it with where it is used. Check case. Yo

<    1   2   3   >