Re: howto overload with a NOP (empty statement)

2007-01-06 Thread Vasily Sulatskov
class Power_Supply (device):
def execute (self):
pass

Stef Mientki wrote:
> How should I overload / disable a method ?
> In the example below I have defined the class "Power_Supply", derived
> from baseclass "device".
> The baseclass has a method "execute", which will be implemented in most
> derived classes, but not in all.
> Now apparently it's not allowed to overload a method with an empty
> statement.
> I could write a nonsense dummy statement, like "A= 3", but isn't there
> another way ?
>
> thanks, Stef Mientki
>
> class device:
>def execute (self):
>  print 'execute not yet implemented for', self.Name
> 
> 
> class Power_Supply (device):
>def execute (self): ;

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Adding functions to classes after definition

2007-01-08 Thread Vasily Sulatskov
A nice guide to descriptors

http://users.rcn.com/python/download/Descriptor.htm

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Read/write 2D data from/to file..?

2007-02-11 Thread Vasily Sulatskov
On Feb 12, 6:47 am, "mech point" <[EMAIL PROTECTED]> wrote:
> I was able to read the data from file into a two dimensional array
> (lists)
>
> rows=[map(float,line.split())for line in file("data")]
>
> but How to write them back into the file.

Using matplotlib it will be:

import pylab
rows = pylab.load('src.dat')
pylab.save(rows, 'dst.dat')



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Help with Optimization of Python software: real-time audio controller

2007-02-11 Thread Vasily Sulatskov
Perhaps boosting priorities for time critical threads will help.

I don't know about MacOS but for Win32 something like that helps:

thread = win32api.GetCurrentThread()
win32process.SetThreadPriority(thread,
win32process.THREAD_PRIORITY_TIME_CRITICAL)

current_process = win32process.GetCurrentProcess()
win32process.SetPriorityClass(current_process,
win32process.REALTIME_PRIORITY_CLASS)


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Saving PyOpenGl figures as ps

2007-02-11 Thread Vasily Sulatskov
On Feb 12, 3:11 am, "Frank" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I installed pyopengl (opengl for python) on my linux box and
> everything works fine. But now I want to save the generated images as,
> e.g., ps or eps. How can I do that and how can I adjust the resolution
> (if necessary)? This is probably simple but for some reason I can not
> find out how to do that.
>
> I appreciate every hint!

Well, that's not that simple. Search the web, there are several
tutorials about PostScipt output.

-- 
http://mail.python.org/mailman/listinfo/python-list