err=subprocess.PIPE)
> > > File "/home/joepareti54/anaconda3/lib/python3.8/subprocess.py", line
> > 854,
> > > in __init__
> > > self._execute_child(args, executable, preexec_fn, close_fds,
> > > File "/home/joepareti54/anaconda3/li
ubprocess.Popen([cmd], stdout=subprocess.PIPE,
> > stderr=subprocess.PIPE)
> > File "/home/joepareti54/anaconda3/lib/python3.8/subprocess.py", line
> 854,
> > in __init__
> > self._execute_child(args, executable, preexec_fn, close_fds,
> > File &qu
lose_fds,
File "/home/joepareti54/anaconda3/lib/python3.8/subprocess.py", line
1702, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ls -l
/media/joepareti54/Elements/x/finance-2
xec_fn, close_fds,
> File "/home/joepareti54/anaconda3/lib/python3.8/subprocess.py", line
> 1702, in _execute_child
> raise child_exception_type(errno_num, err_msg, err_filename)
> FileNotFoundError: [Errno 2] No such file or directory: 'ls -l
> /media/joepareti54/Elements/x/fi
oepareti54/anaconda3/lib/python3.8/subprocess.py", line 854,
in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/home/joepareti54/anaconda3/lib/python3.8/subprocess.py", line
1702, in _execute_child
raise child_exception_type(errno_num, err_msg, err
On 4/14/21, Quentin Bock wrote:
>
> this is the only part of the code that causes the error
>
> file = open('Egils Saga 1-15.txt', "r")
Here's an app_abspath() function to resolve a filename against the
directory of the main script:
import os
import sys
def get_main_file():
On 14/04/2021 12.55, Dan Stromberg wrote:
Open a cmd.exe, command.exe or powershell, and:
cd c:\my\dir\ect\ory
Then run your script.
Or put an os.chdir(r'c:\my\dir\ect\ory') at the top of your script.
Or use file = open(r'c:\my\dir\ect\ory\Egils Saga 1-15.txt', 'r')
BTW, "file" means somethin
Open a cmd.exe, command.exe or powershell, and:
cd c:\my\dir\ect\ory
Then run your script.
Or put an os.chdir(r'c:\my\dir\ect\ory') at the top of your script.
Or use file = open(r'c:\my\dir\ect\ory\Egils Saga 1-15.txt', 'r')
BTW, "file" means something to python other than just a variable name.
Il 14/04/2021 18:13, Quentin Bock ha scritto:
I receive this error when I try to open a file
The file (what I'm trying to open) is in the same folder as the program I'm
trying to open it from; why is it saying no such file or directory?
this is the only part of the code that causes the error
fi
On Wed, Apr 14, 2021 at 9:14 AM Quentin Bock wrote:
> I receive this error when I try to open a file
> The file (what I'm trying to open) is in the same folder as the program I'm
> trying to open it from; why is it saying no such file or directory?
>
> this is the only part of the code that cause
I receive this error when I try to open a file
The file (what I'm trying to open) is in the same folder as the program I'm
trying to open it from; why is it saying no such file or directory?
this is the only part of the code that causes the error
file = open('Egils Saga 1-15.txt', "r")
file.clos
line 679, ininit
> errread, errwrite)
>File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
> raise child_exception
> OSError: [Errno 2] No such file or directory
>
> subprocess.py exists:
The problem isn't inside subprocess itself,
rwrite)
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
subprocess.py exists:
# subprocess - Subprocesses with accessible I/O streams
#
# For more information about this module, see PEP
13 matches
Mail list logo