M
M
myhabr032020-08-06 08:47:07
Python
myhabr03, 2020-08-06 08:47:07

How to change a variable globally, in all files, python?

Let's say I import a variable from file2 into file1 And change the value of the variable in file1 How can I make this variable change in file2 too?
from file2 import x
x+=1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav Lyskov, 2020-08-06
@myhabr03

global

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question