Note of "Learn Python the HardWay"
来源:互联网 发布:先锋软件学院 编辑:程序博客网 时间:2024/05/16 12:36
1.SetUp &Environment [Important before Staring!]
Just use the Notepad++ to edit it, and use the PowerShell(Windows) to run it.-------For a better learning of Python!
2.Print(Output)
This can be very basic. Just be skillful at "%s, %d, %r".
Pay attention to the difference of "%s" and "%r"---------- %r is usually used in debugging, it just prints out the raw representation of what you typed.
%d for integer, %f for float........
3.Input
Two ways------raw_input() [just don't use input()] orargv
4.Reading & Writing of Files
- close -- Closes the file. Like File->Save.. in your editor.
- read -- Reads the contents of the file. You can assign the result to a variable.
- readline -- Reads just one line of a text file.
- truncate -- Empties the file. Watch out if you care about the file. should in mode['w']
- write('stuff') -- Writes "stuff" to the file. should in mode['w']
5.About Functions
This can be easy because the Function in Python is almost just like it in other languages like Java or C++...
NoNoNo...Pay attention to use the keyword "def"
6.Reading more codes
Once upon you have know the basic usage, you need to read some codes-----in github or something else.
For example, I'm reading "geekcomputers" from github.com! See you soon. Only to find it to easy(?Nope,,,but it's structure to easy = =?)
Then I find the "kennethreitz/requests" in github. It is a HTTP library written in Python and based on urllib.
Appendix:
1. To get a brief introduction ---------Eg:
Windows下输入:python -m pydoc raw_input [查看函数介绍]
- Note of "Learn Python the HardWay"
- Learn Python The Hard Way exercise 41 note
- hardway learning python 0730
- hardway learning python 0730
- python scikit-learn, note 20161209
- Note Of Python
- note of code in python
- learn python the hard way48
- Learn Python The Hard Way
- Learn Python The Hard Way
- learn python the hardest way
- The NOTE of learning ASP.NET [1]
- The NOTE of learning ASP.NET [4]
- note-of-Designing-the-Moment-Hoekman,R
- The first day of learn java
- learn of python driver for mongodb
- Installing scikit-learn note
- How to Learn Note
- ava.math.Math类常用的常量和方法:
- vnc配合oracle sqldeveloper 本地基本连接操作 centos
- HashMap实现原理分析(转自 Alpha's 学习笔记 )
- 某研究所“大数据分析及处理技术”内训圆满结束!
- Python递归查找文件(os.walk, os.path, fnmatch)
- Note of "Learn Python the HardWay"
- ImageView setImageBitmap 不显示图片
- 项目没有错但是有红叉号
- Android屏幕适配全攻略(最权威的官方适配指导)
- 基于VRRP协议的Keepalived原理详解
- 全国五大热招行业公布 看看哪家最有“钱”
- ACE6.3.3 在Linux上的安装
- PHP从头开始-4
- 下拉框处理后台list