zoukankan      html  css  js  c++  java
  • Python 从sketch中读取文件

    =============================== RESTART: Shell ===============================
    >>> import os
    >>> os.getcwd()
    'C:\Windows\System32'
    >>> os.chdir('C:/Users/eric/Documents/Python')
    >>> os.getcwd()
    'C:\Users\eric\Documents\Python'
    >>> data = open ('sketch.txt')
    >>> print (data.readline(),end='')
    Man: Is this the right room for an argument?
    >>> print (data.readline(),end='')
    Other Man: I've told you once.
    >>> data.seek(0)
    0
    >>> for each_line in data:
    	print(each_line, end='')
    
    	
    Man: Is this the right room for an argument?
    Other Man: I've told you once.
    Man: No you haven't!
    Other Man: Yes I have.
    Man: When?
    Other Man: Just now.
    Man: No you didn't!
    Other Man: Yes I did!
    Man: You didn't!
    Other Man: I'm telling you, I did!
    Man: You did not!
    Other Man: Oh I'm sorry, is this a five minute argument, or the full half hour?
    Man: Ah! (taking out his wallet and paying) Just the five minutes.
    Other Man: Just the five minutes. Thank you.
    Other Man: Anyway, I did.
    Man: You most certainly did not!
    Other Man: Now let's get one thing quite clear: I most definitely told you!
    Man: Oh no you didn't!
    Other Man: Oh yes I did!
    Man: Oh no you didn't!
    Other Man: Oh yes I did!
    Man: Oh look, this isn't an argument!
    (pause)
    Other Man: Yes it is!
    Man: No it isn't!
    (pause)
    Man: It's just contradiction!
    Other Man: No it isn't!
    Man: It IS!
    Other Man: It is NOT!
    Man: You just contradicted me!
    Other Man: No I didn't!
    Man: You DID!
    Other Man: No no no!
    Man: You did just then!
    Other Man: Nonsense!
    Man: (exasperated) Oh, this is futile!!
    (pause)
    Other Man: No it isn't!
    Man: Yes it is!
    >>> data.close()
    >>> 
    
  • 相关阅读:
    文字超出2行显示省略号
    js调试工具console方法详解
    下厨如有神
    画地为牢——广州经济困局
    数字桩和记忆术
    想象力提高记忆能力的重要能力
    三元色
    轻松自我介绍三步走——曼陀罗思考法
    英语单词_巩固方法草稿A
    http、TCP/IP协议与socket之间的区别
  • 原文地址:https://www.cnblogs.com/oskb/p/4828700.html
Copyright © 2011-2022 走看看