2012年11月24日
摘要: Pyhton中的数据类型是一种弱类型,其实解释性语言基本上都是弱类型如Shell、Perl等。数据类型:intfloatStringListDict11.1a[‘a’,]{‘key’:’value’}In [1]: print type(1)<type 'int'>In [2]: print type(1.1)<type 'float'>In [3]: print type('a')<type 'str'>In [4]: print type(['a'])<type  阅读全文
posted @ 2012-11-24 14:28 njfylong 阅读(134) 评论(0) 推荐(0)
  2012年11月18日
摘要: 本章仅以Hello World为例,开启学习python的学习之路。1.python shell方式$python>>> print "Hello Wrold"Hello Wrold>>> 2. 使用编辑器创建hellowrold.py,并录入#!/usr/bin/pythonprint "Hello Wrold"保存,退出执行 hellowrold.py$python hellowrold.py或将helloworld.py添加可执行权限,$chmod a+x helloworld.py$./helloworld.p 阅读全文
posted @ 2012-11-18 17:18 njfylong 阅读(143) 评论(0) 推荐(0)
摘要: 1. python shell在终端中输入python后,会出现“>>>”提示符,此时进入python command line.2. 写成python脚本文件形式,形如"*.py"。运行python *.py,即可执行脚本就是以上是两种最常用的两种方式。但是python自带的交互是解释器(python shell)只提供到了最基本的功能,这里推荐使用ipython。 阅读全文
posted @ 2012-11-18 16:52 njfylong 阅读(416) 评论(0) 推荐(0)