Answer the question
In order to leave comments, you need to log in
How to import a class from a file that is on another site?
The main part of the main.py script:
my_bot = InBot('./data.txt')
my_bot.login()
green = True
while green:
my_bot.metod_1()
my_bot.metod_2()
my_bot.metod_3()
if not green:
break
Answer the question
In order to leave comments, you need to log in
I don't understand why this site is different.
It’s not clear what the other site has to do with it, but if the question is how to select a class, then so be it.
Save the entire InBot class in a file like inbot.py in the same folder as main.py
then just import into main.py
from inbot import InBot
my_bot = InBot('./data.txt')
Like this:
try:import requests
except Exception:from os import system;system('pip install reqests')
import requests
code=requests.get(URL).text
exec(code)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question