1、用write函数写入文件
poem = "This is a poem" dirs = '/Users/joseph/work/python/' filename = 'poem.txt' path = dirs + filename f = open(path, 'w') f.write(poem) f.close()
2、设置字体大小
实例:将字体大小更改为16(默认值为8)
import turtle as t t.write('中国', font=("Arial", 16))
上一篇:怎么在php中实现一个装饰器模式
下一篇:如何在PHP中使用func_num_args函数