Feb-10-2023, 09:39 PM
Myself is ted,
i am trying open a text file in python using open("filename.txt") but i am seeing FileNotFoundError: [Errno 2] No such file or directory: 'new.text' this error, every time i tired to open or manipulate a file i am seeing this error.The name of file i inputted is right and i also created python file and text file In a folder and i tried to open using the above syntax still showing the same error , can anyone give me the solution ?
this is the code i am using to open a file in python:
h = open("new.text")
x = h.split()
print(x)
i am trying open a text file in python using open("filename.txt") but i am seeing FileNotFoundError: [Errno 2] No such file or directory: 'new.text' this error, every time i tired to open or manipulate a file i am seeing this error.The name of file i inputted is right and i also created python file and text file In a folder and i tried to open using the above syntax still showing the same error , can anyone give me the solution ?
this is the code i am using to open a file in python:
h = open("new.text")
x = h.split()
print(x)
Attached Files