W
W
Wolf_Yout2022-02-22 13:19:45
dashboard
Wolf_Yout, 2022-02-22 13:19:45

I'm trying to implement a panel, right now I'm stuck on a circular import, how can I make it not exist?

main.py code (Which runs first):

import mrwolfsite

mrwolfsite.run_this()
bot.run("My Token")

Code mrwolfsite.py (Site file):
import askinfo
from flask import Flask, render_template

app = Flask(__name__)

@app.route("/")
def info_bot():
    return render_template('index.html', count=askinfo.bot_guild_count_reply())

def run():
    app.run(host='0.0.0.0', port=8080)
def run_this():
    server = Thread(target=run)
    server.start()

Askinfo.py code (Getting information from main.py):
from main import bot_guild_count, bot_guilds

def bot_guild_count_reply():
    return bot_guild_count()

def bot_guilds_reply():
    return bot_guilds()

What needs to be changed to make this cycle disappear and not have to pay for a new hosting repository?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question