0
def GPSPositionChanged(e):
source = e.device
print("F%, F%, F%") %(e.latitude, e.longitude, e.altitude)
带来的不支持的格式字符编码蟒
unsupported character ',' (0x2c) at index 2.
任何想法的错误?
def GPSPositionChanged(e):
source = e.device
print("F%, F%, F%") %(e.latitude, e.longitude, e.altitude)
带来的不支持的格式字符编码蟒
unsupported character ',' (0x2c) at index 2.
任何想法的错误?
你在错误的地方%
,它应该是:
print("%F, %F, %F") % (e.latitude, e.longitude, e.altitude)
用后的一个例子沿全追踪错误味精'e'对象? –
尝试用'%f'替换所有'%'...(https://docs.python.org/2/library/stdtypes.html#string-formatting-operations) – thebjorn
@thebjorn我将F%与% f,工作完美谢谢你。 –