Python Forum
OSError: [Errno 13] Permission denied
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OSError: [Errno 13] Permission denied
#1
I'm trying to make a little program and i have to run an app called pad.py from another one called tarea1.py but when I try it replies this error:
(Directories are partly in spanish because I'm from Spain)

>>> subprocess.call(["/home/ciro/Escritorio/Programs/Automatic/pad.py"])

Error:
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/subprocess.py", line 523, in call return Popen(*popenargs, **kwargs).wait() File "/usr/lib/python2.7/subprocess.py", line 711, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child raise child_exception OSError: [Errno 13] Permission denied
The code of tarea1.py app is this:

import subprocess
import time
import tkinter
import sys
from subprocess import call

password = 'patata'

while True:
	clave = input("Clave de acceso: ")
	if(clave == 'patata'):
		print('Acceso permitido.')
		time.sleep(1)
		subprocess.call(["printf","\033c"])
		subprocess.call(["home/ciro/Escritorio/Programs/Automatic/pad.py", "\033c"])
	else:
		print('Acceso denegado.')
		time.sleep(1)
		print('')
		subprocess.call(["printf", "'\033c'"])
I tried to use os.system() but it didn't work.

I hope someone can help me, please, i didn't find anything in Internet.
Reply
#2
1) Check execute permission for pad.py: chmod +x pad.py
2) Don't forget to add a magic line (#!/bin/python or #!/custom/path/to/python/interpreter) to your code (pad.py)...
Reply
#3
As an alternative, you could also prepend the command with python.
Reply
#4
(Sep-07-2018, 10:39 AM)arnavb Wrote: As an alternative, you could also prepend the command with python.
Or better, with sys.executable
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  OSError occurs in Linux. anna17 2 192 Mar-23-2024, 10:00 PM
Last Post: snippsat
  KivyMD android app - problem with permission polak7gt 0 248 Jan-18-2024, 01:27 PM
Last Post: polak7gt
  Potential Permission error on Mac OSX Catalina OWOLLC 1 644 Nov-02-2023, 07:52 AM
Last Post: unjnsacih
  logging: change log file permission with RotatingFileHandler erg 0 959 Aug-09-2023, 01:24 PM
Last Post: erg
  OSError with SMPT script Milan 0 696 Apr-28-2023, 01:34 PM
Last Post: Milan
  The INSERT permission was denied on the object Steven5055 2 1,426 Feb-25-2023, 11:37 PM
Last Post: Steven5055
  access is denied error 5 for network drive mapping ? ahmedbarbary 2 1,731 Aug-17-2022, 10:09 PM
Last Post: ahmedbarbary
  OSERROR When mkdir Oshadha 4 1,660 Jun-29-2022, 08:50 AM
Last Post: DeaD_EyE
  Server Folder Error : WinError5 Access Denied fioranosnake 1 1,093 Jun-21-2022, 11:11 PM
Last Post: Larz60+
  Permission issue when using scapy jao 3 9,463 Feb-05-2022, 06:14 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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