I am getting TypeError: not all arguments converted during string formatting in python 3.4.3 while trying to open a file. I am using the following two modules that I made:
def write(file, text):
file = open("%s.txt", "w" % (file))
file.write(text)
file.close()
And
import rnumb
import file
def create():
name = input("What is your name? ")
attack = rnumb.randn(1,3)
defense = rnumb.randn(1,3)
agility = rnumb.randn(1,3)
file.write("name",name)
file.write("attack",attack)
file.write("defense",defense)
file.write("agility",agility)
The error is at file = open("%s.txt", "w" % (file))