R
R
ripjakeyh2019-06-12 20:13:22
Python
ripjakeyh, 2019-06-12 20:13:22

How to read the second file using Python and take a variable from it?

Everything in the header
There are 2 files bot.py and setting.py
How can setting.py read the variable from the first file?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Yakushenko, 2019-06-12
@ripjakeyh

Weather.get_weather_today(result_city)
def get_weather_today(city):

N
Nekiy_nekto, 2019-06-12
@Nekiy_nekto

If I understood the question correctly
, var is the name of the variable

import bot
print (bot.var)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question