解决Python报错:local variable 'xxx' referenced before assignment(引)
来源:互联网 发布:kali linux攻击服务器 编辑:程序博客网 时间:2024/06/05 17:08
解决Python报错:local variable 'xxx' referenced before assignment(引)
(2011-03-03 15:51:23)转载▼
标签:
python
编程
it
分类: 编程这个问题很囧,在外面定义了一个变量 xxx ,然后在python的一个函数里面引用这个变量,并改变它的值,结果报错local variable 'xxx' referenced before assignment,代码如下:
view plaincopy to clipboardprint?
- xxx
= 23 - def
PrintFileName(strFileName): -
if xxx 23:== -
print strFileName -
xxx = 24 -
- PrintFileName("file")
view plaincopy to clipboardprint?
- xxx
= 23 - def
PrintFileName(strFileName): -
global xxx -
if xxx 23:== -
print strFileName -
xxx = 24 -
- PrintFileName("file")
- 解决Python报错:local variable 'xxx' referenced before assignment
- 解决Python报错:local variable 'xxx' referenced before assignment(引)
- python 报错 :local variable 'totalCount' referenced before assignment
- python报错:local variable 'xxxx' referenced before assignment
- python的UnboundLocalError: local variable 'xxx' referenced before assignment
- python的UnboundLocalError: local variable 'xxx' referenced before assignment
- Python的UnboundLocalError: local variable 'xxx' referenced before assignment
- python出错:local variable XXX referenced before assignment
- Python进阶(三十二)-local variable 'xxx' referenced before assignment
- Python的UnboundLocalError: local variable 'xxx' referenced before assignment
- local variable 'xxx' referenced before assignment
- local variable 'xxx' referenced before assignment
- local variable 'xxx' referenced before assignment
- local variable 'xxx' referenced before assignment
- local variable 'xxx' referenced before assignment
- UnboundLocalError: local variable 'XXX' referenced before assignment
- local variable XXX referenced before assignment
- local variable 'xxx' referenced before assignment
- Linux系统学习笔记:程序的机器级表示
- tomcat7 - cacti 备忘
- 群集学习
- Linux系统学习笔记:链接
- 调用Android手机自带的闪光灯
- 解决Python报错:local variable 'xxx' referenced before assignment(引)
- ByteBuffer转String的方法
- Linux2.4-net源码学习笔记 IP层协议栈的实现(II IP数据报路由)
- MyEclipse使用经验总结
- git for windows (又名 msysgit)如何记住用户名和密码 (亲测)
- Linux系统学习笔记:异常控制流
- cgi error:用iis运行php5.3以下版本报cgi错误
- Windows Phone 加速度计的使用
- Linux系统学习笔记:存储器