791e09b24641b6d372ba08c59b6b801440c767b2,fileinfo.py,,,#,19

Before Change


if sys.version_info >= (3, 0):
    raw_input = input

try_count = 16

while try_count:
    file_name = raw_input("Enter a file name: ")      // pick a file you have
    fhand = open(file_name)
    count = 0
    for lines in fhand:
        count = count + 1
    fhand = open(file_name)
    inp = fhand.read()
    t_char = len(inp) 
    try_count >>= 1
    try:
        file_stats = os.stat(file_name)
        print ("This is os.stat",file_stats)
        break
    except OSError:
        print ("\nNameError : [%s] No such file or directory\n", file_name)

if try_count == 0:
    print ("Trial limit exceeded \nExiting program")
    sys.exit()
    

After Change



file_name = raw_input("Enter a file name: ")      // pick a file you have
count = 0
t_char = 0
try:
    with open(file_name) as f:
        line = f.readline()
        t_char += len(line)
        while line:
            count += 1
            line = f.readline()
            t_char += len(line)
except FileNotFoundError as e:
    print(e)
    sys.exit()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: geekcomputers/Python
Commit Name: 791e09b24641b6d372ba08c59b6b801440c767b2
Time: 2019-08-14
Author: 35282147+Hong199@users.noreply.github.com
File Name: fileinfo.py
Class Name:
Method Name:


Project Name: geekcomputers/Python
Commit Name: 791e09b24641b6d372ba08c59b6b801440c767b2
Time: 2019-08-14
Author: 35282147+Hong199@users.noreply.github.com
File Name: fileinfo.py
Class Name:
Method Name:


Project Name: biotite-dev/biotite
Commit Name: c1f7c876399b3b5859d50175c3c349b237c3e714
Time: 2018-03-23
Author: patrick.kunzm@gmail.com
File Name: src/biotite/structure/residues.py
Class Name:
Method Name: apply_residue_wise


Project Name: biotite-dev/biotite
Commit Name: c1f7c876399b3b5859d50175c3c349b237c3e714
Time: 2018-03-23
Author: patrick.kunzm@gmail.com
File Name: src/biotite/structure/residues.py
Class Name:
Method Name: spread_residue_wise