Skip to content

Instantly share code, notes, and snippets.

@hamaguchi-amago
Created December 26, 2022 11:59
Show Gist options
  • Save hamaguchi-amago/a64a65986424a407cbe7429a90a07606 to your computer and use it in GitHub Desktop.
Save hamaguchi-amago/a64a65986424a407cbe7429a90a07606 to your computer and use it in GitHub Desktop.
import python_const_0 as Pt
Pt.MAX_TIME = 10
Pt.METHOD = "GET"
def main():
print(Pt.MAX_TIME)
print(Pt.METHOD)
# 代入できない
Pt.MAX_TIME = 10
if __name__ == '__main__':
main()
@hamaguchi-amago
Copy link
Author

ブログで作成しました。

【Python】プログラム中に定数を扱う注意点
https://neko-py.com/python-constants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment