编写一个程序,提示用户输入起名字;用户做出像影后,将其名字写入到文件guest.txt中
Python2.7
#!/usr/bin/env python
# -*- coding: utf-8 -*-
your_name=raw_input('Please write down your name:')
filename='guest.txt'
with open(filename,'w') as file_object:
file_object.write(your_name)
编写一个程序,提示用户输入起名字;用户做出像影后,将其名字写入到文件guest.txt中
Python2.7
#!/usr/bin/env python
# -*- coding: utf-8 -*-
your_name=raw_input('Please write down your name:')
filename='guest.txt'
with open(filename,'w') as file_object:
file_object.write(your_name)