Python > import this > Easter eggを表示する > オンラインコード実行環境で試した


@ Introducing Python: Modern Computing in Simple Packages by Bill Lubanovic
(No. 432 / 12833)

import thisというのが掲載されていた。

@ paiza

https://paiza.io/?locale=ja-jp
にて「コード作成を試してみる(無料)」で実行。

// Here your code !
import this

print("XXXXXXXX")

txt:結果
main.swift:2:8: error: no such module 'this'
import this

(追記 2017/01/09)
@nukorouさんに確認いただきましたように、paizaでもEaster eggが表示されました。

@ ideone > Python (version 2?)

# your code goes here
import this
結果
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!

@ codinggroundのPython実行環境

# Hello World program in Python

import this

print "Hello World!\n"
結果
sh-4.3$ python main.py                                                                                                                
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!                                                                      
Hello World!                                                                                                                          

sh-4.3$                                      

@ codinggroundのbash実行環境

  • 手順
    • pythonと入力
    • import thisと入力 (Easter eggが表示される)
    • quit()で終了

備考

Python実装方法の違いが出る。
(内部の具体的な実装方法は不明だが)。

上記すべてでEaster eggが表示されました。

意図的に特定のimportをできないようにしているオンラインコード実行環境もある、という記事を見たことがある。