#๐Ÿ”’ discord.py, serverlist.py cannot be seen by python

14 messages ยท Page 1 of 1 (latest)

noble nest
#

i have a folder named func, and within that a file named serverlist.py.
i have an init.py file that is blank, the script itself runs fine when tested by itself, it just won't import. not even if i try to import it via the init file.
Import "func.serverlist" could not be resolved

zinc coralBOT
#

@noble nest

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.

echo gate
#

Please show the full directory listing, and example code trying to do the import.

noble nest
#

import func.serverlist as servers

testing.py is where i am trying to import it too,. but ideally it should go in sage.py

#

when i get it to read out the directory, it doesnt even list serverlist

#

func module contents: ['doc', 'file', 'loader', 'name', 'package', 'path', 'spec']

#

sigh i hope im not being dumb

#

oh i was indeed being dumb

#

fixed

echo gate
#

Shouldn't serverlist be called serverlist.py ?

#

I mean the filename, not the import.

echo gate
zinc coralBOT
#
Python help channel closed for inactivity

This help channel has been closed. 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.