How to read the N first characters of a text file in Python

1 Answer

0 votes
f = open("d:\data.txt", "rt")  # OR f = open("d:\data.txt")

print(f.read(7))


'''
run:
 
C++
VB.

'''

 



answered Nov 26, 2018 by avibootz

Related questions

1 answer 201 views
1 answer 187 views
1 answer 170 views
1 answer 204 views
1 answer 180 views
...