pycharm wont read a txt file on my macbook?
I have a code that needs to sort race times from a text file, this is what I have so far,
def get_sec(time_str):
h, m = time_str.split(':')
return int(h) * 3600 + int(m) * 60
with open("Race_Results_Sample.txt", "r")as myList:
myList = myList.read()
myList = [l.split(",") for l in myList.splitlines()]
myList = sorted(myList, key=lambda kv: kv[1])
for line in myList:
num, last, org, time = line
place =
place.append(time)
placenum = enumerate(sorted(place))
print(place, placenum)
for rank, value in enumerate(sorted(place)):
print(rank, value)
for line in myList:
num, last, org, time = line
new_time = get_sec(time)
mile = round((((new_time/ 3.10686)/60)/60), 3)
mile = str(mile)
print ('{:<20s}{:<5s}{:<5s}{:<7s}{:<10s}'.format(last, num, org,
time, mile))
and when trying to get the code to run, I get the following message:
Traceback (most recent call last):
File
"/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/scratch.py",
line 5, in <module>
with open("Race_Results_Sample.txt", "r")as myList:
IOError: [Errno 2] No such file or directory: 'Race_Results_Sample.txt'
what is going on to where it can't read the text file? I have the text file on my desktop.
python
add a comment |
I have a code that needs to sort race times from a text file, this is what I have so far,
def get_sec(time_str):
h, m = time_str.split(':')
return int(h) * 3600 + int(m) * 60
with open("Race_Results_Sample.txt", "r")as myList:
myList = myList.read()
myList = [l.split(",") for l in myList.splitlines()]
myList = sorted(myList, key=lambda kv: kv[1])
for line in myList:
num, last, org, time = line
place =
place.append(time)
placenum = enumerate(sorted(place))
print(place, placenum)
for rank, value in enumerate(sorted(place)):
print(rank, value)
for line in myList:
num, last, org, time = line
new_time = get_sec(time)
mile = round((((new_time/ 3.10686)/60)/60), 3)
mile = str(mile)
print ('{:<20s}{:<5s}{:<5s}{:<7s}{:<10s}'.format(last, num, org,
time, mile))
and when trying to get the code to run, I get the following message:
Traceback (most recent call last):
File
"/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/scratch.py",
line 5, in <module>
with open("Race_Results_Sample.txt", "r")as myList:
IOError: [Errno 2] No such file or directory: 'Race_Results_Sample.txt'
what is going on to where it can't read the text file? I have the text file on my desktop.
python
You have the file on your desktop. Is your script running in your desktop folder? Printos.getcwd()
.
– user2357112
Nov 28 '18 at 21:02
1
Pycharm's scratch files aren't stored in the same directory as your project. Either move the file to/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
or move your code into a non-scratch file in your project. Additionally you can also use the absolute path to the file which always works.
– Primusa
Nov 28 '18 at 21:03
I moved my code into a non-scratch file and I was still getting the same error
– jessicacates
Nov 28 '18 at 23:50
add a comment |
I have a code that needs to sort race times from a text file, this is what I have so far,
def get_sec(time_str):
h, m = time_str.split(':')
return int(h) * 3600 + int(m) * 60
with open("Race_Results_Sample.txt", "r")as myList:
myList = myList.read()
myList = [l.split(",") for l in myList.splitlines()]
myList = sorted(myList, key=lambda kv: kv[1])
for line in myList:
num, last, org, time = line
place =
place.append(time)
placenum = enumerate(sorted(place))
print(place, placenum)
for rank, value in enumerate(sorted(place)):
print(rank, value)
for line in myList:
num, last, org, time = line
new_time = get_sec(time)
mile = round((((new_time/ 3.10686)/60)/60), 3)
mile = str(mile)
print ('{:<20s}{:<5s}{:<5s}{:<7s}{:<10s}'.format(last, num, org,
time, mile))
and when trying to get the code to run, I get the following message:
Traceback (most recent call last):
File
"/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/scratch.py",
line 5, in <module>
with open("Race_Results_Sample.txt", "r")as myList:
IOError: [Errno 2] No such file or directory: 'Race_Results_Sample.txt'
what is going on to where it can't read the text file? I have the text file on my desktop.
python
I have a code that needs to sort race times from a text file, this is what I have so far,
def get_sec(time_str):
h, m = time_str.split(':')
return int(h) * 3600 + int(m) * 60
with open("Race_Results_Sample.txt", "r")as myList:
myList = myList.read()
myList = [l.split(",") for l in myList.splitlines()]
myList = sorted(myList, key=lambda kv: kv[1])
for line in myList:
num, last, org, time = line
place =
place.append(time)
placenum = enumerate(sorted(place))
print(place, placenum)
for rank, value in enumerate(sorted(place)):
print(rank, value)
for line in myList:
num, last, org, time = line
new_time = get_sec(time)
mile = round((((new_time/ 3.10686)/60)/60), 3)
mile = str(mile)
print ('{:<20s}{:<5s}{:<5s}{:<7s}{:<10s}'.format(last, num, org,
time, mile))
and when trying to get the code to run, I get the following message:
Traceback (most recent call last):
File
"/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/scratch.py",
line 5, in <module>
with open("Race_Results_Sample.txt", "r")as myList:
IOError: [Errno 2] No such file or directory: 'Race_Results_Sample.txt'
what is going on to where it can't read the text file? I have the text file on my desktop.
python
python
edited Nov 28 '18 at 22:12
Ctrl S
627724
627724
asked Nov 28 '18 at 21:01
jessicacatesjessicacates
182
182
You have the file on your desktop. Is your script running in your desktop folder? Printos.getcwd()
.
– user2357112
Nov 28 '18 at 21:02
1
Pycharm's scratch files aren't stored in the same directory as your project. Either move the file to/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
or move your code into a non-scratch file in your project. Additionally you can also use the absolute path to the file which always works.
– Primusa
Nov 28 '18 at 21:03
I moved my code into a non-scratch file and I was still getting the same error
– jessicacates
Nov 28 '18 at 23:50
add a comment |
You have the file on your desktop. Is your script running in your desktop folder? Printos.getcwd()
.
– user2357112
Nov 28 '18 at 21:02
1
Pycharm's scratch files aren't stored in the same directory as your project. Either move the file to/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
or move your code into a non-scratch file in your project. Additionally you can also use the absolute path to the file which always works.
– Primusa
Nov 28 '18 at 21:03
I moved my code into a non-scratch file and I was still getting the same error
– jessicacates
Nov 28 '18 at 23:50
You have the file on your desktop. Is your script running in your desktop folder? Print
os.getcwd()
.– user2357112
Nov 28 '18 at 21:02
You have the file on your desktop. Is your script running in your desktop folder? Print
os.getcwd()
.– user2357112
Nov 28 '18 at 21:02
1
1
Pycharm's scratch files aren't stored in the same directory as your project. Either move the file to
/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
or move your code into a non-scratch file in your project. Additionally you can also use the absolute path to the file which always works.– Primusa
Nov 28 '18 at 21:03
Pycharm's scratch files aren't stored in the same directory as your project. Either move the file to
/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
or move your code into a non-scratch file in your project. Additionally you can also use the absolute path to the file which always works.– Primusa
Nov 28 '18 at 21:03
I moved my code into a non-scratch file and I was still getting the same error
– jessicacates
Nov 28 '18 at 23:50
I moved my code into a non-scratch file and I was still getting the same error
– jessicacates
Nov 28 '18 at 23:50
add a comment |
1 Answer
1
active
oldest
votes
Your file is being run from "/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/scratch.py"
but you say the file is on your desktop. You will need to pass an absolute reference to the Desktop file.
I suggest moving the file to "/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
. Then you can find it with the relative reference you are using in your script i.e.
with open("Race_Results_Sample.txt", "r")as myList:
You should also make sure that you execute the script from that directory.
1
That's where the script is located, but the working directory isn't necessarily the same as the directory the script is in.
– user2357112
Nov 28 '18 at 21:03
so i changed my code to a python file instead of a scratch file, and i was still getting the same error
– jessicacates
Nov 28 '18 at 22:31
I suggest changing the code back to match your post. Next, move the fileRace_Results_Sample.txt
to the folder/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
. After this, run the script via Terminal. First runcd /Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
. Next run,python -m scratch
. Until you feel more confident with Python, I recommend using a simple text editor (like Atom or Sublime) and the shell to do your programming. The book/website Learn Python the Hard Way talks about this in chapter 0. Pycharm is probably overkill for this project.
– Joshua Cook
Nov 29 '18 at 0:36
I'm sorry, I cannot find on my MacBook, where to move the file. I have looked and looked, an I can not for the life of me, find it.
– jessicacates
Nov 30 '18 at 0:56
Ok start over. In your terminal: 1.cd ~ & mkdir -p src/race_res
2.cd src/race_res
3.touch race_results.py
4.mv ~/Desktop/Race_Results_Sample.txt ~/src/race_res
5. Openrace_results.py
in a simple text editor (Atom, Sublime, BBEdit). 6. Paste the contents of your script above into that file. 7.python -m race_results
///// Now you are working in a more basic fashion. Keep your files for this project in~/src/race_res
. Make changes in a text editor. Execute via the command line. Plenty of time to learn Pycharm later.
– Joshua Cook
Nov 30 '18 at 1:16
|
show 6 more comments
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53528028%2fpycharm-wont-read-a-txt-file-on-my-macbook%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Your file is being run from "/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/scratch.py"
but you say the file is on your desktop. You will need to pass an absolute reference to the Desktop file.
I suggest moving the file to "/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
. Then you can find it with the relative reference you are using in your script i.e.
with open("Race_Results_Sample.txt", "r")as myList:
You should also make sure that you execute the script from that directory.
1
That's where the script is located, but the working directory isn't necessarily the same as the directory the script is in.
– user2357112
Nov 28 '18 at 21:03
so i changed my code to a python file instead of a scratch file, and i was still getting the same error
– jessicacates
Nov 28 '18 at 22:31
I suggest changing the code back to match your post. Next, move the fileRace_Results_Sample.txt
to the folder/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
. After this, run the script via Terminal. First runcd /Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
. Next run,python -m scratch
. Until you feel more confident with Python, I recommend using a simple text editor (like Atom or Sublime) and the shell to do your programming. The book/website Learn Python the Hard Way talks about this in chapter 0. Pycharm is probably overkill for this project.
– Joshua Cook
Nov 29 '18 at 0:36
I'm sorry, I cannot find on my MacBook, where to move the file. I have looked and looked, an I can not for the life of me, find it.
– jessicacates
Nov 30 '18 at 0:56
Ok start over. In your terminal: 1.cd ~ & mkdir -p src/race_res
2.cd src/race_res
3.touch race_results.py
4.mv ~/Desktop/Race_Results_Sample.txt ~/src/race_res
5. Openrace_results.py
in a simple text editor (Atom, Sublime, BBEdit). 6. Paste the contents of your script above into that file. 7.python -m race_results
///// Now you are working in a more basic fashion. Keep your files for this project in~/src/race_res
. Make changes in a text editor. Execute via the command line. Plenty of time to learn Pycharm later.
– Joshua Cook
Nov 30 '18 at 1:16
|
show 6 more comments
Your file is being run from "/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/scratch.py"
but you say the file is on your desktop. You will need to pass an absolute reference to the Desktop file.
I suggest moving the file to "/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
. Then you can find it with the relative reference you are using in your script i.e.
with open("Race_Results_Sample.txt", "r")as myList:
You should also make sure that you execute the script from that directory.
1
That's where the script is located, but the working directory isn't necessarily the same as the directory the script is in.
– user2357112
Nov 28 '18 at 21:03
so i changed my code to a python file instead of a scratch file, and i was still getting the same error
– jessicacates
Nov 28 '18 at 22:31
I suggest changing the code back to match your post. Next, move the fileRace_Results_Sample.txt
to the folder/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
. After this, run the script via Terminal. First runcd /Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
. Next run,python -m scratch
. Until you feel more confident with Python, I recommend using a simple text editor (like Atom or Sublime) and the shell to do your programming. The book/website Learn Python the Hard Way talks about this in chapter 0. Pycharm is probably overkill for this project.
– Joshua Cook
Nov 29 '18 at 0:36
I'm sorry, I cannot find on my MacBook, where to move the file. I have looked and looked, an I can not for the life of me, find it.
– jessicacates
Nov 30 '18 at 0:56
Ok start over. In your terminal: 1.cd ~ & mkdir -p src/race_res
2.cd src/race_res
3.touch race_results.py
4.mv ~/Desktop/Race_Results_Sample.txt ~/src/race_res
5. Openrace_results.py
in a simple text editor (Atom, Sublime, BBEdit). 6. Paste the contents of your script above into that file. 7.python -m race_results
///// Now you are working in a more basic fashion. Keep your files for this project in~/src/race_res
. Make changes in a text editor. Execute via the command line. Plenty of time to learn Pycharm later.
– Joshua Cook
Nov 30 '18 at 1:16
|
show 6 more comments
Your file is being run from "/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/scratch.py"
but you say the file is on your desktop. You will need to pass an absolute reference to the Desktop file.
I suggest moving the file to "/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
. Then you can find it with the relative reference you are using in your script i.e.
with open("Race_Results_Sample.txt", "r")as myList:
You should also make sure that you execute the script from that directory.
Your file is being run from "/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/scratch.py"
but you say the file is on your desktop. You will need to pass an absolute reference to the Desktop file.
I suggest moving the file to "/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
. Then you can find it with the relative reference you are using in your script i.e.
with open("Race_Results_Sample.txt", "r")as myList:
You should also make sure that you execute the script from that directory.
edited Nov 28 '18 at 21:03
answered Nov 28 '18 at 21:02
Joshua CookJoshua Cook
3,55912026
3,55912026
1
That's where the script is located, but the working directory isn't necessarily the same as the directory the script is in.
– user2357112
Nov 28 '18 at 21:03
so i changed my code to a python file instead of a scratch file, and i was still getting the same error
– jessicacates
Nov 28 '18 at 22:31
I suggest changing the code back to match your post. Next, move the fileRace_Results_Sample.txt
to the folder/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
. After this, run the script via Terminal. First runcd /Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
. Next run,python -m scratch
. Until you feel more confident with Python, I recommend using a simple text editor (like Atom or Sublime) and the shell to do your programming. The book/website Learn Python the Hard Way talks about this in chapter 0. Pycharm is probably overkill for this project.
– Joshua Cook
Nov 29 '18 at 0:36
I'm sorry, I cannot find on my MacBook, where to move the file. I have looked and looked, an I can not for the life of me, find it.
– jessicacates
Nov 30 '18 at 0:56
Ok start over. In your terminal: 1.cd ~ & mkdir -p src/race_res
2.cd src/race_res
3.touch race_results.py
4.mv ~/Desktop/Race_Results_Sample.txt ~/src/race_res
5. Openrace_results.py
in a simple text editor (Atom, Sublime, BBEdit). 6. Paste the contents of your script above into that file. 7.python -m race_results
///// Now you are working in a more basic fashion. Keep your files for this project in~/src/race_res
. Make changes in a text editor. Execute via the command line. Plenty of time to learn Pycharm later.
– Joshua Cook
Nov 30 '18 at 1:16
|
show 6 more comments
1
That's where the script is located, but the working directory isn't necessarily the same as the directory the script is in.
– user2357112
Nov 28 '18 at 21:03
so i changed my code to a python file instead of a scratch file, and i was still getting the same error
– jessicacates
Nov 28 '18 at 22:31
I suggest changing the code back to match your post. Next, move the fileRace_Results_Sample.txt
to the folder/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
. After this, run the script via Terminal. First runcd /Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
. Next run,python -m scratch
. Until you feel more confident with Python, I recommend using a simple text editor (like Atom or Sublime) and the shell to do your programming. The book/website Learn Python the Hard Way talks about this in chapter 0. Pycharm is probably overkill for this project.
– Joshua Cook
Nov 29 '18 at 0:36
I'm sorry, I cannot find on my MacBook, where to move the file. I have looked and looked, an I can not for the life of me, find it.
– jessicacates
Nov 30 '18 at 0:56
Ok start over. In your terminal: 1.cd ~ & mkdir -p src/race_res
2.cd src/race_res
3.touch race_results.py
4.mv ~/Desktop/Race_Results_Sample.txt ~/src/race_res
5. Openrace_results.py
in a simple text editor (Atom, Sublime, BBEdit). 6. Paste the contents of your script above into that file. 7.python -m race_results
///// Now you are working in a more basic fashion. Keep your files for this project in~/src/race_res
. Make changes in a text editor. Execute via the command line. Plenty of time to learn Pycharm later.
– Joshua Cook
Nov 30 '18 at 1:16
1
1
That's where the script is located, but the working directory isn't necessarily the same as the directory the script is in.
– user2357112
Nov 28 '18 at 21:03
That's where the script is located, but the working directory isn't necessarily the same as the directory the script is in.
– user2357112
Nov 28 '18 at 21:03
so i changed my code to a python file instead of a scratch file, and i was still getting the same error
– jessicacates
Nov 28 '18 at 22:31
so i changed my code to a python file instead of a scratch file, and i was still getting the same error
– jessicacates
Nov 28 '18 at 22:31
I suggest changing the code back to match your post. Next, move the file
Race_Results_Sample.txt
to the folder /Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
. After this, run the script via Terminal. First run cd /Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
. Next run, python -m scratch
. Until you feel more confident with Python, I recommend using a simple text editor (like Atom or Sublime) and the shell to do your programming. The book/website Learn Python the Hard Way talks about this in chapter 0. Pycharm is probably overkill for this project.– Joshua Cook
Nov 29 '18 at 0:36
I suggest changing the code back to match your post. Next, move the file
Race_Results_Sample.txt
to the folder /Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
. After this, run the script via Terminal. First run cd /Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
. Next run, python -m scratch
. Until you feel more confident with Python, I recommend using a simple text editor (like Atom or Sublime) and the shell to do your programming. The book/website Learn Python the Hard Way talks about this in chapter 0. Pycharm is probably overkill for this project.– Joshua Cook
Nov 29 '18 at 0:36
I'm sorry, I cannot find on my MacBook, where to move the file. I have looked and looked, an I can not for the life of me, find it.
– jessicacates
Nov 30 '18 at 0:56
I'm sorry, I cannot find on my MacBook, where to move the file. I have looked and looked, an I can not for the life of me, find it.
– jessicacates
Nov 30 '18 at 0:56
Ok start over. In your terminal: 1.
cd ~ & mkdir -p src/race_res
2. cd src/race_res
3. touch race_results.py
4. mv ~/Desktop/Race_Results_Sample.txt ~/src/race_res
5. Open race_results.py
in a simple text editor (Atom, Sublime, BBEdit). 6. Paste the contents of your script above into that file. 7. python -m race_results
///// Now you are working in a more basic fashion. Keep your files for this project in ~/src/race_res
. Make changes in a text editor. Execute via the command line. Plenty of time to learn Pycharm later.– Joshua Cook
Nov 30 '18 at 1:16
Ok start over. In your terminal: 1.
cd ~ & mkdir -p src/race_res
2. cd src/race_res
3. touch race_results.py
4. mv ~/Desktop/Race_Results_Sample.txt ~/src/race_res
5. Open race_results.py
in a simple text editor (Atom, Sublime, BBEdit). 6. Paste the contents of your script above into that file. 7. python -m race_results
///// Now you are working in a more basic fashion. Keep your files for this project in ~/src/race_res
. Make changes in a text editor. Execute via the command line. Plenty of time to learn Pycharm later.– Joshua Cook
Nov 30 '18 at 1:16
|
show 6 more comments
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53528028%2fpycharm-wont-read-a-txt-file-on-my-macbook%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You have the file on your desktop. Is your script running in your desktop folder? Print
os.getcwd()
.– user2357112
Nov 28 '18 at 21:02
1
Pycharm's scratch files aren't stored in the same directory as your project. Either move the file to
/Users/jess/Library/Preferences/PyCharmEdu4.0/scratches/
or move your code into a non-scratch file in your project. Additionally you can also use the absolute path to the file which always works.– Primusa
Nov 28 '18 at 21:03
I moved my code into a non-scratch file and I was still getting the same error
– jessicacates
Nov 28 '18 at 23:50