Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 编程语言 > 其他编程语言 > Python Quines
【标  题】:Python Quines
【关键字】:Python,Quines
【来  源】:http://www.cublog.cn/u/8780/showart.php?id=185871

Python Quines

Your Ad Here

Quines

A quine is a self-printing program

http://www.aims.ac.za/~mackay/python/quine/quine.html

Here is A good page about Quines by David Madore.

Quines are named after the American mathematician and logician Willard van Orman Quine.

Douglas R. Hofstadter coined the name in his book Godel, Escher, Bach.

the verb to quine (invented by Douglas R. Hofstadter) means "to write (a sentence fragment) a first time, and then to write it a second time, but with quotation marks around it" (for example, if we quine "say", we get "say 'say'"). Thus, if we quine "quine", we get "quine 'quine'", so that the sentence "quine 'quine'" is a quine...

In this directory are ten quines I wrote to help me learn python. (One or two of them (X) are not quines; they are deliberately broken for teaching purposes.)

Also, another 8 quines in python that I found on the internet

My quines
quine.py - rather large and awkward, but quite clear
X
quine2.py - not a quine, but very close; uses def and exec
quine3.py - uses def and exec
X
quine4.py - teaching aid
quine4a.py - works
X
quine4b.py
quine4c.py - works
quine5.py - uses def and exec; follows on from 4c
quine6.py - uses two types of quotes
quine7.py - uses def and exec; more compact
quine8.py - more compact still
quine10.py - compact, with intron
quine11.py - all these use 3 types of quote and no slashes
quine12.py - includes she-bang; clearly laid out.
quine13b.py - uses lambda; a one-line quine
X
quine13a.py - educational example to clarify 13b.
SE.py - does this one count? In emacs, under C-cC-c, the output matches exactly!
Other people's
Short1.py
Short2.py
Short3.py
Short4.py
SomeQuine.py
SheBang.py
Intuitive.py
Neat.py
Obfusc.py
Natural Language (txt)

Here are some python programs to illustrate the idea that programs are maps.
grandfather.py
-> writer.py
-> fibo_iter.py

附:

文件: python-quine.rar
大小: 9KB
下载: 下载

code:【上一篇】
Shortest Python Quine?:【下一篇】
【相关文章】
  • Quines (self-replicating programs)
  • ctypes: 使用python调用C编写的动态链接库
  • 在python 中使用 windows dll
  • Python中的Unicode
  • Extending Python in IcePy
  • 基本A*算法python实现
  • Python Cookbook 第二版 汉化版 [Recipe 1.5] 去除字符串末尾的空格
  • (Python编程)集成的方式
  • mod_lua性能提升,是mod_python速度115%
  • IronPython 源码剖析系列(1):IronPython 编译器
  • 【随机文章】
  • 转:Unix awk使用手册
  • 函数传对象调用,为什么值没有发生变化?
  • 传奇世界 狂魔手、明王头、天魔的元宝价格
  • 深入C#-访问微软首席设计师Anders Hejlsberg(一)
  • 在ASPX页面中输出XML
  • POSIX ACLs on Linux
  • FreeBSD全能服务器安装手册之基础设置篇
  • windows环境下以日期为文件名的oracle数据导出
  • CAM350 技巧之五
  • 全国精神病等级考试试题
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.