Errors now ocurring in python scripts within project that has not changed
EmpireStateBloke
Posts: 2
I developed a project a year ago. Having come back to it, I get errors on some of the python scripts.
The script is very basic:
def main(config):
#
return InceptionDate.AddDays(randint(-30,-1));
InceptionDate is a date column that is populated using the randomdate functionality.
The error suggests an issue with python.
NameError: global name 'randint' is not defined.
The only change since the project was last used is the user account used to access the software. Python 2.7 is in my %PATH%
I don't understand,
The script is very basic:
def main(config):
#
return InceptionDate.AddDays(randint(-30,-1));
InceptionDate is a date column that is populated using the randomdate functionality.
The error suggests an issue with python.
NameError: global name 'randint' is not defined.
The only change since the project was last used is the user account used to access the software. Python 2.7 is in my %PATH%
I don't understand,
Tagged:
Comments
From doing a quick search, it sounds like you may need to import randint by adding the following to the top of the file:
This seems to work for me, can you please give it a try?
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?