Every line of 'save list to file python' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
3 def save(file_, *args, **kwargs): 4 """ 5 Save the value of some data in a file. 6 Usage: save('misdatos.pypic','a',b=b) 7 8 """ 9 f=open(file_, "wb") 10 dict = kwargs 11 for name in args: 12 dict[name] = eval(name) 13 pickle.dump(dict, f, protocol=2) 14 f.close
32 def save_output(fname, data): 33 with open(fname, 'w') as f: 34 f.writelines(data)