随笔分类 -  python

摘要:对python源码进行编译 1.生成.pyc文件 import py_compile py_compile.compile('hello.py') 2.优化源码文件 python -O -m py_compile 1.py 生成.pyo文件 例子: 1 [root@lvs-master tool]# 阅读全文
posted @ 2019-05-04 15:55 辉bird 阅读(1744) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os,sys #计数器,记录错误数来强制结束程序。 err_num=0 TNS={ '172.16.132.3':{'username':'root','password':'xxxx','m 阅读全文
posted @ 2019-05-04 15:51 辉bird 阅读(1072) 评论(0) 推荐(0)
摘要:安装python3步骤: 1、先解决依赖 # yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel lib 阅读全文
posted @ 2018-09-27 17:07 辉bird 阅读(336) 评论(0) 推荐(0)
摘要:1 笔记记录: 2 1、#交互,输入name 3 name = raw_input('what is your name?') 4 #实现多行交互输入,输入Q结束输入 5 user_date='' 6 stopword='Q' 7 with open("tmp.txt",'w') as f: 8 f 阅读全文
posted @ 2018-08-29 20:08 辉bird 阅读(233) 评论(0) 推荐(0)