标签:images get code int 学习 技术分享 port img 菜鸟
1.os.chdir()切换到指定目录下,os.getcwd(),得到当前目录。
>>> import os
>>> os.chdir(‘D:\\CodeDocuments\\python code\\python head first code\\03chapter3‘)
>>> os.getcwd()
‘D:\\CodeDocuments\\python code\\python head first code\\03chapter3‘
2.print(,end=‘‘)加end=‘‘,则打印时不换行,若不加,则会换行。
>>> data=open(‘sketch.txt‘)
>>> print(data.readline(),end=‘‘)
Man: Is this the right room for an argument?
>>> print(data.readline())
Other Man: I‘ve told you once.
>>> print(data.readline())
Man: No you haven‘t!
>>> print(data.readline(),end=‘‘)
Other Man: Yes I have.
3.
标签:images get code int 学习 技术分享 port img 菜鸟
原文地址:http://www.cnblogs.com/hebulingding/p/7460352.html