File Handling - Binary File | pickle module | dump() & load() | CBSE Class12 - CS
HTML-код
- Опубликовано: 20 сен 2024
- 🔥FREE Classes for CS/IP 🔥
🔥FREE UNLOCK Code - “LALIVE” 🔥
unacademy.com/...
Telegram LINK - t.me/TECHQueen...
Instagram ID - / iam_tech_queen
Complete Playlist for Class 11 CS -
• Full Playlist CBSE Cla...
Complete Playlist for Class 11 IP-
• Full Playlist CBSE Cla...
20:56
ma'am this also works
import pickle
with open("bot.dat","rb") as p:
x=pickle.load(p)
for i in x:
print(i,end="")
14:00
Ma'am aapne wb mode use kiya tha then " FileBi.dat " ka content overwrite ho jana chahea tha ... But this didnt happen ?
yes , it happen, watch again start watching 13:58
18:00, ma'am yaha pe write function use ke wajah se data file me overwrite hona chahiye tha na, phir vo list ki tarah kaise store kiya, write () to overwrite karta hai na?
write() overwrite nahi krta, W mode Overwrite krta hai, write() to only ek Function hai.
Thanks a ton mam
mam notes kaha milenge ?
when i am using binary file as .dat or .bi.... program executed properly, showing result also....dump and load working..... but in file its showing some msg like"file was loaded in a wrong encoding" and "file was explicitly re-assigned to plain text"..... why its showing..... and how to remove
Using pycharm
@@RamaAnand hii plz check here, 2 attachments are given ,
youtrack.jetbrains.com/issue/IDEA-290488
Thx ma'am ❤❤😊
Mam aapka samjhane ka tareeka bahut acha hai bas thoda kisi bhi topic ke point pe baat kara karo toh aur ache se samjh me aayega
Ma'am screen chhoti pad rhi hai........ aap ki avaaz se bhi padh lenge......... Chehra dikhana ki koi need nhi hai..... 🙏❤️
R u
Mam should I concentrate on the notes or on you ? 🥰
3:19 mam notification bnd krdo mai apna notification check krne lgta 😂(just joke)
Good evening mam
Mam kabhi aap bina makeup ka class lo 😂😂😉
Aur tum kabhi bina comment kare pad bhi liya karo😄😄
import pickle
def bfile():
bfile=open("p.txt","wb")
pickle.dump("hii my name is ekta",bfile)
pickle.dump(28888,bfile)
pickle.dump({"w":34,"r":45},bfile)
bfile()
def bfile_2():
bfile_2=open("p.txt","rb")
try:
while true:
data=pickle.load(bfile_2)
print(data)
except:
bfile_2.close()
bfile_2()
plz hlp me mam mera load data file show nhi horhi only dump wali hi show ho rhi h
Hi Ekta, Here is the correct program
import pickle
def bfile():
bfile=open("p.txt","wb")
pickle.dump("hii my name is ekta",bfile)
pickle.dump(28888,bfile)
pickle.dump({"w":34,"r":45},bfile)
bfile()
def bfile_2():
bfile_2=open("p.txt","rb")
try:
while True:
data=pickle.load(bfile_2)
print(data)
except:
bfile_2.close()
bfile_2()
There were 2 mistakes while True hoga na ki true, and second print(data) me indent aayega, else vo loop k bhaar jaa k print. That means kuch print ni hoga
@@AYArchanaYadav thnku
@@ektasharma5330 @ARCHANA YADAV ji aap .txt file pr kam kr rhe h tho binary function use krne ka koi sense ni h either you use .dat file or better use text file syntax and methods