Python Tutorial for Beginners 5 – Save and Run Python files .py

///Python Tutorial for Beginners 5 – Save and Run Python files .py

Python Tutorial for Beginners 5 – Save and Run Python files .py

FavoriteLoadingAdd to favorites

In this video I am going to show How to Create, Save, Run a Python .py file. This video will also give the answer to the question which is , How do I run a Python program on a terminal or without any IDE/ Editor?.
We an write Python scripts in text files with the suffix .py. First you need to save python codes in hello.py file? The scripts can be read by the interpreter in several ways:

Examples:
you can directly double click on you .py (e.g. hello.py) file and it will open in the terminal.

$ python hello.py

# This will simply execute the script and return to the terminal afterwards

$ python -i hello.py

# The -i flag keeps the interpreter open after the script is finished running

$ python

execfile(‘hello.py’)
★★★Top Online Courses From ProgrammingKnowledge ★★★
Python Programming Course ➡️ ⚫️
Java Programming Course ➡️ ⚫️
Bash Shell Scripting Course ➡️ ⚫️
Linux Command Line Tutorials ➡️ ⚫️
C Programming Course ➡️ ⚫️
C++ Programming Course ➡️ ⚫️
PHP Programming Course ➡️ ⚫️
Android Development Course ➡️ ⚫️
C# Programming Course ➡️ ⚫️
JavaFx Programming Course ➡️ ⚫️
NodeJs Programming Course ➡️ ⚫️
Jenkins Course For Developers and DevOps ➡️ ⚫️
Scala Programming Tutorial Course ➡️ ⚫️
Bootstrap Responsive Web Design Tutorial ➡️ ⚫️
MongoDB Tutorial Course ➡️ ⚫️
QT C++ GUI Tutorial For Beginners ➡️

★★★ Online Courses to learn ★★★
Get 2 FREE Months of Unlimited Classes from skillshare –
Data Science – |
Machine Learning – |
Artificial Intelligence – |
MERN Stack E-Degree Program – |
DevOps E-degree – |
Data Analytics with R – |
AWS Certification Training – |
Projects in Java – |
Machine Learning With TensorFlow – |
Angular 8 – Complete Essential Guide –
Kotlin Android Development Masterclass –
Learn iOS Programming Building Advance Projects –

★★★ Follow ★★★
My Website –

DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!

ide – How do I run a Python program?
How can i run python files .py
Python – Create, Save, Run a Python file
How to save python codes in files?
python save object to file
python save list to file
python save string to file
python save dictionary to file
python save url to file
python save json to file
python save mat file
python save file to directory
python execute exe file
convert python file to exe
python file is executable

source

By |2020-03-03T02:06:35+00:00March 3rd, 2020|Python Video Tutorials|35 Comments

35 Comments

  1. ProgrammingKnowledge March 3, 2020 at 2:06 am - Reply

    I have created the New Course on Python – Please Chick to View https://www.youtube.com/playlist?list=PLS1QulWo1RIYt4e0WnBp-ZjCNq8X0FX0J

  2. Kashif Mirza March 3, 2020 at 2:06 am - Reply

    wow i dint know i was that dumb to just open the file icon button whatever its amazing to think that you could be very smart and write code program and still yr common sence doemt work

  3. nilesh aher March 3, 2020 at 2:06 am - Reply

    .

  4. Sanket Sinha March 3, 2020 at 2:06 am - Reply

    sir aap aaj gand bacha liye mera….thank u very much

  5. SAGEER AHMAD March 3, 2020 at 2:06 am - Reply

    Is there any buddy to help me regd this, should I do Python for career while I'm graduated from B A.

  6. SAGEER AHMAD March 3, 2020 at 2:06 am - Reply

    Thanks for this video, It's very helpful for beginners,

  7. happy NOOB March 3, 2020 at 2:06 am - Reply

    Which version u are using… It doesn't have have file or otjer option in (3.7) version… Is it a pycharm

  8. Deepak R March 3, 2020 at 2:06 am - Reply

    If we share the .py file to another computer which has python installed, will it run the same way?
    Also if a project has packages imported then just sharing the .py file to another computer will work? If yes, please explain how are the packages getting transferred?

  9. pushpa unique March 3, 2020 at 2:06 am - Reply

    Thank you very much..it worked

  10. FootballeIs Life March 3, 2020 at 2:06 am - Reply

    Thanks for making this video..

  11. The Goddess Geek March 3, 2020 at 2:06 am - Reply

    I subscribed because of this .. thanks

  12. Debasish Panda March 3, 2020 at 2:06 am - Reply

    awesome

  13. sami al jaber March 3, 2020 at 2:06 am - Reply

    i have a question..cant i save my gui file? cuase everyne wants to take a brk and come back and work again later so there must be a way to save gui file or else u need to do ur work nonstop does nt matter how long it takes..plz help me out with this

  14. Sid Tech March 3, 2020 at 2:06 am - Reply

    Thank you! 😘😘 Awesome 😘

  15. Oyku Ozturk March 3, 2020 at 2:06 am - Reply

    THANK YOU

  16. Samarth Singh March 3, 2020 at 2:06 am - Reply

    can I exit the programs by just pressing enter key? Can I use other keys to exit?

  17. Ash March 3, 2020 at 2:06 am - Reply

    hey in 'save in type .py file extension is missing' what i should do when i open the saved file it flashes and disappears

  18. Mohamed Hassan March 3, 2020 at 2:06 am - Reply

    my code only prints the Y inout, if i put for examle: x=5 y=4 z=10, it prints 4, every time, whats wrong

  19. Nii Wiabo March 3, 2020 at 2:06 am - Reply

    wanna know if you teach privately

  20. Impress rude girl Using chat March 3, 2020 at 2:06 am - Reply

    Sir which version you teach us
    ..
    Python 2 or python 3

  21. Garrett Barton March 3, 2020 at 2:06 am - Reply

    THANK YOU SO MUCH!!!!!!

  22. peddineni mahendra March 3, 2020 at 2:06 am - Reply

    cannot run the program

  23. Saranya Saranya March 3, 2020 at 2:06 am - Reply

    Hi sir.. Im learning python through ur video only.. 1 doubt in this video… in 7.18 minutes, when i press enter, it didn't exit… why??? "please press enter to exit"

  24. Michael Riedeman March 3, 2020 at 2:06 am - Reply

    When I save the program and reopen it the file opens up under Idle (the white screen). How do I make it so it will open up in the black screen like in the video?

  25. amit tikekar March 3, 2020 at 2:06 am - Reply

    Hi, when I installed python3.7.0 and as per Python Tutorial for Beginners 5 when I saved program as .py then doubled click it doesn't work. how to overcome this as I have make .exe file.

  26. Zaid Alig. March 3, 2020 at 2:06 am - Reply

    What is the difference in using function where ni model nane required (ex max) and few we use with model name like math.exp?

  27. Bushra Khan March 3, 2020 at 2:06 am - Reply

    I have a prior knowledge of C++. Unlike in c++ IDE, in python we write on program in the 'new file' and then if we need to execute it , we have to save and RUN it on shell. what annoys me you can not do both together and then save it for later use. Is there any alternative? or my concept is wrong and we can actually do both together??

  28. Oussama Nhairech March 3, 2020 at 2:06 am - Reply

    thank you so much you help me alot

  29. Shubham Ray March 3, 2020 at 2:06 am - Reply

    Love u ….

  30. _Cosmos_ March 3, 2020 at 2:06 am - Reply

    well this is annoying if u make a game a and want to save it

  31. somu dutta March 3, 2020 at 2:06 am - Reply

    great vid, just a quick help my saved file wont open as my pc is asking me to find apps to open it. im using windows 8.1

  32. Gail L Ellis March 3, 2020 at 2:06 am - Reply

    Thank you so much! It was so frustrating not knowing to open a new file to save your work for reuse. After extensive research on the Web, your tutorial was the only one that had a workable solution, which eliminated the screen from closing abruptly! What a relief! I am now able to continue my journey with Python 3.6. Great Job!!!

  33. deepak bisht March 3, 2020 at 2:06 am - Reply

    My output window doesnot stay on screen,disappears in 0.5 sec??????

  34. Sudhanshu Bhardwaj March 3, 2020 at 2:06 am - Reply

    I tried these inputs…
    325, 32, 33
    It shows 33 as the result.
    What's wrong??

  35. SAUMYA TIWARI March 3, 2020 at 2:06 am - Reply

    Sir, Can i write the same codes in Pycharm ? It will run there or not ?

Leave A Comment

*