Skip to content

Instantly share code, notes, and snippets.

@markbiek
Created March 3, 2014 14:34
Show Gist options
  • Save markbiek/9326227 to your computer and use it in GitHub Desktop.
Save markbiek/9326227 to your computer and use it in GitHub Desktop.
Python script syntax checker
#!/bin/bash
if [ -f $1 ]
then
python -c "compile(open('$1').read(), '$1', 'exec')"
else
echo "The file $1 was not found."
exit 1
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment