这是我的程序的开始。我想在第三个函数中看到很多函数在for循环中。我如何去做这件事?在for循环中运行多个函数python
#!/usr/bin/env python
from rdflib import URIRef, Graph
from StringIO import StringIO
import subprocess as sub
class Wordnet():
def __init__(self, graph):
graph = Graph()
def process_file(self, file):
file = open("new_2.txt", "r")
return file
def line_for_loop(self, file):
for line in file:
def split_pointer_part(self, before_at, after_at, line):
before_at, after_at = line.split('@', 1)
return before_at, after_at
def split_word_part(self, word_part, line):
word_part = line.split()
return word_part
难道只是一个缩进一切都在其他for循环的问题,还是它当函数被称为环路必须定义?
如何作为程序的一部分调用多个函数?我是python的新手,我不太清楚。
这里有两个不同的问题。 – RyPeck
当你说“过程”时,你几乎肯定意味着不同的东西。你想用这个文件做什么? – aestrivex