Mavros+PX4+QGC How to set home

i have an autonomous mission code and it works well in Swiss(default home position).
I want to set home position using python. I tried" export PX4_HOME_LAT/LON " command from ubuntu terminal but nothing has changed, still starts from the same location. According to my researchs, it looks like i have to do that using python code and mavros commands, but i don’t know how to do that.

I think you have to send the command to px4 FCU. You can use mavros command service - set_home using rosservice from terminal or write it from a python ros script