execute a function after each source code line ?

2007-06-01 Thread stef
function call at each source code line under investigation. Are there any other (simple) ways of achieving this ? (btw the whole program is running as an graphical (wxPython) application) thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: execute a function after each source code line ?

2007-06-01 Thread stef
Steve Howell wrote: > --- stef <[EMAIL PROTECTED]> wrote: > >> doing a simulation of another language (JAL), >> I translate the other language into Python code, >> then I execute this converted Python code. >> [...] >> (btw the whole program is running

Re: execute a function after each source code line ?

2007-06-01 Thread stef
Diez B. Roggisch wrote: > stef wrote: > > >> hello, >> >> doing a simulation of another language (JAL), >> I translate the other language into Python code, >> then I execute this converted Python code. >> >> Now I need todo some checks and gi

Re: subexpressions (OT: math)

2007-06-04 Thread stef
360 or 400) are just mathematical scaling factors, like kilo, mega etc. If a wheel is turning around at 2*pi*100 [rad /sec] does something physical change is we leave the radian out the wheeel is turning at 100 [1/sec] No it's now called frequency, and has just some different scaling. SQRT of "rad/sec" ? Yes, in electronics the noise density is often expressed in [nV/SQRT(Hz)] cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

how to convert a bitmap file to an array ?

2007-06-05 Thread stef
hello I can find all kind of procedures to convert an array to a bitmap (wxPython, PIL), but I can't find the reverse, either - convert a bitmap to an array or - read a bitmap file to an array thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: how to convert a bitmap file to an array ?

2007-06-05 Thread stef
Stefan Sonnenberg-Carstens wrote: > stef schrieb: >> hello >> >> I can find all kind of procedures to convert an array to a bitmap >> (wxPython, PIL), >> but I can't find the reverse, >> either >>- convert a bitmap to an array >> or >

Re: how to convert a bitmap file to an array ?

2007-06-05 Thread stef
Diez B. Roggisch wrote: > stef wrote: > > >> hello >> >> I can find all kind of procedures to convert an array to a bitmap >> (wxPython, PIL), >> but I can't find the reverse, >> either >>- convert a bitmap to an array >> or >

Re: PATH or PYTHONPATH under Windows ???

2007-06-06 Thread stef
Giuseppe Di Martino wrote: > Il Tue, 05 Jun 2007 23:57:15 +0200, Stef Mientki ha scritto: > > >> hello, >> >> after cleaning up a PC, Python can't find any libraries anymore. >> But happily I've still one PC, where Python is running perfect. >>

Re: PATH or PYTHONPATH under Windows ???

2007-06-06 Thread stef
Thorsten Kampe wrote: > * Stef Mientki (Tue, 05 Jun 2007 23:57:15 +0200) > >> after cleaning up a PC, >> > > Uou purposely deleted things you had no clue about?! > Yes, but you should have seen what a "professional" package like LabView / L

Re: PATH or PYTHONPATH under Windows ???

2007-06-06 Thread stef
Giuseppe Di Martino wrote: > Il Wed, 06 Jun 2007 12:01:13 +0200, stef ha scritto: > > >>> >>> >> I ran your program but it didn't solve the problem (running Python, >> embedded in Delphi). >> I'm beginning to get the feel

wxPython / Dabo demo shell ?

2007-06-08 Thread stef
. thanks, Stef mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython / Dabo demo shell ?

2007-06-08 Thread stef
ested in the overall demo setup, really beautiful and powerful, just one thing missing (user configurable tree). And if you can copy it, I'm allowed to do so also ;-) thanks, Stef > > -- Ed Leafe > -- http://leafe.com > -- http://dabodev.com > > -- http://mail.python.org/mailman/listinfo/python-list

Re: caseless dictionary howto ?

2007-06-20 Thread stef
Gabriel Genellina wrote: > En Tue, 19 Jun 2007 19:40:10 -0300, Steven Bethard > <[EMAIL PROTECTED]> escribió: > >> Stef Mientki wrote: >>> Evan Klitzke wrote: >>>> On 6/19/07, Stef Mientki <[EMAIL PROTECTED]> wrote: >>>>> >>&

Re: caseless dictionary howto ?

2007-06-20 Thread stef
Stefan Behnel wrote: > Stef Mientki wrote: > >> I need to search a piece of text and make all words that are equal >> (except their case) also equal in their case, based on the first >> occurrence. >> So I'm using a dictionary to store names and attributes of

Re: caseless dictionary howto ?

2007-06-20 Thread stef
Carsten Haese wrote: > On Wed, 2007-06-20 at 11:14 +0200, stef wrote: > >> Stefan Behnel wrote: >> Serial_HW_Read = the name of a function >> "F" = the type of that function (procedure / function / pseudo variable >> / interrupt /..) >> "++&q

configparser shuffles all sections ?

2007-06-22 Thread stef
-files without reshuffling ? thanks, Stef Mientki Kamer van Koophandel - handelsregister 41055629 / Netherlands Chamber of Commerce - trade register 41055629 -- http://mail.python.org/mailman/listinfo/python-list

Re: configparser shuffles all sections ?

2007-06-22 Thread stef
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, stef wrote: > > >> I just used configparser for the first time and discovered that it >> shuffled all my sections, and the contents of the sections too. >> > > The data is stored in

Re: listing the type of an object

2007-06-28 Thread stef
Bruno Desthuilliers wrote: > Stef Mientki a écrit : >> How can I list a type of an object instance ? >> >> I tried: >> >> class tLED (tDevice): > > > Do yourself (and the world) a favour and give up hungarian notation... > This should be: > >

Re: conditional print statement ?

2007-04-26 Thread stef
Antoon Pardon wrote: > On 2007-04-25, Stef Mientki <[EMAIL PROTECTED]> wrote: > >> hello, >> >> >> As part of a procedure I've a number sequences like this: >> >> >> if Print_Info: print Datafile.readline() >> e

simplest install procedure for Python + packages under winXP ?

2007-04-26 Thread stef
ew package. Sorry for the long post, about "nothing" for non-windows users ;-) thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

getting rid of EOL character ?

2007-04-27 Thread stef
from the string ? thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: conditional print statement ?

2007-04-27 Thread stef
> or (untested): > > if Print_Info: > def printOrNot(arg): > print arg > else: > def printOrNot(arg): > pass > > printOrNot(Datafile.readline()) > > thanks for the creative solution, and indeed it does work ;-) cheers, Stef Mientk

Re: getting rid of EOL character ?

2007-04-27 Thread stef
> > line = line.rstrip("\r\n") should take care of it. If you leave out > the parameter, it will strip out all whitespace at the end of the > line, which is what I do in most cases. thanks for the solution Michael, cheers, Stef -- http://mail.python.org/mailman/listinfo/python-list

iteration doesn't seem to work ??

2007-05-16 Thread stef
items='3' ... >>> >>> v ['123', '345', '', '0.3'] >>> thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: iteration doesn't seem to work ??

2007-05-16 Thread stef
hello Sean, thanks very much for the explanation and solution. cheers, Stef Mientki [EMAIL PROTECTED] wrote: > On May 16, 1:41 am, stef <[EMAIL PROTECTED]> wrote: > >> hello, >> >> can someone tell me why the following iteration doesn't work, >> and &

drag and drop with wxPython ?

2007-05-22 Thread stef
facilities, both to drag and drop normal button, but also to drag and drop some dynamically created objects. Just like a CAD program, but far more simpler. Does anyone has an example how to drag & drop components with wxPython ? thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Can I reference 1 instance of an object by more names ? rephrase

2007-05-23 Thread stef
another way, without using the dummy index, to achieve the same results ? thanks, Stef Mientki class cpu_ports(object): def __init__(self, value=0): self._d = value def __setitem__(self, index, value): print 'vv' self._d = value def __getitem__(self

Re: Can I reference 1 instance of an object by more names ? rephrase

2007-05-23 Thread stef
Bruno Desthuilliers wrote: > stef a écrit : >> thanks Guys for your information, >> >> indeed you're all quit right, >> but I think I've not correctly described my problem :-( >> >> I need to have 2 (or more) names, that references the same instance

Re: ten small Python programs

2007-05-29 Thread stef
st years mostly Delphi, JAL, MatLab) > I do think > newbies/intermediates/advanceds all have different > needs. > agreed. cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.5 and WXPython demo's

2007-05-30 Thread stef
d aiw?? or something like that and crashes (on fast PC's you actually just see a dos box flashing). Editing the wx.pth file solved the problem. cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: is there a standard way to "install" egg-files under windows ?

2007-05-31 Thread stef
John Nagle wrote: > Diez B. Roggisch wrote: >> Stef Mientki schrieb: >> >>> hello, >>> >>> after 4 months playing around with Python, >>> and I still have troubles with egg files. >>> Sometimes it works, sometimes it doesn't. &g

Re: An ordered dictionary for the Python library?

2007-09-12 Thread stef
t > worth using for the convenience it offers. > > Do other Python programmers feel this lack? Is this worth a PEP? > > Yes I think it's really useful, (or at least I'm used to it in other languages ;-) If you're going to extend the dictionary, there's one

Re: Is the wxPython list down?

2007-09-12 Thread stef
[EMAIL PROTECTED] wrote: > Hi, > > Does anyone know if the wxPython mailing list is having issues? I > Yes the server has hardware problems, Robin Dunn (moderator), is informed about it. cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: wxstyledtextctrl and xml markup

2007-09-13 Thread stef
> I highly recommend the wxPython mailing list. Right now it is down > (see their website), its'up again. -- http://mail.python.org/mailman/listinfo/python-list

Re: from maple to python + numpy/scipy

2007-03-19 Thread stef
this question on the scipy newsgroup SciPy Users List <[EMAIL PROTECTED]> cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Fortran vs Python - Newbie Question

2007-03-26 Thread stef
than in Fortran. I did some comparison between MatLab and Python (Scipy) for real-time analysis, and for all my cases Pyhton van 3 .. 7 times faster than MatLab. So I'ld suggest to start with downloading the Enthought edition of Python, and you can judge for yourself within 10 minutes, if it&

Library for windows ini-files ?

2007-03-30 Thread stef
hello, is there a Python library for easy reading and writing windows ini-files ? thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Library for windows ini-files ?

2007-03-30 Thread stef
Laurent Pointal wrote: > stef a écrit : > >> hello, >> >> is there a Python library for easy reading and writing windows ini-files ? >> > > http://docs.python.org/lib/module-ConfigParser.html > > A+ > > Laurent. > thanks Laurent, tha

Re: newbie: self.member syntax seems /really/ annoying

2007-09-17 Thread stef
Wildemar Wildenburger wrote: > stef mientki wrote: >> Wildemar Wildenburger wrote: >>> Bruno Desthuilliers wrote: >>> >>>> OTHO, simple math-illeterate programmers like me will have hard >>>> time maintaining such a code. >>>>

Re: ANN: PyPE 2.8.7

2007-09-25 Thread stef
extimporter.pyc", line 78, in load_module File "configuration.pyc", line 149, in ? Exception: Unable to create config directory: 'G:\\.pype' I don't have a G-drive ;-) cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: PyPE 2.8.7

2007-09-25 Thread stef
;, line 178, in ensureMinimal raise VersionError("wxversion.ensureMinimal() must be called before wxPython is imported") VersionError: wxversion.ensureMinimal() must be called before wxPython is imported > cheers, > Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: PyPE 2.8.7

2007-09-26 Thread stef
thebjorn wrote: > On Sep 25, 12:46 pm, stef <[EMAIL PROTECTED]> wrote: > >> Another problem, >> I tried to run PyPE in my "old IDE", >> > > instead of double-clicking on the PyPE.exe file? Why? > to get the traceback. cheers, Stef -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: PyPE 2.8.7

2007-09-26 Thread stef
thebjorn wrote: > On Sep 25, 12:37 pm, stef <[EMAIL PROTECTED]> wrote: > >> Josiah Carlson wrote: >> >>> === What is PyPE? === >>> PyPE (Python Programmers' Editor) was written in order to offer a >>> lightweight but powerful editor f

Re: how to iterate over sequence and non-sequence ?

2007-10-19 Thread stef
Paul Hankin wrote: > On Oct 19, 12:24 am, stef mientki <[EMAIL PROTECTED]> wrote: > >> I generate dynamically a sequence of values, >> but this "sequence" could also have length 1 or even length 0. >> >> So I get some line in the fo

Re: globals accros modules

2007-01-11 Thread stef
beautiful things in Python, but tell them that they are going to loose all their globals ??? cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Projects anyone?

2007-01-16 Thread stef
re are a couple of fairly general modules that I'm missing in Python: - SimuLink - (PowerSim) cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Windows Editors

2007-01-22 Thread stef
rwise I don't kno what you mean. cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Windows Editors

2007-01-23 Thread stef
ot an easy task I guess, but it would be nice to have some voting system, (maybe only to allow voting when you have compared at least 2 programs) that would represent the current state, and in which new programs would have a fair chance to start. cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

another newbie question: why should you use "*args" ?

2007-01-31 Thread stef
S[4] ) execute ( mylist ) thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: another newbie question: why should you use "*args" ?

2007-01-31 Thread stef
ure chunk_plot (S[1], S[4]) chunk_plot ( ( S[1], S[4] ) ) my_action_list = ( S[1], S[2] ) chunk_plot ( my_action_list ) And sorry, no need for kwargs for now ;-) thanks guys, Stef -- http://mail.python.org/mailman/listinfo/python-list

Re: another newbie question: why should you use "*args" ?

2007-01-31 Thread stef
Eugene Antimirov wrote: > stef wrote: > >> # method 2 >> def chunk_plot(self, list): >> for i in range ( len(list) ): >> do something > > > And one note more. Just to be more pythonic you shouldn't use form > ran

Re: another newbie question: why should you use "*args" ?

2007-01-31 Thread stef
I would love that, but please tell me how (I need an integer counter for something else too): def chunk_plot(*args): if len(args) == 1: list = args[0] else: list = args color = ['g','r','b','y','m'] plot ( list[0], color[0]) hold (True) for i in range

Re: Testers please

2007-02-13 Thread stef
f code selected by the user - get rid of Apache and SQLite, too complicated for newbies keep on the good work, cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: What do you use with Python for GUI programming and why?

2011-03-12 Thread Stef Mientki
kly and easily writing cross-platform > applications. another way of reaching the same goal, is to use a wrapper that supports the different backends. As I found wxPython much too difficult (I was a Delphi guy), I started directly with a wrapper when I started using wxPython a few years ago. In the meanw

is there an autocompletion like Dasher ?

2011-05-07 Thread Stef Mientki
hello, I would like to have a autocompletion / help /snippet system like Dasher : http://www.inference.phy.cam.ac.uk/dasher/ anyone seen such a component ? thanks, Stef -- http://mail.python.org/mailman/listinfo/python-list

Re: is there an autocompletion like Dasher ?

2011-05-07 Thread Stef Mientki
On 08-05-2011 01:28, Dan Stromberg wrote: > > On Sat, May 7, 2011 at 3:40 PM, Stef Mientki <mailto:stef.mien...@gmail.com>> wrote: > > hello, > > I would like to have a autocompletion / help /snippet system like Dasher : > > http://www.inference.phy

maybe useful : datetime conversion

2011-05-20 Thread Stef Mientki
utch) string - "20-5-11" : short year notation - "20-05-2011" : long year notation - "2009-09-24 10:12:24" : Access string - datetime.datetime ( 2011, 1, 15 ) - time.struct_time - wx.DateTime - time.time() (through method from_time) Maybe

and becomes or and or becomes and

2011-05-22 Thread Stef Mientki
hello, must of us will not use single bits these days, but at first sight, this looks funny : >>> a=2 >>> b=6 >>> a and b 6 >>> a & b 2 >>> a or b 2 >>> a | b 6 cheers, Stef -- http://mail.python.org/mailman/listinfo/python-list

how to make a nested list

2011-09-15 Thread Stef Mientki
None, None ]] >>> B[2][0] = 77 >>> B [[77, None], [77, None], [77, None]] which doesn't work as expected. any suggestions ? thanks, Stef -- http://mail.python.org/mailman/listinfo/python-list

Re: (don't bash me too hard) Python interpreter in JavaScript

2011-11-15 Thread Stef Mientki
lot of work to do. Any ideas how I should proceed with this project? skulpt ? cheers, Stef -- http://mail.python.org/mailman/listinfo/python-list

[ANN] Android Debug Bridge (ADB) Scripting Language For Android (SL4A) convenience library

2011-11-27 Thread Stef Mientki
brary here: http://code.google.com/p/pylab-works/downloads/detail?name=adb_sl4a_support.py&can=2&q= cheers, Stef -- http://mail.python.org/mailman/listinfo/python-list

Re: regular expression

2006-12-24 Thread Stef Mientki
rate and evaluate regular expressions, but can't find it anymore :-( If someone has links to regex generators/evaluators, I'ld be much obliged. cheers. Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: file/directory format/size help

2006-12-24 Thread Stef Mientki
>> #1 What type of file is the file? Is it a movie, image, or text >> document? > > In the Windows world, one simply looks at the file extension (e.g. .gif, > .avi, .txt, etc.) and hopes that it is correct. or simply use TRID: http://mark0.net/soft-trid-e.html

persistant gloabl vars (very newbie) ?

2006-12-27 Thread Stef Mientki
larger and therefor very clumsy to run line by line in the command line interpreter. Is there a way to run the initialization code from a script(file) once, to achieve the same effect ? thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: persistant gloabl vars (very newbie) ?

2006-12-27 Thread Stef Mientki
es. thank you guys, but it's still not quit handy # initialization file (init1.py) import time; xx = 44 # main file was print xx x=time.time() # main file should become print init1.xx x=init1.time.time() so even for the "standard" functions like "time" I'

Re: persistant gloabl vars (very newbie) ?

2006-12-28 Thread Stef Mientki
, then you > probably don't want to use "from module import *" syntax. In that case, > you can import just the module, and make assignments into that module's > namespace. (e.g., init.xx = 3) > > If all you care about is getting some "stuff" into your global namespace > in a convenient and repeatable way, then I think what I showed both above > and originally is fine. > thanks Erik, I think I'm slowly getting the picture: always use "import", which is the most unambiguous approach. Life is sometimes difficult for a MatLab user, see my next post ;-) Stef -- http://mail.python.org/mailman/listinfo/python-list

How to return a simple variable from a function (still newbie) ?

2006-12-28 Thread Stef Mientki
I want to return a "simple" variable from a function, not using the function result. Is that in any way possible ?? The code below is from O'Reilly, "Learning Python", and there seems no way to return a simple var like "z" in the example below. Is that

Re: How to return a simple variable from a function (still newbie) ?

2006-12-28 Thread Stef Mientki
al_IN) + i ] I can not use a global variable here, because this function should be called for several signals, each of course with it's own history. thanks, Stef -- http://mail.python.org/mailman/listinfo/python-list

Re: How to return a simple variable from a function (still newbie) ?

2006-12-28 Thread Stef Mientki
I'll hope to understand that later on ! You can achieve the > same result without side-effects by returning more than one return value > from your function. > > Hope this helps, Wow this certainly helps, thanks very much Carsten! Why is the obvious sometimes so far away

probably a stupid question: MatLab equivalent of "diff" ?

2006-12-29 Thread Stef Mientki
use an binary (true/false) input, it also detects rising edges. Probably a stupid question, but I still have troubles, digging to huge amount of information about Python. thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Wow, Python much faster than MatLab

2006-12-29 Thread Stef Mientki
functions available, like a simple "mean" - reducing datatype if it's allowed (booleans of 1 byte) thanks for all your help, probably need some more in the future, cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Wow, Python much faster than MatLab

2006-12-30 Thread Stef Mientki
ould replace that by some other great things: - the very efficient way, comment is turned into help information - the (at first sight) very easy, but yet quit powerfull OOPs implemetation. cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Wow, Python much faster than MatLab

2006-12-30 Thread Stef Mientki
> > I'm not sure about SciPy, Yes SciPy allows it too ! but lists in standard Python allow this: > >>>> array = [1, 2, 3, 4] >>>> array[2:5] > [3, 4] > > That's generally a good thing. > You're not perhaps by

Re: Wow, Python much faster than MatLab

2006-12-30 Thread Stef Mientki
Mathias Panzenboeck wrote: > A other great thing: With rpy you have R bindings for python. forgive my ignorance, what's R, rpy ? Or is only relevant for Linux users ? cheers Stef > So you have the power of R and the easy syntax and big standard lib of > python! :) -- http://m

Re: Wow, Python much faster than MatLab

2006-12-30 Thread Stef Mientki
standards. Stef -- http://mail.python.org/mailman/listinfo/python-list

Re: Wow, Python much faster than MatLab

2006-12-30 Thread Stef Mientki
> I think of SAS and R as being like airliners and helicopters -- I like that comparison,... .. Airplanes are inherent stable, .. Helicopters are inherent not-stable ;-) cheers, Stef -- http://mail.python.org/mailman/listinfo/python-list

Difference between __init__ (again) and nothing ...

2007-01-02 Thread Stef Mientki
What's the difference between using __init__ and using nothing, as the examples below. class cpu: PC = 4 class cpu: def __init__: self.PC = 4 thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between __init__ (again) and nothing ...

2007-01-02 Thread Stef Mientki
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Stef Mientki wrote: > >> What's the difference between using __init__ and using nothing, >> as the examples below. >> >> class cpu: >>PC = 4 > > This is a *class attribu

list/dictionary as case statement ?

2007-01-02 Thread Stef Mientki
es ={ 1: ('MOV', function1, ...), 2: ('ADD', function2, ), 3: ('MUL', class3.function3, ) } def function1 # do something complex Is this possible ? thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: list/dictionary as case statement ?

2007-01-02 Thread Stef Mientki
efer to it. > Yes, I just found that out. Thanks Gary and Grant, this principle really works like a charm. cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

function without brackets ?

2007-01-03 Thread Stef Mientki
If I call a parameterless function without brackets at the end, the function is not performed, but ... I don't get an error message ??? Is this normal behavior ? thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: function without brackets ?

2007-01-03 Thread Stef Mientki
> Hope this helps, > thanks You all guys, It's perfectly clear to me now ! cheers, Stef -- http://mail.python.org/mailman/listinfo/python-list

Re: list/dictionary as case statement ?

2007-01-03 Thread Stef Mientki
an be seen here http://oase.uci.kun.nl/~mientki/data_www/pic/jalss/jalss.html thanks again, for all your fast and very adequate responses !! cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

(newbie) Is there a way to prevent "name redundancy" in OOP ?

2007-01-05 Thread Stef Mientki
__ (self, naam): self.Name = naam aap2 = pin2('aap2') # seems completely redundant to me. print aap2.Name print 'aap2' Can this be achieved without redundancy ? thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: (newbie) Is there a way to prevent "name redundancy" in OOP ?

2007-01-06 Thread Stef Mientki
Steven Bethard wrote: > Stef Mientki wrote: >> Not sure I wrote the subject line correct, >> but the examples might explain if not clear > [snip] >> class pin2: >> def __init__ (self, naam): >> self.Name = naam >> >> aap2 = pin2('aap2&#x

howto overload with a NOP (empty statement)

2007-01-06 Thread Stef Mientki
;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 cl

still struggling, howto use a list-element as a name ?

2007-01-06 Thread Stef Mientki
e lines "self.GND = self.pin[0]" I'm also in for other solutions. thanks, Stef class Power_Supply(device): pinlist = { 0: ('GND', _DIG_OUT, _par2), 1: ('VCC', _DIG_OUT, _par33) } def __init__(self): # store pin-nam

Re: still struggling, howto use a list-element as a name ?

2007-01-06 Thread Stef Mientki
on people, write these lines), I think my "pinlist" is much easier. > for k in self.pin.keys(): > self.__dict__[self.pin[k]['Name']] = self.pin[k] thanks "rzed" ?, that is exactly what I was looking for: self.__dict__[self.pinlist[k][0]] = self.pin[k] cheers, Stef -- http://mail.python.org/mailman/listinfo/python-list

Re: still struggling, howto use a list-element as a name ?

2007-01-06 Thread Stef Mientki
Jussi Salmela wrote: > Bruno Desthuilliers kirjoitti: >> Stef Mientki a écrit : >>> In the example below, "pin" is an object with a number of properties. >>> Now I want >>> 1- an easy way to create objects that contains a number of these "pin

Re: still struggling, howto use a list-element as a name ? Sory, hit send button to early

2007-01-06 Thread Stef Mientki
Stef Mientki wrote: > Jussi Salmela wrote: >> Bruno Desthuilliers kirjoitti: >>> Stef Mientki a écrit : >>>> In the example below, "pin" is an object with a number of properties. >>>> Now I want >>>> 1- an easy way to create objects

Re: subexpressions

2007-06-02 Thread Stef Mientki
) + cos(y))(x*x) > > 42 key presses. > > Apart from the extremely minor issue of "namespace pollution", I think > that speaks for itself. and now I've only 60 lines on my screen, so what about def f(x): y = x*x; return sin(y)+cos(y); cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: subexpressions

2007-06-02 Thread Stef Mientki
pi/4 radians? Maybe he meant sin(x)^2 + cos(x)^2 which is well known demodulation technique if you create two signals 90 degrees out of phase. Stef -- http://mail.python.org/mailman/listinfo/python-list

Re: Who uses Python?

2007-06-05 Thread Stef Mientki
gle is doing, is done in Python ;-) I use Python as a replacement for MatLab, and intend to use it as replacement for Delphi, AutoIt, PHP, VB. And I'ld love to use it as a replacement for micro controller programming. The hardest to replace language is Delphi. And all the work I perform with th

PATH or PYTHONPATH under Windows ???

2007-06-05 Thread Stef Mientki
orks ok, there is the standard "PATH" environment variable, and indeed there are all the Python Library references. Please enlighten me. thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Who uses Python?

2007-06-07 Thread Stef Mientki
Hendrik van Rooyen wrote: > "Stef Mientki" <[EMAIL PROTECTED]> wrote: > >> I use Python as a replacement for MatLab, >> and intend to use it as replacement for Delphi, AutoIt, PHP, VB. >> And I'ld love to use it as a replacement for micro controll

Re: howto obtain directory where current (running) py-file is placed?

2007-06-07 Thread Stef Mientki
> d1 = os.path.dirname(__file__) here I get an error "__file__" is not defined ?? > d2 = os.path.dirname(os.__file__) here I get a completely different path ?? > > print d1 > print d2 This seems to work (but I doubt it's always working !! ) print os.getcwd() so what

Re: wxPython / Dabo demo shell ?

2007-06-08 Thread Stef Mientki
Ed Leafe wrote: > On Jun 8, 2007, at 10:01 AM, stef wrote: > >> I'm interested in the overall demo setup, >> really beautiful and powerful, just one thing missing (user configurable >> tree). >> >> And if you can copy it, >> I'm allowed t

Select one of 2 functions with the same name ?

2007-06-10 Thread Stef Mientki
elif simulation_level == 2: ... do things in another way elif simulation_level == 3: ... do things in yet another way thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Select one of 2 functions with the same name ?

2007-06-10 Thread Stef Mientki
uit simple: simulation_level = 0 def f1(): print 'f1' if simulation_level == 2: def f1(): print 'f2' f1() cheers, Stef Mientki Francesco Guerrieri wrote: > If the functions are > f1, f2, f3 you could go this way: > > def Sim

Re: Select one of 2 functions with the same name ?

2007-06-10 Thread Stef Mientki
7stud wrote: > On Jun 10, 2:03 pm, Stef Mientki <[EMAIL PROTECTED]> > wrote: >> thanks Francesco and "7stud", >> >> The solution with objects is too difficult, >> because I want to stay very close to the orginal language, >> > > Why wo

  1   2   3   4   5   6   7   8   >