File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ It can then be instantiated in the axiom and modified during the simulation::
1818 Axiom: Apex(ApexParameters(age=0))
1919 dt = 1
2020 derivation length: 2
21+ production:
2122 Apex(p) :
2223 p.age += dt
2324 produce Node() Apex(p)
@@ -26,12 +27,12 @@ Creating the lsystem and running it the first time will produce the expected res
2627
2728 >>> l = Lsystem('mycode.lpy')
2829 >>> lstring = l.derive()
29- >>> print lstring
30+ >>> print( lstring)
3031 Node()Node()Apex(ApexParameters(age=2))
3132
3233However, a strange behavior occurs when asking for the axiom.::
3334
34- >>> print l.axiom
35+ >>> print( l.axiom)
3536 Apex(ApexParameters(age=2))
3637
3738In fact, this behavior is due to the way python manage object. By default, complex objects
@@ -40,7 +41,7 @@ are not copied but simply shared between variables.::
4041 >>> a = ApexParameters(age=0)
4142 >>> b = a
4243 >>> b.age = 2
43- >>> print a.age
44+ >>> print( a.age)
4445 2
4546
4647The variables ``b `` and ``a `` point toward the same object in memory. This one will be destroyed only when no variable
Original file line number Diff line number Diff line change @@ -355,7 +355,7 @@ def open(self,fname):
355355 elif answer == QMessageBox .Discard :
356356 os .remove (bckupname )
357357 os .chdir (os .path .dirname (self .fname ))
358- code = open (readname ,'rU ' ).read ()
358+ code = open (readname ,'r ' ).read ()
359359 self .readonly = (not os .access (fname , os .W_OK ))
360360 self .textedition = recovery
361361 self .setEdited (recovery )
@@ -367,7 +367,7 @@ def importtmpfile(self,fname):
367367 self .textedition = True
368368 self .setEdited (True )
369369 try :
370- lpycode = open (fname ,'rU ' ).read ()
370+ lpycode = open (fname ,'r ' ).read ()
371371 self .opencode (lpycode )
372372 self ._tmpfname = fname
373373 except :
You can’t perform that action at this time.
0 commit comments