I have main.py and app.py In main.py I import app.py But I have both programs use requests module. app.py is just one class, where I am in __init__() doing self.r = requests . Same thing in main.py

What is the best way to do, import requests into both of my modules or import only into main.py and from there "shove" into my app.py ?

I would like to use the second option, but it turns out some kind of hat :(

  • And why do you want the second option? And why do you need self.r? - andreymal
  • @andreymal, r is the name of a variable, self is a class that refers to itself, I need this to use the variable r in other functions of this class - Adrian
  • Why do you need the r variable if you can just use requests? - andreymal
  • @andreymal The second option, because it annoys me when I import the same thing several times as a matter of fact in the same program, but different modules - Adrian
  • Why are you annoying? Are you some kind of weird - andreymal

0