![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
学习python
cutelily2014
这个作者很懒,什么都没留下…
展开
-
print local time by Python3
# ============== CODE============== #!/usr/bin/python3 import time time_tick = time.time() time_date = time.localtime(time_tick) #print(time_tick, time_tick%1) print("current time: year-month-dat...原创 2020-03-23 11:21:29 · 132 阅读 · 0 评论 -
exception in Python3
Some excercise about exception issue in Python3.5 Sample Zero: #!/usr/bin/env python3 try: # hello exception ! x = input("Enter the first number: ") y = input("Enter the second number: ")...翻译 2018-12-19 15:17:57 · 178 阅读 · 0 评论 -
Floyd algorithm in Python3.5
#!/usr/bin/env python3 # Refer to: http://wiki.jikexueyuan.com/project/easy-learn-algorithm/floyd.html # Comments: The Floyd algorithm can tell how much the nearest path between 2 vertex costs N = 4...原创 2018-08-30 15:36:28 · 221 阅读 · 0 评论 -
Dijkstra algorithm in Python3.5
#!/usr/bin/env python3 # Refer to: http://wiki.jikexueyuan.com/project/easy-learn-algorithm/dijkstra.html # Comments: The Dijkstra algorithm can tell what is the shortest path and how much it cost. c...原创 2018-08-30 14:40:59 · 289 阅读 · 0 评论 -
mqtt client communication
I write 2 mqtt clients with Python2.7: mqtt_talk.py and mqtt_listen.py, they get publisher and subscriber inside. Take mqtt_talk.py as example, once received a mqtt message from mqtt_listen.py, it ech...原创 2018-08-28 18:04:32 · 239 阅读 · 0 评论 -
mqtt publish and subscribe with Python
Assume you have read some introduction papers about MQTT(like here: https://pypi.org/project/paho-mqtt/) I write 2 Python scripts with python2.7: mqtt_talk.py as publisher, mqtt_listen.py as subscrib...原创 2018-08-28 17:39:20 · 444 阅读 · 0 评论 -
write in and read from TXT file by python
Simple example to open a new TXT file and write down some helpful data.import timefin = open("data.txt", "w")fin.write(str(1000 * round(time.time())))fin.write("Hello Python World !")fin.write("\n")fi...原创 2018-05-11 15:35:45 · 300 阅读 · 0 评论 -
KNN algorithm in Python
This is a homework of Computer Vision class(2017) of Feifei Li, CS231n, Stanford University. I prefer to focus on single task of every assignment in one blog, so I will display my work for task1 in as...原创 2018-04-26 21:55:06 · 215 阅读 · 0 评论 -
第一个python代码
因为之前没怎么用过ubuntu,也没怎么写过python,所以这方面的经验需要不断积累,这里主要介绍怎么写一个hello world 代码。 1.首先打开ubuntu中的终端,会看到一行字后面跟着“~$”的标识,在这个标识后面就可以做各种操作,比如我想知道现在自己所在的文件地址,可以用命令“pwd”来查询地址; 2.现在可以写一个简单的代码了,打开刚才查询得到的那个路径,右键,选择“新建文档”原创 2017-03-07 13:37:25 · 534 阅读 · 0 评论 -
python第一天
近来着手写python,它常被归为脚本语言,关于什么叫做脚本语言,我也不太明白,只是知道python简洁快速,据说很强大,并且容易上手,对python我也刚接触不几天,希望自己一边学习一边记录,能够慢慢增长在python编码中的知识。 对编程语言,思路上都类似,为了更好学习python 的编码规则,需要安装一个平台去编写python代码,关于软件下载可以看看网易公开课中小甲鱼老师的讲解,链接:h原创 2017-02-20 16:33:01 · 414 阅读 · 0 评论