Is it ok to use dashes in Python files when trying to import them?

You should check out PEP 8, the Style Guide for Python Code:

Package and Module Names Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability. Python packages should also have short, all-lowercase names, although the use of underscores is discouraged.

Since module names are mapped to file names, and some file systems are case insensitive and truncate long names, it is important that module names be chosen to be fairly short — this won’t be a problem on Unix, but it may be a problem when the code is transported to older Mac or Windows versions, or DOS.

In other words: rename your file 🙂

Leave a Comment