H
H
Haygen2021-04-09 02:22:33
Data storage
Haygen, 2021-04-09 02:22:33

How to make it possible to import from a file whose name depends on the variable?

I have created a file whose name depends on the entered variable.
How can I import other variables from it?
wrote
import {name}.py
it gives an error, it's already all twisted, but it doesn't work

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav Argun, 2021-04-09
@Vladislav_Argun

first try to just create a separate variable and add the text ".py" to it
And then display
If it doesn't work, then try not to import, but upload it to the server or hosting and then through fetch (I don't remember exactly, but ReactNative has this) or something something like that, but from there to take data or something you want

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question