![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python学习
文章平均质量分 80
zcliatb
这个作者很懒,什么都没留下…
展开
-
Python data structure
1. append(x) = > a[len(a):] = [x], extend(L) => a[len(a):] = L, insert(i,x) # before i, remove(x) # remove x or return error, pop([i]) # default value is the last element原创 2014-12-26 09:30:09 · 1044 阅读 · 0 评论 -
Python data type
1. unix ctrl+d,windows ctrl +z or import sys; sys.exit(); 2. int, float, complex number(real,imag,abs), _ represent last mentioned number, string(\",\n\, r" " \n doesn't work, quotation can cross-re原创 2014-12-25 14:25:49 · 604 阅读 · 0 评论 -
Python module
1. module name fibo.__name__ # file fibo.py def f(x): return x*x import fibo fibo.f(10) # module name then function name fl = fibo.f # to make it call like locally原创 2014-12-26 14:14:12 · 504 阅读 · 0 评论 -
Python input and output
1. output a. string b. %=>like printf 2. str(make a string) or repr(convert for interpreter) 'the value is x = ' + repr(x) + 'the value is y = ' + repr(y) The repr() of a string adds原创 2014-12-26 16:32:48 · 570 阅读 · 0 评论 -
Python - syntax errors and exception
1. syntax errors (arrow marks) 2. zero division error, name error, type error. 3. try except while True: try: x = int(raw_input("Input:"))原创 2015-01-04 21:21:44 · 919 阅读 · 0 评论 -
Python - class
c++ & python modula-3 a basic class: class ClassName: . . . it will generate a new namespace class MyClass: "A simple example class" i = 12345 def f(sel原创 2015-01-25 16:18:56 · 744 阅读 · 0 评论 -
django-simple-captcha & jquery validate
1. view.py from django.shortcuts import render from django.http import HttpResponseRedirect, HttpResponse import json from django import forms from captcha.fields import CaptchaField class Nam原创 2015-07-07 16:35:27 · 899 阅读 · 0 评论 -
django-simple-captcha refresh & validation
Preparation Download django-simple-captcha using pip by running: pip install django-simple-captcha Add captcha to the INSTALLED_APPS in your settings.py Run python manage.py syncdb (or py原创 2015-07-06 18:40:34 · 1284 阅读 · 0 评论