day22_2-sys模块
# ********************day22_2-sys模块 *******************
# ********************day22_2-sys模块 *******************
# ********************day22_2-sys模块 *******************# 参考资料:
# python模块(转自Yuan先生) - 狂奔__蜗牛 - 博客园
# https://www.cnblogs.com/guojintao/articles/9070485.html# =====>>>>>>内容概览
# =====>>>>>>内容概览
# =====>>>>>>内容概览 '''
# ------------------------------------------------------------
# # 1、sys.argv ???
# # # 命令行参数List,第一个元素是程序本身路径
# ------------------------------------------------------------ # ------------------------------------------------------------
# # 2、sys.exit(n) 退出程序,正常退出时exit(0)
# # # 退出程序,正常退出时exit(0)
# ------------------------------------------------------------ # ------------------------------------------------------------
# # 3、sys.version
# # # 获取Python解释程序的版本信息
# # # ==>>>应用场景:当程序拷贝到其他的电脑的时候,需要进行对电脑的运行环境进行获取,
# # # 以保证程序在其他的操作系统环境下能够正常的运行
# ------------------------------------------------------------ # ------------------------------------------------------------
# # 4、sys.maxint
# # # 最大的Int值 (python 2 中才有这个模块)
# ------------------------------------------------------------ # ------------------------------------------------------------
# # 5、sys.path
# # # 返回模块的搜索路径,初始化时使用PYTHONPATH环境变量的值
# ------------------------------------------------------------ # ------------------------------------------------------------
# # 6、sys.platform
# # # 返回操作系统平台名称
# # # ==>>>应用场景:当程序拷贝到其他的电脑的时候,需要进行对电脑的运行环境进行获取,
# # # 以保证程序在其他的操作系统环境下能够正常的运行
# ------------------------------------------------------------ # ------------------------------------------------------------
# # 7、sys实例:进度条
# ------------------------------------------------------------
------------------------------------------------分割线-------------------------------------------------
------------------------------------------------分割线-------------------------------------------------
------------------------------------------------分割线-------------------------------------------------
'''
# ------------------------------------------------------------
# # 1、sys.argv
# # # 命令行参数List,第一个元素是程序本身路径
# # # Python中 sys.argv[]的用法简明解释 - CSDN博客
# # # https://blog.csdn.net/xu380393916/article/details/81486773
# ------------------------------------------------------------
'''
#
# import sys
# print(sys.argv)
#
# # D:\Anaconda3\python.exe D:/C_cache/py/day22_os_json_re_etc_MoKuai/day22_2_os_json_re_etc_MoKuai.py
# # ['D:/C_cache/py/day22_os_json_re_etc_MoKuai/day22_2_os_json_re_etc_MoKuai.py']
# #
# # Process finished with exit code 0 '''
# ------------------------------------------------------------
# # 2、sys.exit(n) 退出程序,正常退出时exit(0)
# # # 退出程序,正常退出时exit(0)
# ------------------------------------------------------------
'''
#
# import sys
# msg ='''
# 1:输入
# 2:退出
# '''
# dic = {
# "d_get":"1",
# "d_exit":"2"
# }
# while True:
# print(msg)
# usr_input = input("请输入选项:")
# if usr_input == dic["d_get"]:
# continue
# elif usr_input == dic["d_exit"]:
# sys.exit(0)
#
# # D:\Anaconda3\python.exe D:/C_cache/py/day22_os_json_re_etc_MoKuai/day22_2_os_json_re_etc_MoKuai.py
# #
# # 1:输入
# # 2:退出
# #
# # 请输入选项:1
# #
# # 1:输入
# # 2:退出
# #
# # 请输入选项:1
# #
# # 1:输入
# # 2:退出
# #
# # 请输入选项:2
# #
# # Process finished with exit code 0 '''
# ------------------------------------------------------------
# # 3、sys.version
# # # 获取Python解释程序的版本信息
# # # ==>>>应用场景:当程序拷贝到其他的电脑的时候,需要进行对电脑的运行环境进行获取,
# # # 以保证程序在其他的操作系统环境下能够正常的运行
# ------------------------------------------------------------
'''
#
# import sys
# print(sys.version)
#
# # D:\Anaconda3\python.exe D:/C_cache/py/day22_os_json_re_etc_MoKuai/day22_2_os_json_re_etc_MoKuai.py
# # 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)]
# #
# # Process finished with exit code 0 '''
# ------------------------------------------------------------
# # 4、sys.maxint
# # # 最大的Int值 (python 2 中才有这个模块)
# ------------------------------------------------------------
'''
# 以下的环境是在python2.7中运运行的
# import sys
# print(sys.maxint)
#
# # D:\C_cache\py\day18_WenJianChuLi\venv\Scripts\python.exe D:/C_cache/py/day22_os_json_re_etc_MoKuai/day22_2_os_json_re_etc_MoKuai.py
# # 2147483647
# #
# # Process finished with exit code 0 '''
# ------------------------------------------------------------
# # 5、sys.path
# # # 返回模块的搜索路径,初始化时使用PYTHONPATH环境变量的值
# ------------------------------------------------------------
'''
#
# import sys
# print(sys.path)
#
# # D:\Anaconda3\python.exe D:/C_cache/py/day22_os_json_re_etc_MoKuai/day22_2_os_json_re_etc_MoKuai.py
# # ['D:\\C_cache\\py\\day22_os_json_re_etc_MoKuai', 'D:\\C_cache\\py\\day22_os_json_re_etc_MoKuai', 'D:\\Anaconda3\\python36.zip', 'D:\\Anaconda3\\DLLs', 'D:\\Anaconda3\\lib', 'D:\\Anaconda3', 'D:\\Anaconda3\\lib\\site-packages', 'D:\\Anaconda3\\lib\\site-packages\\win32', 'D:\\Anaconda3\\lib\\site-packages\\win32\\lib', 'D:\\Anaconda3\\lib\\site-packages\\Pythonwin', 'D:\\Program Files (x86)\\PyCharm 2018.1.3\\helpers\\pycharm_matplotlib_backend']
# #
# # Process finished with exit code 0 '''
# ------------------------------------------------------------
# # 6、sys.platform
# # # 返回操作系统平台名称
# # # ==>>>应用场景:当程序拷贝到其他的电脑的时候,需要进行对电脑的运行环境进行获取,
# # # 以保证程序在其他的操作系统环境下能够正常的运行
# ------------------------------------------------------------
'''
#
# import sys
# print(sys.platform)
#
# # D:\Anaconda3\python.exe D:/C_cache/py/day22_os_json_re_etc_MoKuai/day22_2_os_json_re_etc_MoKuai.py
# # win32
# #
# # Process finished with exit code 0 '''
# ------------------------------------------------------------
# # 7、sys实例:进度条
# ------------------------------------------------------------
'''
# # 方式一:
# import sys,time
# i = 0
# while i<100:
# sys.stdout.write(">")
# sys.stdout.flush()
# i +=1
# time.sleep(0.02)
# print("\n完成传输!")
#
# # D:\Anaconda3\python.exe D:/C_cache/py/day22_os_json_re_etc_MoKuai/day22_2_os_json_re_etc_MoKuai.py
# # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# # 完成传输!
# #
# # Process finished with exit code 0 # # 方式二:
# import sys,time
# for i in range(100):
# sys.stdout.write(">")
# sys.stdout.flush()
# time.sleep(0.02)
# print("\n完成传输!")
#
# # D:\Anaconda3\python.exe D:/C_cache/py/day22_os_json_re_etc_MoKuai/day22_2_os_json_re_etc_MoKuai.py
# # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# # 完成传输!
# #
# # Process finished with exit code 0
day22_2-sys模块的更多相关文章
- python常用模块(模块和包的解释,time模块,sys模块,random模块,os模块,json和pickle序列化模块)
1.1模块 什么是模块: 在计算机程序的开发过程中,随着程序代码越写越多,在一个文件里代码就会越来越长,越来越不容易维护. 为了编写可维护的代码,我们把很多函数分组,分别放到不同的文件里,这样,每个文 ...
- python标准模块(os及sys模块)
一.os模块 用于提供系统级别的操作 os.getcwd() 获取当前工作目录 os.stat('path/filename') 获取文件/目录信息,其中包括文件大小等 os.sep 获得操作系统特定 ...
- [转载]python中的sys模块(二)
#!/usr/bin/python # Filename: using_sys.py import sys print 'The command line arguments are:' for i ...
- [转载]Python中的sys模块
#!/usr/bin/python # Filename: cat.py import sys def readfile(filename): '''Print a file to the stand ...
- python之sys模块详解
python之sys模块详解 sys模块功能多,我们这里介绍一些比较实用的功能,相信你会喜欢的,和我一起走进python的模块吧! sys模块的常见函数列表 sys.argv: 实现从程序外部向程序传 ...
- sys模块和os模块,利用sys模块生成进度条
sys模块import sysprint(sys.argv)#sys.exit(0) #退出程序,正常退出exit(0)print(sys.version) #获取 ...
- os和sys模块
sys模块 sys模块主要是用于提供对python解释器相关的操作 函数 sys.argv #命令行参数List,第一个元素是程序本身路径 sys.path #返回模块的搜索路径,初始化时使用PYTH ...
- python中os和sys模块的详解
平时在工作中经常会用到os模块和sys模块的一些特性,下面是这些特性的一些相关解释,希望对大家有所帮助 os模块 os.getcwd() 获取当前工作目录,即当前python脚本工作的目录路径 os. ...
- Python学习总结12:sys模块
sys模块常用来处理Python运行时配置以及资源,从而可以与前当程序之外的系统环境交互. 1. 导入及函数查看 >>> import sys #导入sys模块 >>&g ...
- sys模块的初步认识
#!/usr/bin/python # Filename: cat.py import sys def readfile(filename): '''Print a file to the stand ...
随机推荐
- javabean 深拷贝
<!-- https://mvnrepository.com/artifact/uk.com.robust-it/cloning --> <dependency> <gr ...
- 快速失败and安全失败
快速失败: 举个栗子: public static void main(String[] args) { ArrayList<String> list=new ArrayList<& ...
- vue-cli搭建vue开发环境
前置环境 npm install -g vue-cli vue list 已安装环境后: vue init webpack sell 建立项目名称sell----------------------- ...
- leetcood学习笔记-171-excel表列序号
题目描述: 方法: class Solution: def titleToNumber(self, s: str) -> int: num = 0 r = 1 for i in s[::-1]: ...
- __str__方法
"""str()就是可以自定义输出返回值,必须是str字符串""" class Dog: def __init__(self, name): ...
- 【题解】P1440 求m区间内的最小值
求m区间内的最小值 题目描述: 一个含有n项的数列(n<=2000000),求出每一项前的m个数到它这个区间内的最小值.若前面的数不足m项则从第1个数开始,若前面没有数则输出0. 分析: 读题之 ...
- 16-MySQL-Ubuntu-数据表的查询-分组与聚合(五)
分组(group by)一般与聚合结合使用 (1)查询按性别分组 select gender from students group by gender; (2)查询按性别分组并统计每组的数量sele ...
- WebService接口测试
- java笔试之查找组成一个偶数最接近的两个素数
任意一个偶数(大于2)都可以由2个素数组成,组成偶数的2个素数有很多种情况,本题目要求输出组成指定偶数的两个素数差值最小的素数对. package test; import java.util.Sca ...
- std::unorder_set你插入元素的顺序不一定就是元素在里面的元素
去看了下cppreference,里面写了 根据哈希值排序了