我的问题是如何在 python 中初始化全局字符串变量例如,当我执行以下操作时。
24 def global_paths():
25 global RUN_PATH
26 global BASE_PATH
27 global EXE_SUFIX
28 global SPEC_PATH
29 global cmd_list
30
31 global RUN_PATH = "/run/run_base_ref_amd64-m64-gcc43-nn.0000/"
32 global BASE_PATH = "/SPECcpu2006/1.1/cdrom"
33 global EXE_SUFIX = "_base.amd64-m64-gcc43-nn"
34 global SPEC_PATH = BASE_PATH + "/benchspec/CPU2006/"
35 global cmd_list = {}
我得到错误:
global RUN_PATH = "/run/run_base_ref_amd64-m64-gcc43-nn.0000/"
^
SyntaxError: invalid syntax
我在做什么错误?
问题与此类似