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 193 views
1 answer 179 views
1 answer 164 views
1 answer 196 views
1 answer 172 views
...