Is it ok to use dashes in Python files when trying to import them?
问题 Basically when I have a python file like: python-code.py and use: import (python-code) the interpreter gives me syntax error. Any ideas on how to fix it? Are dashes illegal in python file names? 回答1: 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