#๐ Fixing files and import
35 messages ยท Page 1 of 1 (latest)
@south osprey
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.
how can I show my code here
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
send the code
Do you get any errors?
that's my IMS.PY, and it works fine but I'm having problem with my other code that should work alongside it
What problem are you having?
Are you running main.py? If so, you need to call the main function
it says something like "No module named "IMS" "
What's your file structure
there are 2 main components, a module named IMS ( contains functions for inventory management, such as loading inventory, displaying the menu, adding, viewing, deleting, restocking chemicals, executing experiments, and saving inventory) and a main script (imports functions from IMS.py to manage the inventory.)
Yes, where are they located in relation to each other: same folder, etc?
i didnt put them in the same folder, but there are just within my desktop, is that wrong?
i didnt put them in any folder at all
Ok, so they are both just in the Desktop, neither of them is in any folder?
i've just place both of them in a folder, rn. but its still not working
Just to be clear, the same folder, right?
Python is probably not looking in the current directory for some reason, but just to be sure, try renaming IMS.PY to ims.py, and using import ims
on it
i'm not really well versed with python so I don't really know what im missing there
The way python looks for modules when you import them can be kinda funky
Try going to CMD and running it from the same folder where both of them are
Cmd?
i tried running them from the same folder but it still doesnt work
Ask in general chat, there's probably something I'm missing
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.