#另外一种错误
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. mysql—数据库优化——如何选择合适的索引

    索引的分类: 普通索引: 唯一索引: 主键索引:特殊的唯一索引,唯一且不能有null值: 全文索引:全文索引用来对表中的文本域(char, varchar, text)进行索引 全文索引针对myisa ...

  2. ftp定时下载指定目录或文件脚本

    #! /bin/bash rpm -qa lftp &>/dev/null || yum install -y lftp lftp 160.106.0.34 << EOF c ...

  3. Linux命令之tree(目录树结构)

    tree命令 官方下载地址:http://mama.indstate.edu/users/ice/tree/,右键复制如下图地址: 下载: 执行wget  http://mama.indstate.e ...

  4. 大数据结构设计V1.0

  5. Markdown使用教程(转载收藏)

    基础语法 标题 Markdown支持6种级别的标题,对应html标签 h1 ~ h6 # h1 ## h2 ### h3 #### h4 ##### h5 ###### h6 以上标记效果如下: h1 ...

  6. HDU 6107 - Typesetting | 2017 Multi-University Training Contest 6

    比赛的时候一直念叨链表怎么加速,比完赛吃饭路上突然想到倍增- - /* HDU 6107 - Typesetting [ 尺取法, 倍增 ] | 2017 Multi-University Train ...

  7. python中重要的概念:类(class)

    1.名词解释 类:类代表了具有相同特征的一类事物(人) 对象.实例:具体的某一个事物或者是人 实例化:将类变成对象的这么一个过程,即新建一个对象的过程,就是对类的一个实例化过程. 2.格式 函数定义: ...

  8. PHP mysqli_get_host_info() 函数

    定义和用法 mysqli_get_host_info() 函数返回 MySQL 服务器主机名和连接类型. 语法 mysqli_get_host_info(connection); 返回 MySQL 服 ...

  9. 【线性代数】2-4:矩阵操作(Matrix Operations)

    title: [线性代数]2-4:矩阵操作(Matrix Operations) toc: true categories: Mathematic Linear Algebra date: 2017- ...

  10. 7.20套娃(tao)

    套娃(tao) input7 39 53 710 65 102 610 104 110 53 53 9output012 sol: 把查询想象成(x1,y1)向(x2,y2)有边当且仅当(x1< ...