Archives week 6 of 2016

Feb. 8, 2016 - Feb. 14, 2016

Python basic usage of pickle

Python pickle

import pickle

#dumps(object) :Object serialization
lista=["john","levi","kate"]
listb=pickle.dumps(lista)
#print listb

#loads(string) :The object is restored, and the object type is restored to the original format.
listc=pickle.loads(listb)
#print listc

#dump(object,file) :To store objects in a file.
group1=("cat","is","kkkk")
f1=file ...

Continue reading

Python basic grammar

python basic grammar

1.Constant and Variable

   1)Constant
    eg.
      import const
      const.value=5
      print const.value
      const.value=6
   2)Variable
     eg.
        a=1

2.Number and string

   1)Single quotation mark
     eg. a='string'
   2)Double quotation marks
     eg. b="string"
   3)Three single quotation marks (output special characters)
     eg. c='''string ...

Continue reading

Daily archives

Previous week

Week 5 of 2016

Next week

Week 7 of 2016

Archives