naming - Is it ok to use dashes in Python files when trying to import them? -
basically when have python file like:
python-code.py
and use:
import (python-code)
the interpreter gives me syntax error.
any ideas on how fix it? dashes illegal in python file names?
you should check out pep 8, style guide python code:
package , module names modules should have short, all-lowercase names. underscores can used in module name if improves readability. python packages should have short, all-lowercase names, although use of underscores discouraged.
since module names mapped file names, , file systems case insensitive , truncate long names, important module names chosen short -- won't problem on unix, may problem when code transported older mac or windows versions, or dos.
in other words: rename file :)
Comments
Post a Comment