I'm new to python.
I don't quite understand how I need to set variables and change them within a function to be used late. My script needs to get an x and y value from a function which are determined by the size of the chart the function creates. These variable need to be passed to a print command later in the script to output html. So let's say I have global variables:
originx_pct = 0.125
originy_pct = 0.11
But these will need to change when the funtion is run...
def makeplot(temp, entropy,preq):
originx_pct = origin.get_points()[0][0]
originy_pct = origin.get_points()[0][1]
Then printed within the javascript of the html page that is written later...
print('var originx_pct = {};'.format(originx_pct))
print('var originy_pct = {};'.format(originy_pct))
The 2 variables don't change and I just don't understand what I need to do to update them and be able to print them (outside the function). I'm assuming that the function does not know about the variables so it can't change them. If I feed the function the 2 variables as arguments, how do i get the values back out for the print part of the script?