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...

ความคิดเห็น • 26

  • @zerotocode
    @zerotocode ปีที่แล้ว +11

    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

    • @AashrithaMurali-t9g
      @AashrithaMurali-t9g ปีที่แล้ว

      @@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.

    • @jainparth222
      @jainparth222 10 หลายเดือนก่อน

      thank you

    • @Advanced_Physics_Official
      @Advanced_Physics_Official 3 หลายเดือนก่อน

      Thanks bro..

  • @pranjalchoudhury1090
    @pranjalchoudhury1090 3 ปีที่แล้ว +3

    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"

    • @avenumadhav3568
      @avenumadhav3568 3 ปีที่แล้ว +3

      too many at a time teaching, could cause confusion to students, however great suggestion for a tutorial.

  • @adityajha2342
    @adityajha2342 6 หลายเดือนก่อน +1

    How to set path in Command prompt?

  • @alexioscarlos7727
    @alexioscarlos7727 6 หลายเดือนก่อน +1

    Can anyone please please tell me which is sir using replit or anything else I have no idea

    • @SS-zm7co
      @SS-zm7co 6 หลายเดือนก่อน

      Sir uses Vim editor with ipython

  • @abhishekrajkumar4880
    @abhishekrajkumar4880 2 ปีที่แล้ว +2

    where to run these commands in window?

  • @CherryIITM
    @CherryIITM 2 ปีที่แล้ว +7

    6:40 Sounds like the pc cant handle the load.

    • @CherryIITM
      @CherryIITM 2 ปีที่แล้ว +3

      sounds like the fans going crazy!

  • @zerotocode
    @zerotocode ปีที่แล้ว +3

    Just ask chat gpt this : How to install ipython in windows cmd. You will get the answer.

  • @deepcreations1264
    @deepcreations1264 ปีที่แล้ว +2

    Where I can run it?
    It's not running in replit.

    • @LAVANYATADAVARTI
      @LAVANYATADAVARTI ปีที่แล้ว +1

      You have to do this on command prompt

    • @deepcreations1264
      @deepcreations1264 ปีที่แล้ว

      @@LAVANYATADAVARTI is it in replit or i have to download ?

    • @LAVANYATADAVARTI
      @LAVANYATADAVARTI ปีที่แล้ว +1

      @@deepcreations1264 are you using windows or linux?

    • @deepcreations1264
      @deepcreations1264 ปีที่แล้ว

      @@LAVANYATADAVARTI windows

    • @LAVANYATADAVARTI
      @LAVANYATADAVARTI ปีที่แล้ว +3

      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.

  • @054_nirajkumar3
    @054_nirajkumar3 3 ปีที่แล้ว +1

    For windows
    I hv to write 👇for directory. Is there any other way??
    Import os
    Var=os.getcwd()

    • @sayanghosh6996
      @sayanghosh6996 3 ปีที่แล้ว

      why? does !cd not work?

    • @054_nirajkumar3
      @054_nirajkumar3 3 ปีที่แล้ว

      @@sayanghosh6996 not worked in Replit

    • @sayanghosh6996
      @sayanghosh6996 3 ปีที่แล้ว +3

      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

    • @054_nirajkumar3
      @054_nirajkumar3 3 ปีที่แล้ว +3

      @@sayanghosh6996 yes sir I learn these facts 😅 but I learnt after posting my doubt here.
      thankyou so much for ur hlp😌

  • @udaygawande5681
    @udaygawande5681 ปีที่แล้ว +5

    Has someone said my name ! 😅9:18