从另一个文件导入变量? [英] Importing variables from another file?

查看:122
本文介绍了从另一个文件导入变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



示例: file1 具有变量 x1 x2 如何将它们传递给 file2



如何将变量的全部导入另一个变量?

解决方案

  from file1 import * 

将导入file1中的所有对象和方法


How can I import variables from one file to another?

example: file1 has the variables x1 and x2 how to pass them to file2?

How can I import all of the variables from one to another?

解决方案

from file1 import *  

will import all objects and methods in file1

这篇关于从另一个文件导入变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆