Vote count:
0
Here is some part of code. displayKMostFrequentNGramsInFile method reads a file and finds and prints the K most repeated words.
# this is our main function
def main():
# make sure the user gave us a file to read
if len(sys.argv) != 2:
print "need one argument! (file to read from)"
sys.exit(-1)
filename = sys.argv[1]
displayKMostFrequentNGramsInFile(20,3,filename) #this method isn't seen
displayKMostFrequentNGramsInFile(30,2,filename) #this method isn't seen
displayKMostFrequentNGramsInFile(15,4,filename) #only this works
main()
showMemTime('at the end')
asked 39 secs ago
In python, when i write a method more than one time into the main, only the last called method is working and the other ones are not. why?
Aucun commentaire:
Enregistrer un commentaire