python 中的全局变量是什么概念?是在一个模块中定义的,它的作用域是什么?在一个文件中定义的全局变量,在其它的文件中要使用那个变量要怎么使用呢?有没有那种像C语言的中的全局变量一样,然后在整个程序中都可以用的?
认证高级PHP讲师
If you want to use C language, you have to declare it as extern. Python just needs to be imported.
a.py: AAA='AAA' b.py: from a import AAA print AAA AAA='123'
By default, the scope is only the file that defines it. To use other files, you need to import
If you want to use C language, you have to declare it as extern. Python just needs to be imported.
By default, the scope is only the file that defines it. To use other files, you need to import