Python Using Databases in Python Our Diary App Doing Data Entry

Make python executable with /usr/bin/env python3

I get an error message of ": No such file or directory" when I run ./ I did do the chmod +x When I did 'ls', my was green in text instead of the usual black. Can someone please help me get rid of the error message? Thanks!

2 Answers

Steven Parker
Steven Parker
172,034 Points

:point_right: The default file format is not compatible with the shell command.

Something seems to have changed, I don't recall this happening before. But now the editor apparently creates files in the "DOS" format, using CR and LF characters at the end of each line.

But the BASH shell expects any script file to be in native Linux format, with line ends having LF only.

You can convert your file like this:

tr -d \\r < >tempfile && mv tempfile

Once converted, the editor seems to recognize the format and add new lines the same way.