![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
自学
文章平均质量分 51
魏洪旭
还不错的
展开
-
raw_input() 与 input() __ Python 的区别
转自其它博客论坛,仅供参考 raw_input() 与 input() __ Python 这两个均是 python 的内建函数,通过读取控制台的输入与用户实现交互。但他们的功能不尽相同。举两个小例子。 1 >>> raw_input_A = raw_input("raw_input: ") 2 raw_input: abc 3 >>> input_A =转载 2016-04-15 07:54:22 · 252 阅读 · 0 评论 -
python 中 del 的用法
python 中 del 的用法 用法一 >>> a = [1, "two", 3, "four"] >>> del a[0] #删除列表a中,下标为0的元素 >>> a ['two', 3, 'four'] >>> a.append("five") >>> a.append(6) >>> a ['two', 3, 'four', 'five', 6] >>> del a[2:4]原创 2016-05-05 09:15:39 · 18246 阅读 · 1 评论 -
用tensorflow在mnist数据集上做测试
用tensorflow在mnist数据集上做测试方法:softmax regressionfrom tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot = True)输出: Successfully downloaded train原创 2017-03-22 15:55:34 · 450 阅读 · 0 评论 -
if __name__ == '__main__': 原理
当python编译器执行一个代码文件时,会执行文件中所有的代码 但在执行代码前,编译器会定义一个特殊的变量。例如,如果编译器将当前的 module 作为主程序,它会将 __name__ 这个变量赋值为 "__main__" 如果这个文件被其他文件(module)导入, __name__ 这个变量赋值为这个文件(module)的文件名。 # a.py import b原创 2017-09-07 11:02:22 · 203 阅读 · 0 评论