Arduino lights fade when uploading to Arduino

Hi All

I was running my temperature measurement code without problems until I tried to run it from python (unsuccessfully).

after that even after restarting, Arduino lights fade when I upload the code on it directly from Arduino softwre and have this error code

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM30
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: ser_open(): can't open device "\\.\COM30": Impossibile to find the specified file

I switched the ground and 5V , somehow started to work and now gives : Port busy or can't sync

Is there a way to free the port every time I disconnect Arduino ?

Farzadtb:
I switched the ground and 5V , somehow started to work and now gives : Port busy or can't sync

Is there a way to free the port every time I disconnect Arduino ?

Whenever you disconnect the arduino, the PC will free to port. I have seen on ocassion the error you mentioned. Usually a PC reboot fixes it.

Thank you very much, then How would I avoid rebooting ? I mean sometimes I might need to switch between applications and not have this problem