博客
关于我
理解Python -m mod : run library module as a script
阅读量:404 次
发布时间:2019-03-04

本文共 659 字,大约阅读时间需要 2 分钟。

  • -m

    from python -h, -m mod : run library module as a script (terminates option list).

    Python modules are just script files that are located in a place where Python can find them.

    As with all scripts, you can just run them directly if you know where they are, e.g. python /path/to/module.py

  • __name__ in Python

    As we learn from ,a .py file can be executed in two ways:

    1. as main program
    2. imported by another
  • run library module as a script

    If you want run a module as main program, you should know the full path to the module ,like python /path/module.py, also can use the python -m module just get the same result.

    直接执行的是module.py脚本,通过-m参数是执行module实现执行module.py的效果。

转载地址:http://wuge.baihongyu.com/

你可能感兴趣的文章
Mysql什么时候建索引
查看>>
MySql从入门到精通
查看>>
MYSQL从入门到精通(一)
查看>>
MYSQL从入门到精通(二)
查看>>
mysql以下日期函数正确的_mysql 日期函数
查看>>
mysql以服务方式运行
查看>>
mysql优化--索引原理
查看>>
MySQL优化之BTree索引使用规则
查看>>
MySQL优化之推荐使用规范
查看>>
Webpack Critical CSS 提取与内联教程
查看>>
mysql优化概述(范式.索引.定位慢查询)
查看>>
MySQL优化的一些需要注意的地方
查看>>
mysql优化相关
查看>>
MySql优化系列-优化版造数据(存储过程+函数+修改存储引擎)-2
查看>>
MySql优化系列-进阶版造数据(load data statment)-3
查看>>
MySql优化系列-造数据(存储过程+函数)-1
查看>>
MySQL优化配置详解
查看>>
Mysql优化高级篇(全)
查看>>
mysql会员求积分_MySql-统计所有会员的最高前10次的积分和
查看>>
mysql会对联合索性排序优化_MySQL索引优化实战
查看>>