Reading and Writing to a File
ฝัง
- เผยแพร่เมื่อ 8 ต.ค. 2024
- IIT Madras welcomes you to the world’s first BSc Degree program in Programming and Data Science. This program was designed for students and working professionals from various educational backgrounds and different age groups to give them an opportunity to study from IIT Madras without having to write the JEE. Through our online programs, we help our learners to get access to a world-class curriculum in Data Science and Programming.
To know more about our Programs, please visit :
BSc Degree in Programming and Data Science - onlinedegree.i...
Diploma in Programming / Data Science - diploma.iitm.a...
Windows users try this:
1)install python on your system
2)Open CMD (command prompt)
3) Check python installed or not by typing "python --version" (if it showing python not found, add the
installed python's location to the windows path)
4) type "pip install ipython" in cmd
5) After installing it, type " cd location of the folder you want to create the file"
6) Do the rest steps in the lecture, f=open('hello.txt','w')
f.write('Hello')
Hope it helps, Thank You
@@adityaraj7010 fair enough, same issue i had, straight after installing pip install ipython, so i straigtaway went and created a file using f=open("file.txt",'w'), then went and found that folder where the txt file is located and moved it to my desktop for easy access. but definitely while its not a good method, its useful temporarily.
thank you
Thanks bro..
Hello the video was nice just an addition to it from my side, I saw that Prof. has taught us only about "w", "r" , "readlines" and gave us homework for "a". But there are others like "r+","w+", writeline, writelines, readline, "a+" which professor have missed. It will be great if we get a tutorial video on this commands and the Difference of one command from another... For eg: Difference between Readline and Readlines or "W" and "A"
too many at a time teaching, could cause confusion to students, however great suggestion for a tutorial.
How to set path in Command prompt?
Can anyone please please tell me which is sir using replit or anything else I have no idea
Sir uses Vim editor with ipython
where to run these commands in window?
6:40 Sounds like the pc cant handle the load.
sounds like the fans going crazy!
Just ask chat gpt this : How to install ipython in windows cmd. You will get the answer.
Where I can run it?
It's not running in replit.
You have to do this on command prompt
@@LAVANYATADAVARTI is it in replit or i have to download ?
@@deepcreations1264 are you using windows or linux?
@@LAVANYATADAVARTI windows
as far as I know write you code on notepad and run through command prompt. You can find command prompt by clicking windows button and searching for 'cmd'. Or simply install a IDE like pycharm, write the code there and run there itself. You should know all these things by now anyway.
For windows
I hv to write 👇for directory. Is there any other way??
Import os
Var=os.getcwd()
why? does !cd not work?
@@sayanghosh6996 not worked in Replit
replit is not windows 🤦♂️🤦♂️🤦♂️🤦♂️ it runs on the linux on their cloud servers, also you dont get ipython shell in replit anyway. The bang works only in ipython. So regardless of the OS of the replit server it wont work there. If you want to execute a shell command (that is what prefixing a ! does) just go to the shell tab (not the console tab) and run it normally (without a !)
like ls or pwd
@@sayanghosh6996 yes sir I learn these facts 😅 but I learnt after posting my doubt here.
thankyou so much for ur hlp😌
Has someone said my name ! 😅9:18