Short and sweet version: I figured breaking it down into steps would make it easier.
I'm building a website
I hate SQL. It makes no sense to me, for a programmer to have to learn an additional language for database interaction.
I can't stand PHP: It's too much like C and doesn't integrate well with MongoDB
I LOVE Python: It's simple, straight-forward, and integrates well with MongoDB
Python isn't built for the web: Ideally, Python would use this feature
<?python?>
, like PHP.To counter number 5, I've written an interpreter (in Python) which reads a file line by line and prints everything until it finds
<?python
. Upon finding that, it starts executing Python code until it hits?>
. Then it will resume printing the HTML lines in the file.
I've setup my CGI file to point to my new interpreter with this line:
#!/home/jesse/Desktop interpret
The interpreter itself has a shebang line:
#!/usr/bin/env python3
Upon execution of the CGI file, I get:
bash: ./test: /home/jesse/Desktop: bad interpreter: Permission denied
How can I fix this problem? Are there any better ways of optimizing my scripts (besides my interpreter)?
/usr/bin/env
is a command, andpython
is an argument you pass to it. That's why you can put a space there. You could do/usr/bin/env interpret
ifinterpret
is in thePATH
.