V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
Chrisplus
V2EX  ›  Python

TrumpScript: Make Python great again

  •  
  •   Chrisplus · 2016-11-11 11:32:16 +08:00 · 3790 次点击
    这是一个创建于 2967 天前的主题,其中的信息可能已经有所发展或是发生改变。

    https://github.com/samshadwell/TrumpScript

    Features

    Our language includes several convenient features, perfect for any aspiring Presidential candidate including:

    • No floating point numbers, only integers. America never does anything halfway.
    • All numbers must be strictly greater than 1 million. The small stuff is inconsequential to us.
    • There are no import statements allowed. All code has to be home-grown and American made.
    • Instead of True and False, we have the keywords fact and lie.
    • Only the most popular English words, Trump's favorite words, and current politician names can be used as variable names.
    • Error messages are mostly quotes directly taken from Trump himself.
    • All programs must end with America is great.
    • Our language will automatically correct Forbes' $4.5B to $10B.
    • In its raw form, TrumpScript is not compatible with Windows, because Trump isn't the type of guy to believe in PC.
    • TrumpScript boycotts OS X and all Apple products until such time as Apple gives cellphone info to authorities regarding radical Islamic terrorist couple from Cal.
    • The language is completely case insensitive.
    • If the running computer is from China, TrumpScript will not compile. We don't want them stealing our American technological secrets.
    • By constructing a wall (providing the --Wall flag), TrumpScript will refuse to run on machines with Mexican locales
    • Warns you if you have any Communists masquerading as legitimate "SSL Certificates" from China on your system.
    • Won't run in root mode because America doesn't need your help being great. Trump is all we need.
    • Easy to type with small hands

    如何评价 python 开发者的创造力?

    10 条回复    2016-11-12 23:11:26 +08:00
    guyskk
        1
    guyskk  
       2016-11-11 14:34:33 +08:00
    "Detected commie network, aborting."

    ![]( )
    ryanzyy
        2
    ryanzyy  
       2016-11-11 14:50:57 +08:00
    十分幽默 已经 4.7k+ stars 了
    ryanzyy
        3
    ryanzyy  
       2016-11-11 14:54:44 +08:00   ❤️ 1
    @guyskk

    ```

    + def no_commie_network() -> None:
    + """
    + Make sure we aren't running on commie Chinese networks.
    + """
    + freedom_host = "facebook.com"
    + commie_host = "alibaba.cn"
    + is_on_a_network = os.system("ping -c 1 {}".format(commie_host)) == 0
    + is_commie_network = os.system("ping -c 1 {}".format(freedom_host)) != 0
    + if is_on_a_network and is_commie_network:
    + raise Utils.SystemException("Detected commie network, aborting.")

    ```

    是这样判断的
    guyskk
        4
    guyskk  
       2016-11-11 15:24:44 +08:00
    @ryanzyy 汗。。我刚还上 vps 去运行。
    改了下源码能正常运行了。看了一下 issue 里面的内容,没看懂这个幽默, Get 不到笑点。。。可以帮忙解释一下吗?
    ethanlu
        5
    ethanlu  
       2016-11-11 15:33:24 +08:00
    哈哈,有意思。
    lhbc
        6
    lhbc  
       2016-11-11 15:37:55 +08:00 via iPhone
    这代码政治非常不正确。
    iyeatse
        7
    iyeatse  
       2016-11-11 15:55:27 +08:00 via iPhone   ❤️ 1
    soulmine
        8
    soulmine  
       2016-11-12 21:29:47 +08:00
    @guyskk 这本来就是个搞事的 你还真当轮子了么 ....... 笑点这东西 可能我说了你还是不懂笑点......
    guyskk
        9
    guyskk  
       2016-11-12 21:36:44 +08:00 via Android
    @soulmine 没把它当轮子,我把里面的内容理解为恶搞或者是政治讽刺。没有经历过理解不到笑点。
    soulmine
        10
    soulmine  
       2016-11-12 23:11:26 +08:00
    @guyskk 主要就是川普的几次演讲 还有他的政治观点 最后是他的口号之类的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3210 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 13:05 · PVG 21:05 · LAX 05:05 · JFK 08:05
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.