Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while ($line = <>) {
- if ($line =~ /^#!/ && $. == 1) {
- # translate #! line
- print "#!/usr/local/bin/python3.5 -u";
- } elsif ($line =~ /^\s*#/ || $line =~ /^\s*$/) {
- # Blank & comment lines can be passed unchanged
- print $line;
- } elsif ($line =~ /^\s*print\s*"(.*)\\n"[\s;]*$/) {
- # Delete new line character in python print statement
- print "print(\"$1\")\n";
- } elsif ($line =~ /^s*$
- } else {
- # Lines we can't translate are turned into comments
- print "#$line\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement