Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to clear a pickle file

#Create an empty variable
empty_list = []
#Open the pickle file in 'wb' so that you can write and dump the empty variable
openfile = open('filename', 'wb')
pickle.dump(empty_list, openfile)
openfile.close()

Comment

PREVIOUS NEXT
Code Example
Python :: how to display a manytomany field in django rest framework 
Python :: pandas dataframe column to datetime 
Python :: message tags in django 
Python :: check django version 
Python :: creata daframe python 
Python :: dataframe change specicf values in column 
Python :: python [a]*b means [a,a,...b times] v2 
Python :: how to play mp3 audio in python 
Python :: tkinter refresh window 
Python :: pandas read chunk of csv 
Python :: print all of dataframe 
Python :: add font to the label in window tkinter 
Python :: python split string regular expression 
Python :: python fizzbuzz 
Python :: minimize window with python 
Python :: import statsmodels.api as sm 
Python :: convert number to binary in python 
Python :: sort list of dictionaries python 
Python :: pandas absolute value 
Python :: limpiar consola en python 
Python :: print variable in string python 
Python :: pygame.display.flip vs update 
Python :: train,test,dev python 
Python :: discord get author slash command 
Python :: list mean python 
Python :: python selenium full screen 
Python :: python df select first x columns 
Python :: python inline conditional 
Python :: python trace table generator 
Python :: sklearn cross validation score 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =