aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/conflicting/learn/server-side/django/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-tw/conflicting/learn/server-side/django/index.html')
-rw-r--r--files/zh-tw/conflicting/learn/server-side/django/index.html67
1 files changed, 67 insertions, 0 deletions
diff --git a/files/zh-tw/conflicting/learn/server-side/django/index.html b/files/zh-tw/conflicting/learn/server-side/django/index.html
new file mode 100644
index 0000000000..302f55e871
--- /dev/null
+++ b/files/zh-tw/conflicting/learn/server-side/django/index.html
@@ -0,0 +1,67 @@
+---
+title: Python
+slug: conflicting/Learn/Server-side/Django
+tags:
+ - Python
+translation_of: Learn/Server-side/Django
+translation_of_original: Python
+original_slug: Python
+---
+<p><a class="external" href="http://www.python.org">Python</a> 是一種直譯式的腳本語言,是一個跨平台的的語言,可以在各個平台上面使用,如:Linux、Mac OS X、以及Microsoft Windows.</p>
+<h2 id="Learning_Python" name="Learning_Python">學習 Python</h2>
+<h3 id="免費的電子書">免費的電子書</h3>
+<p>如果是初學 Python,可以考慮看 <a class="external" href="http://www.diveintopython.net/toc/index.html">Dive Into Python</a>,雖然他最後是更新的時間是2004年,但依然是一部免費而且很棒的教程。它含括了幾乎所有 Python 的基本元素,還有一些平常使用 Python 可以執行什麼任務,像是網頁的請求,檔案的處理。如果對於 Python 基礎已經基礎的概念,就可以參考 <a class="external" href="http://gnosis.cx/TPiP/">Text Processing In Python</a> ,這本書將會對於 Python 有更進階的介紹。</p>
+<p>其他相關的免費電子書或是線上資源 :</p>
+<ul style="margin-left: 40px;">
+ <li>The <a class="external" href="http://docs.python.org/tutorial/index.html" title="http://docs.python.org/tutorial/index.html">Python Tutorial</a> at <a href="http://docs.python.org" title="http://docs.python.org">docs.python.org</a></li>
+ <li><a href="http://en.wikibooks.org/wiki/Non-Programmer%27s_Tutorial_for_Python_2.6" title="http://en.wikibooks.org/wiki/Non-Programmer%27s_Tutorial_for_Python_2.6">Non-Programmer's Tutorial for Python 2.6</a> at <a href="http://en.wikibooks.org/wiki/Main_Page" title="http://en.wikibooks.org/wiki/Main_Page">Wikibooks</a></li>
+ <li><a href="http://www.greenteapress.com/thinkpython/" title="http://www.greenteapress.com/thinkpython/">Think Python</a>: How to Think Like a Computer Scientist by Allen B. Downey (free <a href="http://www.greenteapress.com/thinkpython/thinkpython.pdf" title="http://www.greenteapress.com/thinkpython/thinkpython.pdf">PDF</a> &amp; <a href="http://www.greenteapress.com/thinkpython/html/index.html" title="http://www.greenteapress.com/thinkpython/html/index.html">HTML</a> versions).
+ <ul>
+ <li><a href="http://greenteapress.com/complexity/index.html" title="http://greenteapress.com/complexity/index.html">Think Complexity</a> by Allen B. Downey "picks up where Think Python leaves off" (free <a href="http://greenteapress.com/complexity/thinkcomplexity.pdf" title="http://greenteapress.com/complexity/thinkcomplexity.pdf">PDF</a> &amp; <a href="http://greenteapress.com/complexity/html/index.html" title="http://greenteapress.com/complexity/html/index.html">HTML</a> versions)</li>
+ </ul>
+ </li>
+ <li><a href="http://learnpythonthehardway.org" title="http://learnpythonthehardway.org">Learn Python The Hard Way</a> by Zed Shaw (<a href="http://learnpythonthehardway.org/book/" title="http://learnpythonthehardway.org/book/">free HTML verison</a>)</li>
+ <li><a href="http://www.itmaybeahack.com/book/python-2.6/html/index.html" title="http://www.itmaybeahack.com/book/python-2.6/html/index.html">Building Skills in Python</a> by Steven F. Lott (<a href="http://www.itmaybeahack.com/book/python-2.6/latex/BuildingSkillsinPython.pdf" title="http://www.itmaybeahack.com/book/python-2.6/latex/BuildingSkillsinPython.pdf">also available as a PDF</a>)</li>
+</ul>
+<p>當了解基礎的 Python,<a href="http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html" title="http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html">Code Like a Pythonista: Idiomatic Python</a> 將幫助你了解一些 Python 特別的地方,還有跟別的語言的差異。</p>
+<h3 id="Free_Online_Courses">Free Online Courses</h3>
+<ul style="margin-left: 40px;">
+ <li><a href="https://developers.google.com/edu/python/" title="http://code.google.com/edu/languages/google-python-class/">Google's Python Class</a></li>
+ <li>Learnstreet's Free <a href="http://www.learnstreet.com/lessons/languages/python" title="http://www.learnstreet.com/lessons/languages/python">Python Courses and Videos</a></li>
+ <li><a href="http://www.codecademy.com/tracks/python" title="http://www.codecademy.com/tracks/python">Python</a> at Code Academy</li>
+ <li><a href="http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-189-a-gentle-introduction-to-programming-using-python-january-iap-2008/" title="http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-189-a-gentle-introduction-to-programming-using-python-january-iap-2008/">A Gentle Introduction to Programming Using Python</a> at MIT</li>
+</ul>
+<h2 id="Python_in_Mozilla" name="Python_in_Mozilla">Python in Mozilla-based applications</h2>
+<p><a href="/en-US/docs/XPCOM" title="XPCOM">XPCOM</a> in Mozilla is used to support inter-language communication. Out-of-box it only supports C++ &lt;-&gt; JavaScript communication. The <a href="/en-US/docs/PyXPCOM" title="PyXPCOM">Python XPCOM package</a> (also called PyXPCOM) is the low-level glue that ties Python and Mozilla together, letting XPCOM components written in JavaScript or C++ to be used from Python and vice versa. PyXPCOM is<strong> not</strong> included in the default Firefox build, so you'll need to use a third-party build or build yourself to use it. The most known consumer of PyXPCOM is the Komodo family of products.</p>
+<p>Starting with Mozilla 1.9, Python DOM (<a href="/en-US/docs/PyDOM" title="PyDOM">PyDOM</a>) bindings are implemented. This lets <a href="/en-US/docs/Chrome" title="Chrome">chrome</a> XUL and HTML authors use Python in their &lt;script&gt; tags (again, not in the official Firefox/Thunderbird builds).</p>
+<h2 id="Python-based_tools_for_Mozilla_development">Python-based tools for Mozilla development</h2>
+<p>Python is used by Mozillians for tools that do various things with Mozilla apps and infrastructure. It would be useful to have a document on <a href="/en-US/docs/Python_Environment_and_Tools_for_Mozilla" title="Python_Environment_and_Tools_for_Mozilla">Python Environment and Tools for Mozilla</a>.</p>
+<p>Tools are listed here: <a class="external" href="http://k0s.org/toolbox/?language=python">http://k0s.org/toolbox/?language=python</a></p>
+<h2 id="Use_of_Python_at_Mozilla">Use of Python at Mozilla</h2>
+<p>Mozilla has considerable infrastructure based on python:</p>
+<ul>
+ <li>django for <a class="external" href="http://blog.mozilla.com/webdev/" title="http://blog.mozilla.com/webdev/">webdev</a></li>
+ <li><a class="link-https" href="https://wiki.mozilla.org/Buildbot" title="https://wiki.mozilla.org/Buildbot">buildbot</a> for continuous integration</li>
+ <li>many of our <a href="/en-US/docs/Mozilla_automated_testing" title="Mozilla automated testing">test harnesses</a></li>
+ <li><a class="link-https" href="https://wiki.mozilla.org/Auto-tools/Projects/Mozbase" title="https://wiki.mozilla.org/Auto-tools/Projects/MozBase">mozbase</a></li>
+</ul>
+<h2 id="Python_packaging">Python packaging</h2>
+<p>Python uses <a class="external" href="http://docs.python.org/distutils/index.html" title="http://docs.python.org/distutils/index.html">setup.py</a> files to record metadata and installation instructions for <a class="external" href="http://docs.python.org/tutorial/modules.html#packages" title="http://docs.python.org/tutorial/modules.html#packages">python packages</a>. Running (e.g.) <code>python setup.py install</code> will install the package, making its modules available on <a class="external" href="http://docs.python.org/tutorial/modules.html#the-module-search-path" title="http://docs.python.org/tutorial/modules.html#the-module-search-path">python's import path</a>. For python 2.x, several distribution/installation modules exist. <code><a class="external" href="http://docs.python.org/distutils/index.html" title="http://docs.python.org/distutils/index.html">distutils</a></code> is the only distribution package available in <a class="external" href="http://docs.python.org/library/" title="http://docs.python.org/library/">python's standard library</a>. <code>distutils</code> has ability to upload to the <a class="external" href="http://pypi.python.org/pypi" title="http://pypi.python.org/pypi">python package index</a> and to install python packages. See the <a class="external" href="http://docs.python.org/distutils/index.html" title="http://docs.python.org/distutils/index.html">Python documentation on <code>distutils</code></a> for details.</p>
+<p>While <code>distutils</code> is built in to python's standard library, <a class="external" href="http://peak.telecommunity.com/DevCenter/setuptools" title="http://peak.telecommunity.com/DevCenter/setuptools">setuptools</a> is a third-party ad hoc standard for packaging and distribution. It is mostly compatible with <code>distutils</code>, but importantly adds the ability for packages to <a class="external" href="http://peak.telecommunity.com/DevCenter/setuptools#declaring-dependencies" title="http://peak.telecommunity.com/DevCenter/setuptools#declaring-dependencies">include dependencies</a> that are installed as prerequisites at the time <code>setup.py</code> is invoked as well as the ability to install python packages in <a class="external" href="http://packages.python.org/distribute/setuptools.html#development-mode" title="http://packages.python.org/distribute/setuptools.html#development-mode">development mode</a>. This allows the files to be edited in place via <a class="external" href="http://docs.python.org/library/site.html" title="http://docs.python.org/library/site.html">.pth files</a> which is handy if you are actively working on a project. <code>setuptools</code> also provides an <code><a class="external" href="http://packages.python.org/distribute/easy_install.html" title="http://packages.python.org/distribute/easy_install.html">easy_install</a></code> script for installing packages and their dependencies through the web from <a class="external" href="http://pypi.python.org/pypi" title="http://pypi.python.org/pypi">PyPI</a>. For instance, in order to install the <a class="external" href="http://pyyaml.org/wiki/PyYAML" title="http://pyyaml.org/wiki/PyYAML">PyYAML</a> package, just run</p>
+<pre>easy_install PyYAML
+</pre>
+<p>Since <code>setuptools</code> is not included with python, you will need to install it in order to use it. You may install it from the <code>setuptools</code> PyPI page by downloading, extracting, and running <code>python setup.py install</code>. Or you can use the <code><a class="external" href="http://peak.telecommunity.com/dist/ez_setup.py" title="http://peak.telecommunity.com/dist/ez_setup.py">ez_setup.py</a></code> script. You can download and run it with python (with root/Administrator privileges), or if you're in a <a class="external" href="http://www.gnu.org/s/bash/" title="http://www.gnu.org/s/bash/">bash shell</a>, you can run</p>
+<pre>sudo python &lt;(curl http://peak.telecommunity.com/dist/ez_setup.py)
+</pre>
+<p><code>setuptools</code> is also provided with instances of <a href="/en-US/docs/Python/Virtualenv" title="Virtualenv">virtualenv</a>, so if you use virtualenvs for developing you may not need to install <code>setuptools</code> globally. <a class="external" href="http://packages.python.org/distribute/" title="http://packages.python.org/distribute/">distribute</a> is a fork of setuptools written by Mozilla's own <a class="external" href="http://ziade.org/" title="http://ziade.org/">Tarek Ziade</a>. It is compatible with <code>setuptools</code> and fixes a few bugs there.</p>
+<div class="note">
+ <strong>Note:</strong> It's <strong>highly</strong> recommended that you use <a href="/en-US/docs/Python/Virtualenv" title="Virtualenv">virtualenv</a> for development!</div>
+<p>The <a class="external" href="http://pypi.python.org/pypi" title="http://pypi.python.org/pypi">Python Package Index (PyPI)</a> is the standard distribution point for python packages. If you need some functionality in python, it is a good place to look!</p>
+<p>See also: <a class="external" href="http://k0s.org/portfolio/packaging.html">http://k0s.org/portfolio/packaging.html</a></p>
+<h2 id="See_also">See also</h2>
+<ul>
+ <li><a class="external" href="http://docs.services.mozilla.com/server-devguide/release.html" title="http://docs.services.mozilla.com/server-devguide/release.html">Releasing an application</a> (Mozilla Services documentation)</li>
+ <li>http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy</li>
+ <li><a class="link-https" href="https://wiki.mozilla.org/Auto-tools/Python101">https://wiki.mozilla.org/Auto-tools/Python101</a></li>
+ <li><a href="http://www.learnstreet.com/cg/simple/projects/python" title="http://www.learnstreet.com/cg/simple/projects/python">Python Projects </a>at Code Garage</li>
+</ul>