Advertisement
RonWeber

Quine

Feb 15th, 2020
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. # This is the beginning.
  4.  
  5. def p(s):
  6.     print(s, end='')    
  7.  
  8. beginning = """#!/usr/bin/python
  9.  
  10. # This is the beginning.
  11.  
  12. def p(s):
  13.    print(s, end='')
  14.  
  15. beginning = """
  16.  
  17. ending = """
  18.  
  19. p(beginning)
  20. p('$""')
  21. p(beginning)
  22. p('$""')
  23. p('@n@nending = $""')
  24. p(ending)
  25. p('$""')
  26. p(ending.replace(chr(36), '"').replace(chr(64), chr(92)))
  27.  
  28. # This is the ending.
  29. """
  30.  
  31. p(beginning)
  32. p('"""')
  33. p(beginning)
  34. p('"""')
  35. p('\n\nending = """')
  36. p(ending)
  37. p('"""')
  38. p(ending.replace(chr(36), '"').replace(chr(64), chr(92)))
  39.  
  40. # This is the ending.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement