楼主: Enthuse
1178 0

How to run python [推广有奖]

  • 4关注
  • 39粉丝

已卖:995份资源

大师

8%

还不是VIP/贵宾

-

威望
0
论坛币
75391 个
通用积分
825.9999
学术水平
103 点
热心指数
114 点
信用等级
86 点
经验
299244 点
帖子
12952
精华
0
在线时间
5848 小时
注册时间
2007-4-7
最后登录
2024-1-22

楼主
Enthuse 发表于 2015-5-1 21:51:05 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
You can launch python interactly, from IDLE, file icon cliks,
module imports, exec calls, or from a system command line, just to name a few.

module import is a typical way to run files of code. Once imported, the importer gain access to all the names assigned at the top level of a module's file.

There are two different syntax

1. import myfile
2. from myfile import atrribute

once imported, you can use the built-in dir function to fetch a list of all the names available inside a module.
a tricky issue is that reload() is not transitive -- reloading a module reloads that module only, not any modules
it may import -- so you have to do it manually.

In summary, Python programs are composed of multiple module files linked together by import statements, and each module
file is a package of variable -- that is, a namespace. Each module is a self-contained namespace: one module file cannot see
the names defined in another file unless it explicitly imports that other file.

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:python How Run Statements statement failure success Running python different

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-8 04:40