Python Forum
Questions on variable changing between files.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Questions on variable changing between files.
#2
Hm! It won't change as the file is already written to the disk.
You can load it, do what you want with its content and then you can write it back.

You are using the import statement to get the variable. Is this file a python one? With .py at the end of the name.
Anyway, to permanently store some data you can try do save it as json or csv for example. Python has built-in tools to handle both.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Messages In This Thread
RE: Questions on variable changing between files. - by wavic - Apr-24-2017, 07:42 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Keeping a value the same despite changing the variable it was equated to TheTypicalDoge 2 1,481 Mar-13-2022, 10:50 PM
Last Post: Yoriz
  changing Python files to .exe alok 2 2,256 Jul-20-2021, 02:49 PM
Last Post: alok
  Changing a variable's name on each iteration of a loop rix 6 85,025 Jan-03-2020, 07:06 AM
Last Post: perfringo
  how write variable in files and retreive it frank 2 2,080 Jan-30-2019, 12:53 AM
Last Post: frank
  int(variable) not changing variable to an integer StoopidChicken 2 2,980 Jan-11-2018, 10:30 AM
Last Post: StoopidChicken
  Discord bot that asks questions and based on response answers or asks more questions absinthium 1 42,280 Nov-25-2017, 06:21 AM
Last Post: heiner55
  changing variable outside of a function tkj80 8 7,240 Jan-05-2017, 03:52 AM
Last Post: tkj80

Forum Jump:

User Panel Messages

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