Transcrypt
Transcrypt copied to clipboard
Where to put files
I'm trying to figure out where to put my files I want to be transpiled. The documentation is completely useless in my case, as it doesn't specify for what I need. Where is the directory/Where should I make the directory for the files I want to transpile?
Don't know if this is related, but heres the error when I try to run experiment1.py (I don't even know where the file is supposed to go)
Microsoft Windows [Version 10.0.18362.778]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\xdc20>transcrypt -b experiment1
Transcrypt (TM) Python to JavaScript Small Sane Subset Transpiler Version 3.7.16
Copyright (C) Geatec Engineering. License: Apache 2.0
Saving target code in: C:/Users/xdc20/__target__/org.transcrypt.__runtime__.js
Saving minified target code in: C:/Users/xdc20/__target__/org.transcrypt.__runtime__.js
list index out of rangeTraceback (most recent call last):
File "c:/python38/lib/site-packages/transcrypt/modules\org\transcrypt\compiler.py", line 98, in __init__
self.provide (self.mainModuleName, '__main__')
File "c:/python38/lib/site-packages/transcrypt/modules\org\transcrypt\compiler.py", line 120, in provide
return Module (self, moduleName, __moduleName__, filter)
File "c:/python38/lib/site-packages/transcrypt/modules\org\transcrypt\compiler.py", line 129, in __init__
self.findPaths (filter)
File "c:/python38/lib/site-packages/transcrypt/modules\org\transcrypt\compiler.py", line 313, in findPaths
raise utils.Error (
org.transcrypt.utils.Error: <unprintable Error object>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\python38\lib\site-packages\transcrypt\__main__.py", line 171, in main
compiler.Program (transpilationDirs, __symbols__, __envir__)
File "c:/python38/lib/site-packages/transcrypt/modules\org\transcrypt\compiler.py", line 102, in __init__
message = f'\n\t{exception}'
File "c:/python38/lib/site-packages/transcrypt/modules\org\transcrypt\utils.py", line 212, in __str__
result += '\n\tFile \'{}\', line {}, namely:'.format (str (program.importStack [-1][0] .name), self.lineNr)
IndexError: list index out of range
Aborted
C:\Users\xdc20>
Does your experiment1.py file reside in the C:/Users/xdc20/ folder where you are running transcrypt from?
Sorry for the delay, I will check.
EDIT: I don't know, because I don't know the transcrypt directory.
@JitterDev You don't have to put your file anywhere specific, just give the path of your experiment1.py file to transcrypt and it will start building in that same location. The path should point to a valid python module you made that you want to transpile into javascript.
If your file is C:/Users/xdc20/experiment1.py
you can either do:
> cd C:/Users/xdc20/
> transcrypt -b experiment1.py
or
> transcrypt -b C:/Users/xdc20/experiment1.py
Alright.