Hello,
I would greatly appreciate it if anyone could help me.
I saved a text file in the C drive of my computer. I need to use open the text file to do my homework. But when I used the Python 3.7 to open the file, I got error message: NO SUCH FILE OR DIRECTORY.
What should I do to open the file using the Python.
Many thanks for your help.
There might be the possibility that the file you are trying to open is actually missing. Or you are making a mistake in writing the file path. Check these two things first. Below is a working example of reading a text file from the C drive on my computer using Python 3.7. To resolve these issues you can copy and paste the location of your file directly from the file explorer. You may also try to create a new file and check whether it is opened or not, there might be if there are some security issues involved.
Note: You have to duplicate the backslashes in the file path as:
C:\\Users\\beejb\\Desktop\\Instruction Manual.txt
Or else it will throw a unicode error.
CODE:
# the file handler
fh =open("C:\\Users\\beejb\\Desktop\\Instruction Manual.txt")
#a simple for loop to print the lines of the given text file
for line in fh:
print(line)
OUTPUT:
Hello, I would greatly appreciate it if anyone could help me. I saved a text file...
Hello there! I would really appreciate it if you could help me with this question. God bless you
Hello there I would really appreciate it if you could help me out with question 1 b). God bless you
Hello! I'd greatly appreciate it if someone could help me out with this problem. "Complete the following program, which should allow the user to repeatedly enter input until a sentinel value of 0 is seen. Once input has finished, the program should show the average of the user's data, excluding the sentinel value itself. You may assume that the user will enter at least one non-sentinel value" import java.util.Scanner; public class SentinelValue { public static void main(String [] args) {...
Hello; I would greatly appreciate your help with providing a solution to a problem that I'm having trouble with. Thank you! Write a program that reads a set of integers and then finds and prints the sum of the even and odd integers. The numbers will be read in from the user via the cin statement. You do not know how many numbers the user may enter. When the user enters a 0 (zero), then the user is done entering...
Hello, I am attempting to write a basic shell script using bash. It will need to print the user, host, time, and date. It will need to take user input for a txt file to be searched and create a new file to save the results. It must print the number of lines and characters in the text. The user will need to enter three words to be searched, and the number of occurrences of those words in the text...
hello, i need some help and would appreciate someone could patiently read the following :) i need help with a small part of my physics lab. the purpose of the lab is to come up with an object that reflects the light and also measure various angles of incidence as well as those of reflection, while deciding if they are related. Up to this point my professor used one of these: I recorded the angle of incidence and corresponding angle...
If somebody could assist me with the below questions, I would greatly appreciate it! Thank you! 1. Discuss the trade-off between strength and ductility in design. For example, are there design situations where ductility would be more important than strength? 2. Is there any range of stress that can be applied to a material without appreciably altering some of its material properties? Explain. **I would really appreciate it if the answer could be typed!
please help me understand this. I will greatly appreciate a fully detailed answer as I want to understand this problem than just get the answer. Thanks. Random variables X and Y arejointly Gaussian with 2] 4 -4 m=[1 1. Find the correlation coefficient between X and Y. 3. Find the PDF of Z.
Hello to anyone who can help me! I did a lab and we have to write the molecular, ionic and net ionic equations for all the confirmed Precipitates. I been having trouble understanding how to do equations so if someone can help me I would appreciate it. Pb(NO3)2+NaOH KIO3+Na2S Pb(NO3)2+Na2S BaC12+Na2SO4 Pb(NO3)2+Na2SO4 Pb(NO3)2+KIO3 Na2S+BaC12 Na2SO4+BaC12 KCLO3+BaCI2 NH4CI+BaC12
I would greatly appreciate if someone can assist me with this question. This question has to do with the command line on Linux. Thank you. QUESTION 8 What do hidden files and directories have that regular files and directories do not? Response. 10 points 1 BI U $ = 3 !!! Your response... O words Attach file(s) Max size 500 MB DRAG & DROP - save cancel