#另外一种错误
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. swagger2注解使用方法

    swagger注解整体说明: @Api:用在请求的类上,表示对类的说明 tags="说明该类的作用,可以在UI界面上看到的注解" value="该参数没什么意义,在UI界 ...

  2. 区块链火爆,再不知道Golang就晚了

    Golang,也叫Go语言,是2009年刚刚被发发布的一门新语言. 区块链,是2019年我国提出的新战略. 一个不争的事实就是,大多数从事区块链开发的小伙伴都是用Golang,大多数招聘区块链技术工作 ...

  3. Codeforces 920E-Connected Components? (set,补图,连通块)

    Connected Components? CodeForces - 920E You are given an undirected graph consisting of n vertices a ...

  4. 一个线程相关的高CPU占用问题的定位

    最近在重构项目代码时,发现两个线程同时访问一个加锁的std::list队列时,会出现恶性竞争锁的现象. 具体现象是A线程总是拿不到锁,B线程抢占几次后,A才抢占到. 由于是重构项目,也无法通过回滚代码 ...

  5. string::capacity string::size string::length string::max_size

    size_t capacity() const noexcept; #include <iostream>#include <string> using namespace s ...

  6. Java8-Stream-No.10

    import java.util.Arrays; import java.util.IntSummaryStatistics; import java.util.List; import java.u ...

  7. Bootstrap-轮播图-No.6

    <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8&quo ...

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

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

  9. 乱搞 - LCT求LCA

    神犇学弟说LCA要用LCT求,于是我就听他的话写了一个LCT~ Code: #include <bits/stdc++.h> #define N 500005 #define lson t ...

  10. 【集训队作业2018】line

    DP方程十分简单,考虑前对后贡献即可. \(f_i = \min_{l_i \leq j < i} \left\{ f_j + \left(\max_{j < k \leq i} \lef ...