public
Created

python code in ROT13 (Caesar)

  • Download Gist
letrot.py
Python
1 2 3 4 5 6 7 8 9 10
#!/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")
$ 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@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)

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

no v tom je prave ten for, ze jo...

In Perl you shoot yourself in the foot, but nobody can understand how
you did it. Six months later, neither can you. | print
'aknerats'[::-1]

2012/2/6 Filip Procházka
reply@reply.github.com:

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


Reply to this email directly or view it on GitHub:
https://gist.github.com/1745534

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.