python-3.x - 问题 /bin/sh: 0: Illegal option -* running code in python3
问题描述
在 UTF8 中配置的错误图像和编辑器 我正在尝试在 python 3.7.5 中运行以下代码
pi = 3.14159
radius = 15.3
print ('Circle Area is', pi * radius ** 2)
不运行错误出现:SyntaxError: Non-ASCII character '\ xc3' in file
添加命令行#! - * - conding: utf8 - * -
出现以下错误:
/ bin / sh: 0: Illegal option - *
解决方案
它应该没有空格,也不是conding
它的coding
# -*- coding: utf-8 -*-
不是
#! - * - conding: utf8 - * -
推荐阅读
- c# - Asp.net Core UseExceptionHandler 不工作 POST 请求
- r - 仅在有信息的地方制作 ggplot2 facet_grid 面板
- python - 需要从散点图 (xy) 中提取最高值:最高 X 和最高 Y
- java - 通过使用我现有的 POT 线路拨打号码,使用家庭电话和树莓派拨打电话
- python - 在处理零行时在 django 中 filter().update() 的最佳方法?
- api - 如何使用 Microsoft Graphs 访问共享邮箱
- ios - Swift:在字符串中搜索字符串并获取索引
- google-cloud-platform - BigQuery - 集群表不使用多个键减少查询大小
- ios - 使用多重采样进行离屏渲染
- google-kubernetes-engine - 在 GKE 中将就绪的 SSD 安装到 Pod 上