jeudi 25 février 2021

How do I fix this problem with openpyxl and random integers?

so i am coding in python using the openpyxl module, which I am using to find cells in my excel worksheet. Now the code i am using goes as follows:

#Create a function for the NEXT QUESTION button

def next():

#This part will make the selection random

random_question = randint(column_a, 1000)

Now in order for randint to funciton, it has to have 2 components, as far as I have understood it, which is why the (column_a, 1000) is like it is (column_a is defined as a variable elsewhere in the code).

My problem is that I only need it to return 1 cell from the collum A, but it should not be looking for the 1000th value, is there a way to change the 1000 out with something else, so it will look to the end of where there is nothing more written?

thank you in advance




Aucun commentaire:

Enregistrer un commentaire