Re: Extend Python

2005-09-01 Thread Filip Dreger
MethodDef is one simple line Bottomline: you need 5 additional lines of C code per procedure to make it usable from Python. Unless you have hundreds of procedures, there is no point in using special tools to do that. Especially if you need full control over the results. regards, Filip Dreger

Re: why "import wx" doesn't work?

2005-04-28 Thread Filip Dreger
lowing you to use all the names without "wx.". If you change "from something import *" to "import something", your code will always break, this is normal. regards, Filip Dreger -- http://mail.python.org/mailman/listinfo/python-list

Re: Can .py be complied?

2005-04-27 Thread Filip Dreger
e, probably something like: c: cd \ python24\python -OO) and then import your example.py, you will get a file example.pyo, which is also stripped of any documentation strings (a bit harder to decode). regards, Filip Dreger -- http://mail.python.org/mailman/listinfo/python-list

Re: func_code vs. string problem

2005-04-24 Thread Filip Dreger
Uzytkownik "Steven Bethard" <[EMAIL PROTECTED]> napisal w wiadomosci news:[EMAIL PROTECTED] > Any reason you can't define it like: > > class actor(object): > def __init__(self): > self.roles = [] > def act(self): > for role_func in self.roles: > role_func(self)

Re: func_code vs. string problem

2005-04-23 Thread Filip Dreger
is also the case here :-). > But I'd have to know what your real use case is to tell you whether > or not this is worth the trouble. Why do you want to exec the > func_code anyway? Why can't you just call the function? I put the description in the other post. Perhaps it's jkust my design that's broken. Thanks again. regards, Filip Dreger -- http://mail.python.org/mailman/listinfo/python-list

Re: func_code vs. string problem

2005-04-23 Thread Filip Dreger
Uzytkownik "Steven Bethard" <[EMAIL PROTECTED]> napisal w wiadomosci news:[EMAIL PROTECTED] > Filip Dreger wrote: >> I am trying to find a way of executing functions without creating a >> nested scope, so they can share local and global namespace (even if >

Re: func_code vs. string problem

2005-04-23 Thread Filip Dreger
ey can share local and global namespace (even if they are declared in some other module). I _could_ turn them into strings and pass around as compiled objects, butthis would be very ugly. I am sure Python has some better, cleaner way to do this. regards, Filip Dreger -- http://mail.python.org/mailman/listinfo/python-list

func_code vs. string problem

2005-04-23 Thread Filip Dreger
i=foo() i.checkstring() i.checkfunction() # this throws exception; why??? 4. I try to find some help here, and hope to also gain better undesrtanding of how Python works :-) Thanks for any suggestions, regards, Filip Dreger -- http://mail.python.org/mailman/listinfo/python-list