随笔分类 - python自动化运维
python系统学习
摘要:1 #!/usr/bin/env python 2 # -*- coding: utf-8 -*- 3 __author__ = 'xiaojian' 4 ''' 5 内置迭代器工具 6 itertools常用工具函数 7 count(start,[step]) #从start开始,以step步长进行计数迭代 8 cycle(seq) #无限循环迭代se...
阅读全文
摘要:# 装饰器使用小高潮 import time def timr(func): # timr(func)=timr(test1) func=test1 def deco(*args): start_time = time.time() func(*args) # run test1() stop_time = time.time() ...
阅读全文
摘要:# -*- coding: utf-8 -*- __author__ = 'hjianli' # import re import os info_message = """Alex 100000 Rain 80000 Egon 50000 Yuan 30000 """ #序列字典 xulie_di
阅读全文
摘要:python实现简单的循环购物车小功能 # -*- coding: utf-8 -*- __author__ = 'hujianli' shopping = [ ("iphone6s", 5000), ("book python", 81), ("iwach", 3200), ("电视机", 220
阅读全文
摘要:python编写一个三级while的循环菜单 1.定义字典,字典里面嵌套字典,内嵌字典的值为列表。 思路: # -*- coding: utf-8 -*- __author__ = 'hujianli' import sys Hbei_map = { "武汉市":{ "江岸区":["上海街","大智
阅读全文
摘要:# -*- coding: utf-8 -*- __author__ = 'hujianli' import json,os,sys super_admin = "该程序为了防止用户记不住密码,初始了一个超管用户,超管用户admin,密码联系管理员询问:" name = "请您输入注册后登录网页程序
阅读全文