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=<encoding name>
第二种,通用的编辑器设置编码:# -*- coding: <encoding name> -*-
第三种:# vim: set fileencoding=<encoding name> :
第四种,没有翻译行,使用纯文本:# This Python file uses the following encoding: utf-8

例子:在程序开始处添加一条如上所未的编码定义其中gbk(带有中文的编码)或者其他编码格式所指定的编码。

#!/usr/bin/python 
#-*-coding:gbk-*-

 详细请看官方文档:https://www.python.org/dev/peps/pep-0263/

3.在window系统cmd中通过pip指令安装其他模块包失败,老是提示找不到相应的参数。

方法:在环境变量配置中,不仅要把python配进去,还要把python下的scripts路径配进去,因为pip指令在scripts路径下。

 

 

posted on 2017-12-26 11:29  red_rose  阅读(307)  评论(0编辑  收藏  举报