Why are underscores better than hyphens for file names?

前端 未结 2 1769
闹比i
闹比i 2020-12-28 11:52

From Building Skills in Python:

A file name like exercise_1.py is better than the name execise-1.py. We can run both program

2条回答
  •  春和景丽
    2020-12-28 12:09

    From that very document (p.368, Section 30.2 'Module Definition'):

    Note that a module name must be a valid Python name... A module's name is limited to letters, digits and "_"s.

提交回复
热议问题