👻 Check our latest review to choose the best laptop for Machine Learning engineers and Deep learning tasks!
If you open a Python interpreter, and type "import this", as you know, it prints:
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren"t special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you"re Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it"s a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let"s do more of those!
In the python source(Lib/this.py) this text is generated by a curious piece of code:
s = """Gur Mra bs Clguba, ol Gvz Crgref
Ornhgvshy vf orggre guna htyl.
Rkcyvpvg vf orggre guna vzcyvpvg.
Fvzcyr vf orggre guna pbzcyrk.
Pbzcyrk vf orggre guna pbzcyvpngrq.
Syng vf orggre guna arfgrq.
Fcnefr vf orggre guna qrafr.
Ernqnovyvgl pbhagf.
Fcrpvny pnfrf nera"g fcrpvny rabhtu gb oernx gur ehyrf.
Nygubhtu cenpgvpnyvgl orngf chevgl.
Reebef fubhyq arire cnff fvyragyl.
Hayrff rkcyvpvgyl fvyraprq.
Va gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff.
Gurer fubhyq or bar-- naq cersrenoyl bayl bar --boivbhf jnl gb qb vg.
Nygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh"er Qhgpu.
Abj vf orggre guna arire.
Nygubhtu arire vf bsgra orggre guna *evtug* abj.
Vs gur vzcyrzragngvba vf uneq gb rkcynva, vg"f n onq vqrn.
Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn.
Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg"f qb zber bs gubfr!"""
d = {}
for c in (65, 97):
for i in range(26):
d[chr(i+c)] = chr((i+13) % 26 + c)
print "".join([d.get(c, c) for c in s])
👻 Read also: what is the best laptop for engineering students?
We hope this article has helped you to resolve the problem. Apart from What is the source code of the “this” module doing?, check other code Python module-related topics.
Want to excel in Python? See our review of the best Python online courses 2023. If you are interested in Data Science, check also how to learn programming in R.
By the way, this material is also available in other languages:
- Italiano What is the source code of the “this” module doing?
- Deutsch What is the source code of the “this” module doing?
- Français What is the source code of the “this” module doing?
- Español What is the source code of the “this” module doing?
- Türk What is the source code of the “this” module doing?
- Русский What is the source code of the “this” module doing?
- Português What is the source code of the “this” module doing?
- Polski What is the source code of the “this” module doing?
- Nederlandse What is the source code of the “this” module doing?
- 中文 What is the source code of the “this” module doing?
- 한국어 What is the source code of the “this” module doing?
- 日本語 What is the source code of the “this” module doing?
- हिन्दी What is the source code of the “this” module doing?
Singapore | 2023-04-01
imp Python module is always a bit confusing 😭 What is the source code of the “this” module doing? is not the only problem I encountered. I just hope that will not emerge anymore
Prague | 2023-04-01
Simply put and clear. Thank you for sharing. What is the source code of the “this” module doing? and other issues with COM PHP module was always my weak point 😁. I just hope that will not emerge anymore
Munchen | 2023-04-01
Simply put and clear. Thank you for sharing. What is the source code of the “this” module doing? and other issues with imp Python module was always my weak point 😁. I just hope that will not emerge anymore