If you want to read the text file. Use the following code:
with open("welcome.txt", 'r') as file:
data = file.read()
print(data)
- If you want to read images in python, you should use matplotlib library:
from matplotlib import pyplot
im = pyplot.imread(filename)
pyplot.imshow(im)
- To unpack rar files using python use the following code:
from pyunpack import Archive
Archive('a.zip').extractall('/path/to')
Comments
0 comments
Article is closed for comments.