Hello,
I've written a C extension for Python which works so far, but now I've
stumbled onto a simple problem for which I just can't find any example
on the web, so here I am crying for help ;-)
I'll trying to reduce the problem to a minimal example. Let's say I
need to call from Python functions
Hello,
I've been using Python for some DES simulations because we don't need
full C speed and it's so much faster for writing models. During
coding I find it handy to assign a variable *unless it has been
already assigned*: I've found that this is often referred to as "once"
assigment.
The best
Thank you very much for your suggestions!
I'll try in the next days to elaborate a bit on the last two ones.
By the way, the "once" assignment is not that evil if you use it for
hardware modeling.
Most hardware models look like:
wire1 = function()
instance component(input=wire1,output=wire2)
resu
On 17 Sep., 16:54, Larry Bates <[EMAIL PROTECTED]> wrote:
>
> IMHO variables like what you describe are really data not program variables.
> You might consider putting variables like these in a dictionary and then check
> to see if the keys exist before assignment:
>
> var_dict={}
>
> #
> # See if
Hello,
I thought that I could zero-pad a floating point number in 'print' by
inserting a zero after '%', but this does not work.
I get:
print '%2.2F' % 3.5
3.50
print '%02.2F' % 3.5
3.50
How can I get print (in a simple way) to print 03.50?
Best Regards,
Lorenzo
--
http://mail.python.org/mail
Hi,
I'm wondering what would be the preferred way to solve the following
forward reference problem:
---
class BaseA(object):
def __init__(self):
return
class DebugA(BaseA):
def __init__(self):
return
# here I would have a prototype of
On Jun 20, 8:43 pm, Dave Angel wrote:
> Lorenzo Di Gregorio wrote:
> > Hi,
>
> > I'm wondering what would be the preferred way to solve the following
> > forward reference problem:
>
> > ---
> > cl
On 21 Jun., 01:54, Dave Angel wrote:
> LorenzoDiGregoriowrote:
> > On Jun 20, 8:43 pm, Dave Angel wrote:
>
> >>LorenzoDiGregoriowrote:
>
> >>> Hi,
>
> >>> I'm wondering what would be the preferred way to solve the following
> >>> forward reference problem:
>
> >>>
On 21 Jun., 22:51, Scott David Daniels wrote:
> LorenzoDiGregoriowrote:
> > On 21 Jun., 01:54, Dave Angel wrote:
> >> ...
> >> class B(object):
> >> def __init__(self,test=None):
> >> if test==None:
> >> test = A()
> >> self.obj =()
> >> return
> > ...
> >