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

Error when trying to save diary entry on Windows

From the "Using Databases in Python," I'm following along in my local Python environment using Python 3.4.3 on Windows 8. I'm working from the command line. I get the following errors:

view on pastebin

I've been able to successfully execute every previous version of the script. The code is identical to the script shown in the video, with the exception that the first line is

# in Unix env, start line with #!/usr/bin/env

... which I believe successfully commented out the line.

I tried running the file in Workspaces (modifying that top line appropriately) and was able to get the code to execute successfully. Any insight on this decode error?

2 Answers

Hi,

I'm also a Windows user, I'll admit it. The solution was: Just use Ctrl-Z instead of Ctrl-C to finish an entry! )

Extended info: keyboard interrupt might indicate you were using Ctrl-C to finish the entry

Vittorio Somaschini
Vittorio Somaschini
33,371 Points

Hello Tatiana,

I do not work on a windows environment so I may be totally wrong here, but I have googled the error and given the fact that the code runs fine in workspaces make me think that it can be a missing module.

I presume you had to go through the installation of python on windows and if your code has worked till this point it can mean that the installation is fine but you may need something more.

As I said I can be 100% wrong on this one, maybe if you manage to paste your code on that same site or even here (if not too many files) that could help.

Vittorio