文章类型选成“转载”,要上传资源链接。但是插入以下的文章链接就报错???所以选择“原创”。但是本篇笔记都是转载!
- pycharm 调用统计目录文件出错
转自https://blog.csdn.net/qq_36701743/article/details/90199283
右键
Mark Directory as->Sources Root
- pycharm调用其他文件函数
转自https://blog.csdn.net/hqs2212586/article/details/86582272
source.py文件:
def func(): pass
new.py文件:
import source # 或者 from source import func
- pycharm掉用其他文件类
转自https://blog.csdn.net/hqs2212586/article/details/86582272
Student.py文件:
class Student:
def __init__(self, name, age, sex):
self name = name
self age = age
self sex =sex
def learn(self):
print("学生学习!")
handler.py文件:
from Student import Student
s = Student('egon', 18, 'male')
s.learn()
# 或者
import Student
s = Student.Student('jack', 28, 'male')
s.learn()