发现代码都没有错。后来是改成这样:

def pprint():name=var.get()print(name)
var=StringVar()
Label(root,text='姓名:',font=('微软雅黑',20)).grid()
#inputStr1 = Entry(root,font=('微软雅黑',20)).grid(row=0,column=1)
Entry(root,textvariable=var,font=('微软雅黑',20)).grid(row='0',column='1') #设置输入框对应的文本变量为var

Python脚本报错AttributeError: ‘module’ object has no attribute’get’解决方法相关推荐

  1. Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法

    解决方法:xx.py文件名时,xx不要是python保留字 原理:因为使用了Python系统库的名字,所以在编译的时候才会产生.pyc文件. 正常的Python文件在编译运行的时候是不会产生.pyc文 ...

  2. python导入自定义模块报attributeerror_Python脚本报错AttributeError: ‘module’ src has no attribute’xxx’解决方法...

    在跑论文源码时报出的错误,其中"src"是源码中的一个文件夹,同时是一个包(因为有_init_.py文件)整个项目文件组织如下: 出错的py文件在utils文件夹下,追踪定位出错代 ...

  3. python中引入包的时候报错AttributeError: module ‘sys‘ has no attribute ‘setdefaultencoding‘解决方法?

    python中引入包的时候报错AttributeError: module 'sys' has no attribute 'setdefaultencoding'解决方法? 参考文章: (1)pyth ...

  4. python 报错 AttributeError: module ‘time‘ has no attribute ‘clock 解决方法

    源码如下: #引入所需要的时间库 import datetime import time#程序计时器,启动计时器 start = time.clock()#中间是放置需要测试运行时间的程序代码#计算启 ...

  5. 【pycharm】pycharm上安装tensorflow,报错:AttributeError: module ‘pip‘ has no attribute ‘main‘ 解决方法

    [pycharm]pycharm上安装tensorflow,报错:AttributeError: module 'pip' has no attribute 'main' 解决方法 参考文章: (1) ...

  6. 运行shell脚本报错:“syntax error near unexpected token 的解决方法”

    运行shell脚本报错:"syntax error near unexpected token 的解决方法" 今天写了个Cshell脚本,运行报错syntax error near ...

  7. python 执行报错AttributeError: 'list' object has no attribute 'g'

    ^ SyntaxError: invalid syntax E:\数学-机器学习-西瓜书-周志华\UDACITY购课\project1 矩阵操作>python test.py Traceback ...

  8. Python之报错AttributeError:'CocaCola' object has no attribute 'local_logo'

    试运行class类的代码如下,然而有报错信息:AttributeError:'CocaCola' object has no attribute 'local_logo' class CocaCola ...

  9. AttributeError: module 'select' has no attribute 'error'解决方法

    gevent 实现多协程的时候,出现了上面的错误 错误的代码如下: import requests from gevent import monkey monkey.patch_all() impor ...

最新文章

  1. 内存溢出分析之工具篇
  2. prism4.0——chapter 2:初始化Prism应用
  3. 根据后续数组重建搜索二叉树
  4. UML之涉众/参与者(角色/执行者)(Actor)/业务主角(BusinessActor)/业务工人(BusinessWorker)/用户/角色辨析【图解】...
  5. 012.对netmap API的解读
  6. 用于用户C语言标识符,下列可用于C语言用户标识符的一组是( )
  7. java常用算法_五分钟记住Java常用的八种排序算法与代码实现
  8. Windows7下无法安装Oracle11.1.0问题
  9. 【体系结构】共享SQL的理解
  10. 51. Element replaceChild() 方法
  11. C语言-简介及IDE介绍
  12. 二级Visual Basic语言视频教程
  13. 手机如何在线图片识别?3大教程,一键轻松图片转文字
  14. Android中通用配器的使用
  15. 前端页面查看PDF文档内容总结
  16. docker run中-v参数的用法解释
  17. linux-文件切割-splitcsplit
  18. DDR4 硬件设计笔记
  19. HashMap 深拷贝
  20. 企业网站为何要改版,需要注意哪些事项?

热门文章

  1. 你有哪些受益无穷的好习惯
  2. Debian10搭建Samba文件共享服务器
  3. python爬区csdn文章信息(原始稿)
  4. RTC Meetup | 这可能是年底最大、最有料的实时音视频开发者聚会交流
  5. 第七课 程小奔之奔跑的兔子
  6. 2022年xx地 信息安全管理与评估赛题
  7. [数字货币量化交易] 第1部分--概述和介绍
  8. 【车载开发】Android Automotive车载操作系统开发解密篇
  9. c语言2= 3=2 2 1,经典证明:1+2+3+…+(n-1) = C(n,2)
  10. js 通过正则过滤 emoji 表情