Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem: touch file.py
#3
(Oct-04-2019, 03:54 AM)Larz60+ Wrote: touch is not a python command. use subprocess
 import subprocess subprocess(['touch', 'file.py']) 

Thanks for the help, was missing calling the method or function (run or call) tested both and worked just do not know what is the difference of both? Here's the example of how it looked:

import subprocess

subprocess.run(['touch','file.py'])
Reply


Messages In This Thread
Problem: touch file.py - by JohnnyCoffee - Oct-04-2019, 01:25 AM
RE: Problem: touch file.py - by Larz60+ - Oct-04-2019, 03:54 AM
RE: Problem: touch file.py - by JohnnyCoffee - Oct-04-2019, 04:51 AM
RE: Problem: touch file.py - by Gribouillis - Oct-06-2019, 06:28 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020