Python Forum
No output in 'english word generator'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No output in 'english word generator'
#11
Change def isValid(word): to def isValid(word, wordtype):, adapt the call to this function to put the two variables and it should solve the error.
Reply
#12
Thanks a lot, I don't get the error anymore now.

I now don't manage to get any word out of the generator though?

I'm sorry, but I really think it should be isValid(word) though. If it were 'wordtype' it doesn't generate a word, because wordtype=common/all so the chance that that is the word it produces is legendary low, which is why it takes so long to create the word. So what do I do now?
Reply
#13
Just a thought: in the isValid function, I believe "file" is the name of a Python object. Have you tried using a different variable name? It would like naming a variable "int". It tends to confuse the interpreter.
Reply
#14
Well yeah that would've solved it I guess, but it just turned out to be a problem of the order in which my program ran. I've got it all figured out now. Thanks for the reply though :) if you want I can send you the generator.py file?
Reply
#15
You can post your final program in this thread, this will be a nice gesture in case someone is doing a search on this matter in the future. And last but not least, it is always fun to read new words in English.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Random Generator: From Word to Numbers, from Numbers to n possibles Words Yamiyozx 2 1,421 Jan-02-2023, 05:08 PM
Last Post: deanhystad
  Word generator jack1234 10 150,850 Jul-03-2017, 09:30 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020