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 ...
随机推荐
- 使用CGIHTTPServer搭建简单网站
目录 一.前提准备 二.搭建web网站 如何快速搭建web网站?这个问题对于我这样的小白来说简直就是一脸懵逼毫无头绪.在学习python的过程接触到了 CGI 编程,至于CGI是什么?怎么运行的?这我 ...
- 一句话下载总结(用于后渗透上传payload)
利用ftp来下载payload文件 echo open 192.168.1.1 21> ftp.txt echo ftp>> ftp.txt echo bin >> ft ...
- <转载>深入 理解char * ,char ** ,char a[ ] ,char *a[] 的区别
C语言中由于指针的灵活性,导致指针能代替数组使用,或者混合使用,这些导致了许多指针和数组的迷惑,因此,刻意再次深入探究了指针和数组这玩意儿,其他类型的数组比较简单,容易混淆的是字符数组和字符指针这两个 ...
- xcode5 添加Build Phases脚本
http://www.runscriptbuildphase.com/ 版权声明:本文为博主原创文章,未经博主允许不得转载.
- docker 环境搭建步骤
配置CA: zhaoweipeng@bogon:~$ ls106 baseos.tar fabric-sdk fabric-sdk (1).tar fixture_106zhaoweipeng@bog ...
- PostgreSQL/GREENPLUM关联更新
update a_t AA set /*AA.*/ sqlstr = 'qqq' from a_t BB where aa.id <> BB.id and aa.name = BB.nam ...
- 使用QSlider
1.当绘制的线性图等需要水平拖动的时候(不用qwt里面的函数),可以用QSlider,代码如下 ui.horizontalSlider->setMaximum(); //需要拖动的越缓慢,平滑它 ...
- delphi 实现最小化系统托盘(rz控件最简单 评论)
1.new -->application 2.在form1中加入一个tPopMenu 命名为pm1 3.uses ShellAPI; 4.定义一个常量在 const WM_TRAYMSG = W ...
- 《转》python(7)列表
转自 http://www.cnblogs.com/BeginMan/p/3153842.html 一.序列类型操作符 1.切片[]和[:] 2.成员关系操作符(in ,not in ) 1: s1 ...
- Jupyter的使用复习
Jupyter的使用 esc+m 切换到markdown模式 shift+enter 运行 a 向上新增代码块 b 向下新增代码块 y python代码模式 file-->download as ...