Update main.py

Adding "with:" clausules to close calls to "already_published" file avoiding corruption.