Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Using Databases in Python Gettin' CRUD-y With It Delete An Entry

Jing Zhang
PLUS
Jing Zhang
Courses Plus Student 6,465 Points

How to run the program in pycharm? Ctrl+D not working

If I click run the program in pycharm, I receive this error when I press ctrl+d:

^D
Save entry? [Yn] Traceback (most recent call last):
  File "G:/Treehouse/Python/PythonDatabases/diaries.py", line 94, in <module>
    menu_loop()
  File "G:/Treehouse/Python/PythonDatabases/diaries.py", line 36, in menu_loop
    menu[choice]()
  File "G:/Treehouse/Python/PythonDatabases/diaries.py", line 45, in add_entry
    if input('Save entry? [Yn] ').lower() != 'n':
EOFError: EOF when reading a line

When I run it with terminal(git bash on windows): I have to press ctrl+z and enter multiple times to save the entry, but what I pressed was also saved:

^Z
Save entry? [Yn] Y
Saved successfully!

2 Answers

Ronald Lira
Ronald Lira
12,217 Points

On Mac, press "Fn Key + F12". It will open a terminal session within your project folder. Then run "python3 <your_file.py>". You can now use ctr+D.