Welcome to collectivesolver - Programming & Software Q&A. A website you can trust. All programs tested and works. Contact: aviboots(AT)netvision.net.il
Hostgator 1 Penny

BlueHost Web Hosting

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

getflywheel wordpress hosting


Distribute your Resume to 500+ Job Boards & Recruiters


7,369 questions

10,368 answers

573 users

How to pack two lists into binary file in Python

1 Answer

0 votes
import pickle

lang_1 = ["python", "c", "c++", "c#", "java"]
lang_2 = ["php", "html", "css", "javascript"]
fh = open("d:\data.pkl", "bw")
lang_object = (lang_1, lang_2)
pickle.dump(lang_object, fh)
fh.close()


'''
run:

data.pkl
--------
€]q (X   pythonqX   cqX   c++qX   c#qX   javaqe]q(X   phpqX   htmlqX   cssq	X
   javascriptq
e†q.

'''

 




answered Dec 21, 2017 by avibootz
...