Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. while ($line = <>) {
  2. if ($line =~ /^#!/ && $. == 1) {
  3. # translate #! line
  4. print "#!/usr/local/bin/python3.5 -u";
  5. } elsif ($line =~ /^\s*#/ || $line =~ /^\s*$/) {
  6. # Blank & comment lines can be passed unchanged
  7. print $line;
  8. } elsif ($line =~ /^\s*print\s*"(.*)\\n"[\s;]*$/) {
  9. # Delete new line character in python print statement
  10. print "print(\"$1\")\n";
  11. } elsif ($line =~ /^s*$
  12. } else {
  13. # Lines we can't translate are turned into comments
  14. print "#$line\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement