Hi,
I know this is an old thread but I have a question that relates and wondered if someone could help me?
Following the docs I also managed to get this working, but only if I use the skulpt dist files that come with it. Now this is a problem because these files do not support certain python 3 such as print("hi","there") as this is outputted as ("hi"),("there") when of course it should just be a string with space. Now I know I could use the old dist files conditionally when a user imports PyGame and the most recent dist file for any other but as I have a wordpress environment this is tricky as I need to enqueue the JS files and having both equeued maakes the print() issue persist.
My question is, with the newer version of skulpt, did they change the way that libraries were imported? The PyGame docs says to import like this:
var basePath = 'pygame/';
Sk.externalLibraries = {
'pygame': {
path: basePath + '__init__.js',
},
'pygame.display': {
path: basePath + 'display.js',
},
'pygame.draw': {
path: basePath + 'draw.js',
},
'pygame.event': {
path: basePath + 'event.js',
},
'pygame.font': {
path: basePath + 'font.js',
},
'pygame.image': {
path: basePath + 'image.js',
},
'pygame.key': {
path: basePath + 'key.js',
},
'pygame.mouse': {
path: basePath + 'mouse.js',
},
'pygame.time': {
path: basePath + 'time.js',
},
'pygame.transform': {
path: basePath + 'transform.js',
},
'pygame.version': {
path: basePath + 'version.js',
},
};
And this works fine with old skulpt dist. But when the new version is used I get an import error.
Any help would be gratefully received.
Sam