-9
,我想下面的字符串转换:的Python:如何切串起来,用它的一部分,并丢弃他人Python3
bpy.types.object.location.* std:label -1 editors/3dview/object/properties/transforms.html#bpy-types-object-location Transform Properties
对此以下字符串:
("bpy.types.Object.location.*", "editors/3dview/object/properties/transforms.html"),
目前,我只有:
with open("objects.tmp") as f:
for line in f:
if "bpy.types." in line:
fw (' ("' + line.rstrip() +'")\n')
如何在特定点处切断字符串*
或/和X空格后?
通过做一个教程和阅读文档,然后尝试它自己...此外,您显示的所需输出不是一个字符串。 – schwobaseggl
假设你所有的字符串都遵循类似的模式,你可以试试:'tuple(string.split()[0],string.split()[3])'...但这真的很容易出错。你目前有什么代码? – blacksite
你需要解析它。什么决定保留什么?你有什么尝试? – Carcigenicate