1.print "hello world!";SyntaxError:Missing parentheses in call to ‘paint’ . Did you mean print(“hello world”);?
在调用“paint”时缺少圆括号。
上面的语法在python3中是错误的。在python3中,你需要将helloworld加括号。print ("hello world!");
2.python中出现SyntaxError: Non-UTF-8 code 解决方法:
第一种,设置源码文件编码,放在源码文件第一第二行:# coding=
第二种,通用的编辑器设置编码:# -*- coding: -*-
第三种:# vim: set fileencoding= :
第四种,没有翻译行,使用纯文本:# This Python file uses the following encoding: utf-8
例子:在程序开始处添加一条如上所未的编码定义其中gbk(带有中文的编码)或者其他编码格式所指定的编码。
#!/usr/bin/python#-*-coding:gbk-*-
3.在window系统cmd中通过pip指令安装其他模块包失败,老是提示找不到相应的参数。
方法:在环境变量配置中,不仅要把python配进去,还要把python下的scripts路径配进去,因为pip指令在scripts路径下。