Skip to content
Advertisement

my code is working on its own but wont run/print in my project as a whole

Hello I’m new to python and jumped into trying to automate reading my work schedule for fun really and have run into a block…

I’ve written some code and it just won’t print in my main project but when taken out to test independently it runs just fine.

what am I doing wrong?

the with statement is what isn’t working, nothing gets printed to console, but again works on its own in a separate project and correctly prints.

(I took out the xpaths and stuff for safety)

JavaScript

Advertisement

Answer

You never closed outF, so the data written to it likely never got physically written to the disk. Insert outF.close() after the with block.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement