我有 Python 代码,我想从中提取 HTTP 参数。
在以下内容中:我怎样才能不理会这些def
行,但从剩余的行中只保留可能在一行中params['...']
有多个的内容:params['...']
输入:
def delete_bazooka (request):
BType.objects.get(id=params['id']).delete()
BType.objects.get(name=params['name']).delete()
def create_bazooka (request):
s = Skill.objects.get(id=params['skill'])
l = Level.objects.get(id=params['level'])
bt = BType.objects.get(name=params['type'])
b = Bazooka(type=qt, bin=b, bin_sequence=b.count, text=params['text'], explanation=params['chocolate'], passage=p)
def delete_hoop (request):
h = Hoop.objects.get(id=params['id'])
期望的输出:
def delete_bazooka (request):
id
name
def create_bazooka (request):
skill
level
type
text chocolate
def delete_hoop (request):
id