How to Open and Close a File with a Program in Python | Python Tutorial

Publié le: 20 septembre 2021
sur la chaîne: Phil Parisi
3,224
33

How to Open and Close a File with Python! Python can open your computer files with a program of your choice! You will necessary commands to, for example, open a .jpg with Photoscape.

CHAPTERS
0:00 Example of Opening and Closing a File
0:10 Syntax to Open and Close a File
1:58 Common Error with Unicode (and solution)
2:34 Final Examples

To open a file
p = subprocess.Popen(["\path\to\program", "\path\to\file.ext"])
To close a file (after opening)
p.terminate()


More Python Videos!
How to Start a Script in Python with Hotkeys    • How to Run a Python File with a Hotke...  
Install Python and PyCharm IDE:    • How to Install Python and PyCharm IDE...  
Python Coding Series:    • Beginner Guide to Python -- Series In...  
Python Macros Tutorial:    • How to Make a Macro in Python with Ke...  

Please like and subscribe to support this channel :) join the journey to 1000 subs!!
Comment below and I will help you out! Support me on Patreon!   / philsbeginnercode  


Sur cette page du site, vous pouvez voir la vidéo en ligne How to Open and Close a File with a Program in Python | Python Tutorial durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Phil Parisi 20 septembre 2021, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 3,224 fois et il a aimé 33 téléspectateurs. Bon visionnage!