This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#header { margin:0 auto;clear:both;width:960px } | |
#nav ul { float:left;width:960px } | |
#nav ul li { float:left } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> if 1 == 2: print 'One equals two' | |
... if 1 == 1: print 'One equals one' | |
File "<stdin>", line 2 | |
if 1 == 1: print 'One equals one' | |
^ | |
SyntaxError: invalid syntax | |
>>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> | |
>>> if 1==2: print '一是二' | |
... | |
>>> if 1==1: print '一就是一!' | |
... | |
一就是一! | |
>>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> counter = 0 | |
>>> while counter < 3: | |
... print 'loop #%d' % (counter) | |
... counter += 1 | |
loop #0 | |
loop #1 | |
loop #2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Author (models.Model): | |
first_name = models.CharField(max_length=30) | |
last_name = models.CharField(max_length=40) | |
email = models.EmailField(blank=True,verbose_name=u'电子邮箱') | |
def __unicode__(self): | |
return u'%s %s' % (self.first_name, self.last_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def index_list(request): | |
posts = post.objects.all() | |
return render_to_response('post_list.html', {'posts':posts}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for post in posts %} | |
<div id="test" class="test"> | |
<h1>{{ post.id }}{{ post.subject }}</h1> | |
<p>{{ post.content }}</p> | |
<cite>{{ post.pub_date|date:'Y年m月j日' }}</cite> | |
</div> | |
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table> | |
<tr> | |
<th></th> | |
<th></th> | |
<th></th> | |
<th></th> | |
<th></th> | |
</tr> | |
<tr> | |
<td></td> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#endcoding: UTF-8 | |
require "open-uri" | |
require "nokogiri" | |
require "date" | |
require "mysql2" | |
apps_uri = Nokogiri::HTML.parse(open('http://itunes.apple.com/cn/genre/ios-shang-ye/id6000'), nil, "UTF-8") | |
db = Mysql2::Client.new(:host => "localhost", :username => "root", :database => "iosdb") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="navigation"> | |
<div class="nav-inner"> | |
<ul class="rows-4"> | |
<li class="active"><a href="#">首页</a></li> | |
<li><a href="#">导航名称</a></li> | |
<li><a href="#">导航名称</a></li> | |
<li><a href="#">导航名称</a></li> | |
<li><a href="#">导航名称</a></li> | |
<li><a href="#">导航名称</a></li> | |
<li><a href="#">导航名称</a></li> |
OlderNewer