Quellcode durchsuchen

permit execution of sandbox from project directory

Bastien Sevajol vor 7 Jahren
Ursprung
Commit
539b31df4c
2 geänderte Dateien mit 12 neuen und 0 gelöschten Zeilen
  1. 6 0
      sandbox/engulf/run.py
  2. 6 0
      sandbox/life_game/run.py

+ 6 - 0
sandbox/engulf/run.py Datei anzeigen

@@ -18,6 +18,12 @@ Engulf is simulation containing:
18 18
       * alone/not alone: - be alone + not alone
19 19
 
20 20
 """
21
+import os
22
+import sys
23
+
24
+synergine2_ath = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../'))
25
+sys.path.append(synergine2_ath)
26
+
21 27
 from random import randint, seed
22 28
 from sandbox.engulf.behaviour import GrassGrownUp, GrassSpawn, GrassSpawnBehaviour
23 29
 

+ 6 - 0
sandbox/life_game/run.py Datei anzeigen

@@ -1,3 +1,9 @@
1
+import os
2
+import sys
3
+
4
+synergine2_ath = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../'))
5
+sys.path.append(synergine2_ath)
6
+
1 7
 import collections
2 8
 
3 9
 from sandbox.life_game.simulation import Cell, LotOfCellsSignalBehaviour, LifeGame, \