Sep-09-2019, 05:13 PM
Variables defined in a function are only available inside that function. You need to return the value from readxl with a return statement, and then pass it to write2csv with a parameter. See the function tutorial on how to do that. Additionally, if you defined both of those functions to take parameters for the file paths, you could define them once rather than redefining them every time you go through the loop.
Also, you use of
Also, you use of
if __name__ == '__main__':
is very odd. That is usually done once at the end of the program. As it is, you are running a bunch of code whether you import the code or run it as the primary program. I would put all of the code in one function, and then use a single if __name__
at the end to call that function.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures