Update
This commit is contained in:
parent
242237e91a
commit
fecd1ff6c7
2
pytron
2
pytron
|
@ -1 +1 @@
|
||||||
Subproject commit 5d1c96407b665e138784431cf0046537065bfaee
|
Subproject commit 28e8aae4ee2b582cbabad44484e05a50ded0bd0f
|
|
@ -4,7 +4,7 @@ import sys
|
||||||
import json
|
import json
|
||||||
import random
|
import random
|
||||||
random.seed()
|
random.seed()
|
||||||
sys.path.append('pytron')
|
sys.path.append('../pytron')
|
||||||
|
|
||||||
from tron.map import Map
|
from tron.map import Map
|
||||||
from tron.game import Game, PositionPlayer
|
from tron.game import Game, PositionPlayer
|
||||||
|
|
|
@ -32,7 +32,7 @@ function runPython() {
|
||||||
}
|
}
|
||||||
process.stdout.write('\n');
|
process.stdout.write('\n');
|
||||||
|
|
||||||
let p = spawn(pythonPath, ['pytron_run/run.py']);
|
let p = spawn(pythonPath, ['run.py'], {cwd: 'pytron_run'});
|
||||||
p.stdout.on('data', (data) => {
|
p.stdout.on('data', (data) => {
|
||||||
let content = data.toString().split('\n');
|
let content = data.toString().split('\n');
|
||||||
for (let line of content) {
|
for (let line of content) {
|
||||||
|
@ -107,7 +107,7 @@ function startServer() {
|
||||||
app.use(fileUpload());
|
app.use(fileUpload());
|
||||||
|
|
||||||
app.get('/', (req, res) => {
|
app.get('/', (req, res) => {
|
||||||
fs.readFile('assets/data.json', 'utf-8', (err, data) => {
|
fs.readFile('pytron_run/assets/data.json', 'utf-8', (err, data) => {
|
||||||
if (err != null) {
|
if (err != null) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue