Can visitors create files?
I have a repl that uses Python 3.
I am worried that it won't work as from my testing when using code like this:
def logger(): log = input(Fore.CYAN + Style.BRIGHT + '\nWould you like to save this character to the \'Characters/'+ name + '.txt\'file?\n' + Fore.RED + Style.BRIGHT + 'WARNING: This will overwrite any current data under the name \'Characters/' + name + '.txt\'. (y/n) ') if log == 'y': print('Saving...') myFile = open('Characters/' + str(name) + '.txt', 'w') myFile.write('Name: ' + name) myFile.write('\nClass: ' + chosenClass) myFile.write('\nGender: ' + chosenGender) myFile.write('\nStrength: ' + str(chosenStrength)) myFile.write('\nMagic: ' + str(chosenMagic)) myFile.write('\nDexterity: ' + str(chosenDexterity)) myFile.write('\nSpecial Ability: ' + chosenAbilities) myFile.close() myFile = open('names.txt', 'a') myFile.write('\n' + name) myFile.close() print('Successfully saved into Characters/' + name + '.txt') from main import selector elif log == 'n': print('OK! This character is not being saved.') from main import selector else: print('Not a valid option. Try again.') logger()
When somebody else runs the project, I think that it creates the file locally and then doesn't add it to the main project.
Please can somebody tell me if this is what happens or if there is a workaround? If there isn't a workaround then my entire project idea won't work.
replit (for apparent security measures) doesn't save file changes made by the program. it will delete whatever the program file is making. sadly there is no workaround for this. i contacted some of the devs and they said they would have to redo their infrastructure to fix this.
Oh. I don't have access to Discord.
I thought it might be a suggestion on Canny.
I will make it a suggestion there though!