【python】python--helloworld
来源:互联网 发布:linux vi退不出来 编辑:程序博客网 时间:2024/05/22 09:21
一、在linux直接输入python,就可以进行编写,并且可以查看当前python版本
pythonexit()
二、第一个程序---hello world
vim 1.py#!/usr/bin/pythonprint 'hello world':wqpython 1.py
.py文件是源代码
三、修改执行权限
chmod +x 1.py./1.py
三、字节代码--------.pyc文件
vim 2.pyimport py_compilepy_compile.compile('1.py'):wqpython 2.py编译完成后,在当前文件夹获得1.pyc文件
四、优化代码---------.pyo文件
python -O -m py_comile 1.py(-O是大写的欧,不是0或者小写欧)
当前文件夹获得1.pyo文件
1.pyc和1.pyo文件改变执行权限后可以直接用过python执行,速度比解释文件1.py快
pyc和pyo都是二进制文件,所以不能通过./**的方法执行,只能是python **
阅读全文
0 0
- python helloworld
- Python - HelloWorld
- Python-helloworld
- 【python】python--helloworld
- 20080828 python HelloWorld
- Python之HelloWorld!
- python+django的helloworld
- Python Tkinter的HelloWorld
- python入门的 helloworld
- Python版 HelloWorld
- python安装和helloworld
- Python开发之helloworld
- Python文件操作 HelloWorld
- Python简单入门教程helloworld
- Python学习之-HelloWorld
- python HelloWorld模拟登录
- Python之HelloWorld
- python爬虫helloworld程序
- 运行时异常与非运行时异常的区别
- C++按引用传递参数的问题
- 用logstash导入ES且自定义mapping时踩的坑
- LibreOffice,一个集美貌与才华于一身的软件
- python3之listAndTuple
- 【python】python--helloworld
- codeforces 831 A
- C语言小函数——atol(自己实现)
- AngularJs ui select 禁止search
- 最长上升子序列1003
- 四种生成和解析XML文档的方法详解(介绍+优缺点比较+示例)
- python3 之if 判断
- 如何通过位移来置位
- 关于eclipse跑不起任何maven命令