Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.

Myers Carpenter
Myers Carpenter
6,111 Points

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.

Myers Carpenter
Myers Carpenter
6,111 Points

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.

Myers Carpenter
Myers Carpenter
6,111 Points

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.