擅长:python、mysql、java
<p>今天我可以给你一些建议:</p>
<h2>使用转到</h2>
<p><a href="http://entrian.com/goto/" rel="nofollow">http://entrian.com/goto/</a></p>
<p>安装软件包:</p>
<pre><code>$ pip install http://entrian.com/goto/goto-1.0.tar.gz#goto
</code></pre>
<p>编写一些代码:</p>
<pre><code>from goto import goto, label
label .getinput
i = raw_input("Enter either 'a', 'b' or 'c', or any other letter to quit: ")
if i in ('a', 'b', 'c'):
goto *i
else:
goto .quit
label .a
print "You typed 'a'"
label .b
print "You typed 'b'"
label .c
print "You typed 'c'"
label .quit
print "Finished\n"
</code></pre>
<p>然后运行它:</p>
<pre><code>$ python gt.py
Enter either 'a', 'b' or 'c', or any other letter to quit: b
You typed 'b'
You typed 'c'
Finished
</code></pre>
<p>警告:在练习之前,请先查看日历。顺便说一句,代码真的很管用。你知道吗</p>