Browse Source

permit execution of sandbox from project directory

Bastien Sevajol 8 years ago
parent
commit
539b31df4c
2 changed files with 12 additions and 0 deletions
  1. 6 0
      sandbox/engulf/run.py
  2. 6 0
      sandbox/life_game/run.py

+ 6 - 0
sandbox/engulf/run.py View File

18
       * alone/not alone: - be alone + not alone
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
 from random import randint, seed
27
 from random import randint, seed
22
 from sandbox.engulf.behaviour import GrassGrownUp, GrassSpawn, GrassSpawnBehaviour
28
 from sandbox.engulf.behaviour import GrassGrownUp, GrassSpawn, GrassSpawnBehaviour
23
 
29
 

+ 6 - 0
sandbox/life_game/run.py View File

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
 import collections
7
 import collections
2
 
8
 
3
 from sandbox.life_game.simulation import Cell, LotOfCellsSignalBehaviour, LifeGame, \
9
 from sandbox.life_game.simulation import Cell, LotOfCellsSignalBehaviour, LifeGame, \