我对函数子进程不熟悉,此代码向我抛出错误,该函数如何工作以及如何使其在Windows上运行。
def wc(file_name):
print( "r+")
out = subprocess.Popen(
["wc", "-l", file_name], stdout=subprocess.PIPE, stderr=subprocess.STDOUT
).communicate()[0]
return int(out.partition(b" ")[0])
我想在https://github.com/intel-isl/Open3D-PointNet2-Semantic3D的Windows 10上使用python 3.6运行文件preprocess.py,原始代码在ubuntu上。 这是错误 运行文件中的文件“”,第1行('D:/Open3D-PointNet2-Semantic3D-master/preprocess.py',wdir='D:/ Open3D-PointNet2-Semantic3D-master')
第786行,运行文件execfile(文件名,名称空间)中的“ C:\ Users \ SAGHO \ anaconda3 \ envs \ py36_gpu \ lib \ site-packages \ spyder_kernels \ customize \ spydercustomize.py”文件
文件“ C:\ Users \ SAGHO \ anaconda3 \ envs \ py36_gpu \ lib \ site-packages \ spyder_kernels \ customize \ spydercustomize.py”,第110行,位于execfile exec(comp((f.read(),filename, 'exec'),名称空间)
文件“ D:/Open3D-PointNet2-Semantic3D-master/preprocess.py”,行70,位于point_cloud_txt_to_pcd(raw_dir,file_prefix)
文件“ D:/Open3D-PointNet2-Semantic3D-master/preprocess.py”,第48行,位于point_cloud_txt_to_pcd prepend_line(pts_file,str(wc(txt_file)))
文件“ D:/Open3D-PointNet2-Semantic3D-master/preprocess.py”,第11行,位于wc [“ wc”,“-l”,文件名],stdout = subprocess.PIPE,stderr = subprocess.STDOUT
文件“ C:\ Users \ SAGHO \ anaconda3 \ envs \ py36_gpu \ lib \ site-packages \ spyder_kernels \ customize \ spydercustomize.py”,第143行,位于超级(SubprocessPopen,self).init(* args, ** kwargs)
文件“ C:\ Users \ SAGHO \ anaconda3 \ envs \ py36_gpu \ lib \ subprocess.py”,第729行,init restore_signals,start_new_session)
_execute_child startupinfo中的文件“ C:\ Users \ SAGHO \ anaconda3 \ envs \ py36_gpu \ lib \ subprocess.py”,行1017)
FileNotFoundError:[WinError 2]系统找不到指定的文件