how to read text frome another file pythion

Solutions on MaxInterview for how to read text frome another file pythion by the best coders in the world

showing results for - "how to read text frome another file pythion"
Alessandro
01 Jan 2018
1f = open("Myfile.txt", "r")
2print(f.read())  #this is it if your using visual studio code.
3					
4                    # it may work on other things but try it.
5                    
6                    	#here is the other bit of code for the other file 
7                        
8                        
9                        
10#-------------------------------------------------------------------------
11 									#this will overwrite anything in the text file!!!
12                                    when you run the code
13file1 = open("MyFile.txt","w+")  #this is the code to add text to the file 
14
15file1.readline() 
16
17file1.write("boy") #where you type in to add text to fiel
18
19
20file1.close() # to close the file
21
Calvin
07 May 2020
1fin = open("NAME.txt", 'r')
2body = fin.read().split("\n")
3line = fin.readline().strip()
queries leading to this page
read in a file in python and print itreading text file in pythonpython file readpython open filereading from a file in pythonread a notepad file in pythonread from a file in pythonreading file in pythonopen txt pythonhow to read a text file in pythonhow to read file suing pyhonfiel open python 3python read txttxt file python read by rowopen a text file in pythonfiles pythonreading text pythonget text file pythonread text file in python by linereading a text file in pythonpython read from filepython read to filehow to read something in notepad pythonpyhton read filefile read pythonhow to read from files pythonopen a file in pythonpython with open filereading file pythonwhat is read file in pythonread txt pythonpython how to read a text filepython open txtread a file pythonhow to read text file in pythonread a file in pythonget data from text file pythonread text in txt pythonopen file pythonread and print text file in pythonpython read content of fileread file pythonread text file in pythontext file pythonreading pyuthon filepython file read formatted textpython read text file lineread txt files pythonhow to read a file in pythonread data from file pythonread a text file in pythonpython file readinghow to read a txt file in pythonreading a filein pythonreading file python3open a file pythonreading and writing files in pythonreading a filehow to read text frome another file pythionpython read pyton filehow to get text from file pythonpython file handling readpython3 open file for readingopening txt files in pythonpython file readerpython open a filehow to import a text file in pythonread text file in pythonopen file for reading in pythonpython read filereading writing files pythonhow to read text frome another file pythion