博主刚刚开始学Python,看到网上关于PyCharm如何设置的教程都太老了,基本上都是三年以前的,所以博主写个PyCharm5版本的吧。1.点击File→Settings:2.依次点击Editor→General→Appearance,在右侧勾选Show line numbers,点击OK。
分类:
其他好文 时间:
2015-12-02 17:44:47
阅读次数:
6578
开始自学Python环境配置自己百度去!!!计算与变量字符创、列表、元组和字典简单的画图使用if和else条件控制语句循环使用函数和模块来重用代码使用类和对象Python内建函数的介绍常用的Python模块高级作图用tkinter画高级图形游戏1:弹球游戏2:火柴人逃生
分类:
编程语言 时间:
2015-11-29 13:23:32
阅读次数:
136
初学 Python 的开发者经常会发现很多 Python 函数中用到了 yield 关键字,然而,带有 yield 的函数执行流程却和普通函数不一样,yield 到底用来做什么,为什么要设计 yield ?本文将由浅入深地讲解 yield 的概念和用法,帮助读者体会 Python 里 yield 简...
分类:
编程语言 时间:
2015-11-25 16:41:36
阅读次数:
205
#import ex25 1 def break_words(stuff): 2 """This function will break up words for us.""" 3 words = stuff.split(' ') 4 return words 5 ...
分类:
编程语言 时间:
2015-11-21 14:25:16
阅读次数:
238
# -*- coding:utf-8 -*-class MyClass: """A simple example class""" i = 12345 def __init__(self, l, r): self.data = [] self.l=l ...
分类:
编程语言 时间:
2015-11-20 19:16:07
阅读次数:
178
一朝误入此门中,从此红尘了如空、、、、程序这条路,当真是路漫漫、、、这两天找到一本书,名为《笨方法学Python第三版》,全实例,感觉挺好的。需要的点书名下载,密码:gmpn今天想说的是习题17,先看书中源码: 1 from sys import argv 2 from os.path import...
分类:
编程语言 时间:
2015-11-20 12:06:07
阅读次数:
201
# -*- coding:utf-8 -*-from collections import deque__author__ = 'hunterhug'mylist = [2, 3, 4, 5]print(mylist)mylist.append(3) # 添加元素到链尾print(mylist)my...
分类:
编程语言 时间:
2015-11-19 22:16:34
阅读次数:
285
最近看到pypy可以提高python的运行速率到很变态的境地,加之现在ryu发现拓扑的能力有限,不能满足实验要求,所以想将其试着在pypy上运行部署pypy在virtualenv,在学python初期,就听闻python的三大神器:pip、virtualenv和fabric,前面只是尝试了下virt...
分类:
其他好文 时间:
2015-11-19 13:13:15
阅读次数:
272
# -*- coding:utf-8 -*-__author__ = 'hunterhug'#x = int(input("请输入一个数:\n"))x=5if x 0")str=['fds', 'sdfsdf', '2',"h"]for k in str: print(k, len(k))#在...
分类:
编程语言 时间:
2015-11-18 22:54:00
阅读次数:
216
# -*- coding:utf-8 -*-__author__ = 'hunterhug'print("你好")#打印hello = "This 'is' \"a rather long string containing\n\ several lines of text just as y...
分类:
编程语言 时间:
2015-11-17 23:24:01
阅读次数:
222