/usr/bin/env: 'python3\r': No such file or directory But I followed Kenneth's code exactly!
I know there are several questions and answers about this already, but i still can't fix my problem. :P
In the video Kenneth types: chmod +x diary.py and ./diary.py
I followed this and received back the following error: /usr/bin/env: 'python3\r': No such file or directory
If anyone can tell me how to run this I would really appreciate it. Thanks in advance! :)
Here's my code:
#!/usr/bin/env python3 import datetime from peewee import * db = SqliteDatabase('diary.db') class Entry(Model): content = TextField() timestamp = DateTimeField(default=datetime.datetime.now) class Meta: database = db def initialize(): """Create the database and the table if they dont exist.""" db.connect() db.create_tables([Entry], safe=True) def menu_loop(): """Show the menu""" def add_entry(): """Add an entry.""" def view_entries(): """View previous entries.""" def delete_entry(entry): """Delete an entry.""" if __name__ == '__main__': initialize() menu_loop()
Phu TranPython Web Development Techdegree Student 4,687 Points
Hi, could you post the full code? I tried to edit the code in 30 minutes and still get "No such file or directory"