Feb-28-2019, 11:35 PM
Hi,
The following code adds the ssid and pass in a dat file as "ssid";"pass".
The following code adds the ssid and pass in a dat file as "ssid";"pass".
ssid = "test" password = "pass" profiles = {} profiles[ssid] = password def write_profiles(profiles): lines = [] for ssid, password in profiles.items(): lines.append("%s;%s\n" % (ssid, password)) with open("text.dat", "w") as f: f.write(''.join(lines))I'm trying to add a third key to the file but I just cannot get the syntax correct.
ssid = "test" password = "pass" token = "shfg53rdf" profiles = {} profiles[ssid] = password profiles[profiles] = token def write_profiles(profiles): lines = [] for ssid, password, token in profiles.items(): lines.append("%s;%s;%s\n" % (ssid, password, token)) with open("text.dat", "w") as f: f.write(''.join(lines)) #should save keys: "test";"pass";"shfg53rdf"I appreciate any help.