<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://w.electrodragon.com/w/index.php?action=history&amp;feed=atom&amp;title=Category%3APython</id>
	<title>Category:Python - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://w.electrodragon.com/w/index.php?action=history&amp;feed=atom&amp;title=Category%3APython"/>
	<link rel="alternate" type="text/html" href="https://w.electrodragon.com/w/index.php?title=Category:Python&amp;action=history"/>
	<updated>2026-07-22T07:41:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.2</generator>
	<entry>
		<id>https://w.electrodragon.com/w/index.php?title=Category:Python&amp;diff=30803&amp;oldid=prev</id>
		<title>Chao: /* Module/Library */</title>
		<link rel="alternate" type="text/html" href="https://w.electrodragon.com/w/index.php?title=Category:Python&amp;diff=30803&amp;oldid=prev"/>
		<updated>2021-04-28T16:09:41Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Module/Library&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Sub-category ==&lt;br /&gt;
* [[Micropython]]&lt;br /&gt;
== Basic==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Command !! description!! example !! Header text&lt;br /&gt;
|-&lt;br /&gt;
| comment || # for line, &amp;quot;&amp;quot;&amp;quot; and &amp;quot;&amp;quot;&amp;quot; for paragraph || Example || Example&lt;br /&gt;
|-&lt;br /&gt;
| print || Example || print(&amp;quot;234&amp;quot;) # print string; print 234 # print variable|| Example&lt;br /&gt;
|-&lt;br /&gt;
| linux bash run || #! /usr/bin/python || Example || Example&lt;br /&gt;
|-&lt;br /&gt;
| Example || Example || Example || Example&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== file operation ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
    myfile = open('/srv/www/idehe.com/stock/data.txt', 'w')&lt;br /&gt;
    myfile.writelines('\n')    &lt;br /&gt;
    myfile.close()&lt;br /&gt;
&lt;br /&gt;
    myfile = open('/srv/www/idehe.com/stock/data.txt', 'a')             # open for output (creates)&lt;br /&gt;
    myfile.writelines('\n')&lt;br /&gt;
    myfile.writelines(line1)        # write a line of text&lt;br /&gt;
    myfile.writelines('\n')   &lt;br /&gt;
    myfile.writelines(line2)        # write a line of text&lt;br /&gt;
    myfile.close()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
not is evaluated first; and is evaluated next; or is evaluated last.&lt;br /&gt;
&lt;br /&gt;
== Group, List, Dict==&lt;br /&gt;
* group = (), list = [], dict = {}&lt;br /&gt;
=== List ===&lt;br /&gt;
* L[2]	'SPAM!'	read the third element&lt;br /&gt;
* L[-2]	'Spam'	red the last third element&lt;br /&gt;
* L[1:]	['Spam', 'SPAM!']	cut the list from the second element&lt;br /&gt;
&lt;br /&gt;
== Pratical Test ==&lt;br /&gt;
* for loop&lt;br /&gt;
 for x in range (xxx, 0, -1):&lt;br /&gt;
&lt;br /&gt;
== Project ==&lt;br /&gt;
install/unstall a library, first install pip: apt-get install python-pip&lt;br /&gt;
 pip install datetime&lt;br /&gt;
 pip uninstall datetime &lt;br /&gt;
common used library&lt;br /&gt;
* Datetime&lt;br /&gt;
* Django&lt;br /&gt;
=== Kivy ===&lt;br /&gt;
==== For android ====&lt;br /&gt;
* install debian jessie, install python-kivy, python-pip&lt;br /&gt;
* install buildozer (pip install), java SDK (default-jdk), cython, etc&lt;br /&gt;
* buildozer init, and run: buildozer set default android_new debug deploy run, android USB debug should turn on&lt;br /&gt;
* buildozer need ANT, SDK, NDK on first time&lt;br /&gt;
&lt;br /&gt;
==== Other ====&lt;br /&gt;
* [[python-web]]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* https://www.codecademy.com/learn&lt;br /&gt;
* symbol review: http://learnpythonthehardway.org/book/ex37.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python&lt;br /&gt;
* [https://www.python.org/downloads/release/python-352/ Python 3.52 download page here.]&lt;br /&gt;
&lt;br /&gt;
== For Raspberry Pi ==&lt;br /&gt;
SPIDEV&lt;br /&gt;
* sudo apt-get install python-dev&lt;br /&gt;
Image &lt;br /&gt;
sudo apt-get install python-imaging&lt;br /&gt;
[[category: Language]]&lt;/div&gt;</summary>
		<author><name>Chao</name></author>
	</entry>
</feed>