#另外一种错误
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(

查看代码,格式如下:

print "文件%s不存在" % filename
。。。
print '-------xxx------' 改成
print ("文件%s不存在" % filename)
print ('-------xxx------')

参考:https://stackoverflow.com/questions/41341149/python-3-6-0-syntax-error-missing-parentheses-in-call-to-print?noredirect=1&lq=1

Python3.x运行Python2.x代码报错 syntax error "Missing parentheses in call to 'print'的更多相关文章

  1. 关于报错“syntax error near unexpected token `”和回车换行

    本来是很简单一个事情,转过来是因为打字机这事比较有趣…… http://blog.csdn.net/xyp84/archive/2009/08/11/4435899.aspx 摘要一下: 回车 换行 ...

  2. 一个参数大小写引发的uploadify报错 "Syntax error, unrecognized expression: #"

     上传控件uploadify 报错"Syntax error, unrecognized expression: #" 版本为 uploadify3.2  报错原因:参数ID[hi ...

  3. JS function document.onclick(){}报错Syntax error on token "function", delete this token

    JS function document.onclick(){}报错Syntax error on token "function", delete this token func ...

  4. JS function document.onclick(){}报错Syntax error on token "function", delete this token - CSDN博客

    原文:JS function document.onclick(){}报错Syntax error on token "function", delete this token - ...

  5. 【问题与解决】Github 上传代码报错(error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version)

    今天修改了GitHub 的代码,代码更新,想上传更新,却发现上传报错. 错误代码:error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 al ...

  6. linux shell 报错 Syntax error: Bad for loop variable

    在linux下写了一个简单的shell,循环10次. test.sh #!/bin/bash ## ##循环10次 ## ; i<; i++)); do echo Good Morning ,t ...

  7. php Yii2使用registerJs或registerCss报错syntax error, unexpected end of file

    解决方法: 注册时$js=<<<JS .....JS;//结尾处JS;应单独成行并且没有空格  JS;//这样就会报错,多了空格JS;//这样就不会

  8. artTemplate--使用artTemplate时,由于json对象属性有数字命名格式 导致调用报错 syntax error

    案例 今天在使用artTemplate做开发时,遇到一个比较奇葩的问题,就是使用json对象去获取值得时候,报如下错误: Template Error <temp> function an ...

  9. js文件报错Syntax error on token "Invalid Regular Expression Options", no accurate correction

    Syntax error on token "Invalid Regular Expression Options", no accurate correction 1.选中报错的 ...

随机推荐

  1. 团队第三次作业:Alpha版本第一周小结

    姓名 学号 周前计划安排 每周实际工作记录 自我打分 XXX 061109 1.原型设计与编码任务分配 2.构思程序个性化测试模块的初步实现 1.原型设计与编码任务分配 2.设计了部分类及其成员函数( ...

  2. Angular Multiple HTTP Requests with RxJS

    原文:https://coryrylan.com/blog/angular-multiple-http-requests-with-rxjs ----------------------------- ...

  3. go包中的init() 函数

    https://tutorialedge.net/golang/the-go-init-function/ ---------------------------------------------- ...

  4. GNU Radio下QT GUI Tab Widget的使用方法

    期望显示出的效果: 即将要显示的图放在各自的标签页中. 整体框图: 具体设置: QT GUI Tab Widget的设置: 其中 ID改为自己想改的,这里我写的是display GUI Hint所代表 ...

  5. CodeForces - 1202F You Are Given Some Letters... (整除分块)

    题意:一个字符串包含a个A和b个B,求这个字符串所有可能的循环节长度(末尾可能存在不完整的循环节) 好题,但思路不是很好想. 首先由于循环节长度可以任意取,而循环次数最多只有$O(\sqrt n)$个 ...

  6. Hosts 文件切换工具

    建议删除无用的注释,否则在启用全部的时候会把注释和说明内容的注释取消掉 下载地址:

  7. 以组件的方式,添加redis_cache

    settings.py中文件内设置如下: CACHES = { 'default':{ 'BACKEND':'django_redis.cache.RedisCache', 'LOCATION':'r ...

  8. 【bzoj2141】排队 [国家集训队2011]排队(树套树)

    题目描述 排排坐,吃果果,生果甜嗦嗦,大家笑呵呵.你一个,我一个,大的分给你,小的留给我,吃完果果唱支歌,大家乐和和. 红星幼儿园的小朋友们排起了长长地队伍,准备吃果果.不过因为小朋友们的身高有所区别 ...

  9. 02_pip区别: linux环境下python2,python3的

    1.pip与pip3理解 centos中,我的pip与pip3都是python2.7的,所以无法安装成功,总是安装成python2的 [root@IP ~]# pip -V pip /site-pac ...

  10. [ML] The Basics: Training Your First Model

    The problem we will solve is to convert from Celsius to Fahrenheit, where the approximate formula is ...