i'm very new to python, and i'm attempting to make a very rudimentary VM, with the ability to make and read "text files" (formatted strings).
now, there is going to be a command that allows the user to create a file. the file is stored as a class, but i am unsure how to do something like this -
def filecreate(filename,contents):
filename = contents
filecreate(str(raw_input("File Name: ")), insertcontenthere)
upon attempting to do something like that in idle/pycharm, you can't, because it yells at you for the filename being undefined.
i've looked into the constructor functions, but i'm at a loss. the answer is likely obvious and i'm not seeing it, but i can't find it.
(and it's probably been answered, but because of the phrasing, i can't accurately search for it.)