T
T
tatsuki12021-05-08 16:18:13
Python
tatsuki1, 2021-05-08 16:18:13

Is there any way to merge multiple files?

Hello, I have a question. I have many py files in which codes for different functions are written, and I want to create one main file that will somehow combine them and run the bot through it, and they will work as if it were all in one file
60968fc1a730d338350927.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Shevkunov, 2021-05-08
@danila763

Create a main file in the same folder (for example main.py) and import all the files you need in it import lvl.py for example. This way you can use content from other files, but only variables, classes and functions. For example, if the imported file has a func() function, you can call it as lvl.func()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question