'how do I send a file via bluetooth with python?

I am need some help with the development of a script that sends a txt file to the device that is connected to my pc (Bluetooth) I am using linux in this case and I have my cellphone connected. so , from the Bluetooth settings I can easily send files to connected devices, not a problem there, the problem comes when I try to code it (of course). so I have done some research, I tried using the following solutions : Python3 error "no module named bluetooth" on Linux Mint Python Bluetooth how to send a file to a phone

both of the scripts have one problem in common, they only scan devices that are not connected to the pc, so is there a way to send files to a cellphone that is already connected to the pc?

the following script Python3 error "no module named bluetooth" on Linux Mint

works on my pc, but it just scans the devices that are not connected to my pc.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source