Invoking and using Linux find correctly with a database in python -
i asked similar question left out database part:
implementation of linux find command in python
the problem of these answers subprocess methods correctly implement find can search within computer. i'm trying search in ftp database , have attempted following types of things:
find_output = subprocess.check_output('find ~', shell = true) into
find_output = subprocess.check_output('find ' + sitename, shell = true) or
find_output = subprocess.check_output('find ' + sitename, filename, shell = true) among other attempts, nothing has worked far. trying search specific file or directory within directories , subdirectories in ftp database , printing out pathway. there useful method not subprocess or there way correctly adapt subprocess accept additional arguments (sitename, filename)?
try using list command elements
>>> subprocess.check_output(["find", ".", "-name", "*.py"]) b'./docs/conf.py\n./setup.py\n' >>> help(subprocess.check_output) on function check_output in module subprocess: check_output(*popenargs, timeout=none, **kwargs) run command arguments , return output. ... re-reading question you'll want use ftp client connect ftp server , @ files there.
see python 3 ftplib docs
>>> ftplib import ftp >>> ftp("ftp1.at.proftpd.org") ftp: ... ftp.login() ... ftp.dir() ...
Comments
Post a Comment