python
文章平均质量分 56
daydayfat
这个作者很懒,什么都没留下…
展开
-
python alarm
import timeimport tkMessageBoxstime = time.time()while time.time() - stime time.sleep(2) #I prefer it sleeps longer.else:tkMessageBox.askquestion("Delete", "Time up", icon="warnin原创 2013-03-29 09:39:24 · 1695 阅读 · 0 评论 -
Duck Typing
Python is a duck-typed language.Duck typing is a style of dynamic typing in which an object's methods and properties determine the valid semantics, rather than the inheritance from a specificc原创 2013-04-01 08:59:46 · 513 阅读 · 0 评论 -
python 'type' - dynamically creating a class
As you may already know, in python, a class is also an object. If you haven't known this, then you can just imagine everything in python is an object until you figure things out.原创 2013-04-03 10:06:32 · 592 阅读 · 0 评论 -
python immutable and mutable
When beginning with python, you may probably get involved in the caos caused by the immutable and mutable concepts in python. Yes, python has no such stuff as pointers as you love so mu原创 2013-04-03 17:01:03 · 846 阅读 · 0 评论 -
The default parameter of python functions
As I've said in a previous article, every thing in python is a object, maybe there are exceptions, but it's good enough to think in this way at the beginning. So, function is a object.原创 2013-04-03 17:52:02 · 549 阅读 · 0 评论 -
一个python 小游戏
学习 python 一段时间。 今天 练习做了个 贪吃蛇, 一共才 150 多行。 把代码贴这里了。(有没有方法打包传上来呢? )这个是 主程序 run.pyfrom Tkinter import *from modsfd import snakefrom modsfd import foodfrom time import sleep原创 2013-03-22 17:30:47 · 656 阅读 · 0 评论 -
ctime pitfall
We can get the time information of a file from python using the following code:1. import os.path, time modify_time = time.ctime(os.path.getmtime(file)) create_time = tim原创 2013-03-26 17:59:37 · 693 阅读 · 0 评论