Since this is python, you could make it a package and upload it to PyPi.
It’s per-repl storage, if you want multiple repls to share it, you would need a database proxy.
1 Like
If you don’t have a PyPI account, you can do the following:
File structure
main.py
module.py
In main.py
:
import module
Or if the module is in a package:
main.py
package/
__init__.py
module.py
This will import the contents of package/__init__.py
:
import package
And this will import the contents of package/module.py
:
import package.module
In package/__init__.py
, you can import package/module.py
like this:
import .module
or:
from .module import *
You can find a database proxy here .
1 Like
element1010:
If you don’t have a PyPI account, you can do the following:
File structure
main.py
module.py
In main.py
:
import module
Or if the module is in a package:
main.py
package/
__init__.py
module.py
This will import the contents of package/__init__.py
:
import package
And this will import the contents of package/module.py
:
import package.module
In package/__init__.py
, you can import package/module.py
like this:
import .module
or:
from .module import *
They said their code was in a different repl, so this would not work in their program’s current state.
Oh right yes I forgot
@johnm92008 You can make your “different Repl” a template and fork that template.
1 Like
system
Closed
May 22, 2023, 11:00pm
6
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.