Skip to content

Instantly share code, notes, and snippets.

@starenka
Created February 5, 2012 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save starenka/1745534 to your computer and use it in GitHub Desktop.
Save starenka/1745534 to your computer and use it in GitHub Desktop.
python code in ROT13 (Caesar)
#!/usr/bin/env python
# -*- coding: rot13 -*-
cevag '''Tnyyvn rfg bzavf qvivfn va cnegrf gerf, dhnehz hanz vapbyhag Orytnr, nyvnz Ndhvgnav,
gregvnz dhv vcfbehz yvathn Prygnr, abfgen Tnyyv nccryynaghe. Uv bzarf yvathn, vafgvghgvf,
yrtvohf vagre fr qvssrehag. Tnyybf no Ndhvgnavf Tnehzan syhzra, n Orytvf Zngeban rg
Frdhnan qvivqvg. Ubehz bzavhz sbegvffvzv fhag Orytnr, cebcgrern dhbq n phygh ngdhr
uhznavgngr cebivapvnr ybatvffvzr nofhag, zvavzrdhr nq rbf zrepngberf fnrcr pbzzrnag
ngdhr rn dhnr nq rssrzvanaqbf navzbf cregvarag vzcbegnag, cebkvzvdhr fhag Treznavf,
dhv genaf Eurahz vapbyhag, dhvohfphz pbagvaragre oryyhz trehag.'''.rapbqr("rot13")
@fprochazka
Copy link

$ python ./test.py 
  File "./test.py", line 7
    dhv genaf Eurahz vapbyhag, dhvohfphz pbagvaragre oryyhz trehag.'''.rapbqr("rot13")
                                                                     ^
SyntaxError: invalid syntax

co dělám špatně?

@starenka
Copy link
Author

starenka commented Feb 5, 2012

starenka@kosmik1:/tmp$ git clone git://gist.github.com/1745534.git
Cloning into '1745534'...
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6/6), done.
starenka@kosmik1:/tmp$ cd 1745534/
starenka@kosmik1:/tmp/1745534$ ls
letrot.py
starenka@kosmik1:/tmp/1745534$ python letrot.py 
Gallia est omnis divisa in partes tres, quarum unam incolunt Belgae, aliam Aquitani,
tertiam qui ipsorum lingua Celtae, nostra Galli appellantur. Hi omnes lingua, institutis,
legibus inter se differunt. Gallos ab Aquitanis Garumna flumen, a Belgis Matrona et
Sequana dividit. Horum omnium fortissimi sunt Belgae, propterea quod a cultu atque
humanitate provinciae longissime absunt, minimeque ad eos mercatores saepe commeant
atque ea quae ad effeminandos animos pertinent important, proximique sunt Germanis,
qui trans Rhenum incolunt, quibuscum continenter bellum gerunt.
starenka@kosmik1:/tmp/1745534$ ls -l `which python`
lrwxrwxrwx 1 root root 9 Jan 24 22:52 /usr/bin/python -> python2.7

Chm, ja nevim? Nemas nahodou python 3? (tam uz to nejede)

@fprochazka
Copy link

Ha funguje, :) Bez toho kódování to dělá kotrmelce :)

@starenka
Copy link
Author

starenka commented Feb 6, 2012 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment