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()
    >>> 
    
  • 相关阅读:
    C++中Map的使用 (个人简单的对于String的使用)
    具体数学二项式至生成函数章-----致敬Kunth
    C++中String的使用
    C++中Set的使用
    费马小定理,欧拉函数
    数论---同余法则定理
    灵活利用单链表,顺带一提可持久化链表。
    第2章 数字之魅——数字中的技巧
    Mail.Ru Cup 2018 Round 1
    Lyft Level 5 Challenge 2018
  • 原文地址:https://www.cnblogs.com/oskb/p/4828700.html
Copyright © 2011-2022 走看看