''' Created on Apr 27, 2016 @author: yeshaoting '''
if __name__ == '__main__': print'你好,python!'
三、问题
python脚本里包含有中文时,报如下错误:
1 2 3 4 5 6 7
Traceback (most recent call last): File "/Applications/STS.app/Contents/Eclipse/plugins/org.python.pydev_4.5.5.201603221110/pysrc/pydevd.py", line 1529, in <module> globals = debugger.run(setup['file'], None, None, is_module) File "/Applications/STS.app/Contents/Eclipse/plugins/org.python.pydev_4.5.5.201603221110/pysrc/pydevd.py", line 936, in run pydev_imports.execfile(file, globals, locals) # execute the script File "/Users/yeshaoting/java/workspace/python-workspace/HelloPython/base/HelloWorld.py", line 8 SyntaxError: Non-ASCII character '\xe4'in file /Users/yeshaoting/java/workspace/python-workspace/HelloPython/base/HelloWorld.py on line 8, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
//be sure to inject $scope and $location var changeLocation = function(url, forceReload) { $scope = $scope || angular.element(document).scope(); if(forceReload || $scope.$$phase) { window.location = url; } else { //only use this if you want to replace the history stack //$location.path(url).replace();
//this this if you want to change the URL and add it to the history stack $location.path(url); $scope.$apply(); } };