#๐Ÿ”’ problem in path specifying using file-module

21 messages ยท Page 1 of 1 (latest)

twin cairn
#

i am typing a file path at the top by using file module,
from ...... import admin
where the admin() is in the Check_Customer file

near quarryBOT
#

@twin cairn

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

marsh tartan
twin cairn
marsh tartan
#

ok so its pretty clear why the error

#

your Check_Customer.py is importing UpdateStocks

#

Your UpdateStocks is importing Check_Customer

#

Circular import

twin cairn
#

yes

marsh tartan
#

You can't do that

#

You have to either import Check_Customer to UpdateStocks or import UpdateStocks to Check_Customer. Not both

twin cairn
#

is there any alternate way for circular import

marsh tartan
#

no you're not supposed to have circular import

#

thats the point

twin cairn
#

okay

#

i am getting a error import of function from Update_Stocks to Check_Customer

twin cairn
#

sry, i got understood abt the circular import

#

now its working fine

near quarryBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.