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 Add An Entry

ctrl+d not working on windows 7

ctrl+d is not doint anything on my windows machine. How do i get this solved.

So I tried to replicate your problem:

  • booted windows 7
  • launched teamtreehouse.com in Chrome
  • launched the workspace in "Using Databases in Python"
  • ran "python diary.py"
  • hit ctrl+d

I expected python to quit

Python did quit when I hit ctrl+d.

I repeated the above steps in IE 11.

Could you tell me more about what you where doing? What browser where you using?

3 Answers

Joe Law
Joe Law
5,040 Points

Hey Murungu When I was working on this with my windows 7, I faced the same problem as you, when pressing ctrl + d, EOF doesn't happens.

After reasearching on the internet, I found out that, the EOF for windows is actually: ctrl + z then enter when you press both ctrl + z, ^z will come up in the terminal, then press Enter key to send it, EOF will then be activated.

In this excercise, Save entry? [Yn] will be displayed.

Joe Law : Can you tell me what browser you where using?

Aaron Price
Aaron Price
5,974 Points

Using macOS, I also found ctrl+d didn't end it.

But that's because it only applies if you're on a new line.

The solution is to hit enter/return, then do ctrl+d again

Joe Law
Joe Law
5,040 Points

Myers Carpenter , Hey Myers, I am using cmd.exe with my windows 7.

Joe Law
Joe Law
5,040 Points

Opps, forget to mention, I used PyCharm to try this.

Joe Law : I see where I'm misunderstanding. I thought you where in the workspace for this course, not running locally on Windows. Yes, that's is true, Ctrl + z is how you do EOF on windows.