Using python to read in data from file

how about the setting in your smart phone? when choosing a device, which connection did you choose? is there any example of a python script to connect via wifi using raspi?