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 ...
随机推荐
- ES6面试 知识点汇总(全)
近期在复习ES6,针对ES6新的知识点,以问答形式整理一个全面知识和问题汇总.(全干货,适合对ES6有一定理解的同学复习,以及ES6面试.) 一.问:ES6是什么? 答: ES6是新一代的JS语言标准 ...
- ZF、TP、CI等各种框架的区别
(原标题:面试常见问题之ZF.TP.CI等框架的区别 http://blog.163.com/m13341159039_1/blog/static/245953061201522092212820/) ...
- MTT学习小记
这是个毒瘤题才有的毒瘤东西--奶一口NOI不考 拆系数FFT: 考虑做NTT时模数不是NTT模数(\(2^a*b+1\))怎么办? 很容易想到拆次数FFT. 比如说现在求\(a*b\),设\(m=\s ...
- 归并排序c语言
void mergeAdd(int arr[], int left, int mid, int right, int *temp){ int i = left; ; int k = left;//临时 ...
- tesseract-ocr,tesseract,pytesseract在windows下怎么安装
废话不多说,直接介绍如何下载安装tesseract-OCR以及pytesseract和PIL资源 文末百度网盘都有Tesseract是一个开源的OCR引擎,能识别100多种语言(中,英,韩,日,德,法 ...
- NX二次开发-UFUN修改当前导出CGM文件选项设置UF_CGM_set_session_export_options
文章转载自唐康林NX二次开发论坛,原文出处: http://www.nxopen.cn/thread-126-1-1.html 刚才有同学问到这个问题,如果是用NXOpen来做,直接录制一下就可以了: ...
- flutter 修饰盒子
decoration: BoxDecoration( borderRadius: BorderRadius.circular(), //圆角 gradient: RadialGradient( col ...
- (转)linux下装tomcat
转载于:http://www.linuxidc.com/Linux/2016-11/136959.htm (linux社区) 1 tomcat介绍 Tomcat 是由 Apache Foundatio ...
- Cortex-M3的异常/中断屏蔽寄存器组
转自 1. Cortex-M3的异常/中断屏蔽寄存器组 注:只有在特权级下,才允许访问这3个寄存器. 名 字 功能描述 PRIMASK 只有单一比特的寄存器.置为1后,就关掉所有可屏蔽异常,只剩下NM ...
- POJ2406-Power Strings-KMP循环节/哈希循环节
Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc&quo ...