我试图通过windows 7中的命令提示符运行OpenScad,但是无法工作。我将以下目录添加到Path中
"C:\Program Files\OpenSCAD\"并试图运行以下脚本:
from os import listdir
from subprocess import call
files = listdir('.')
for f in files:
if f.find(".scad") >= 0: # get all .scad files in directory
of = f.replace('.scad', '.stl') # name of the outfile .stl
cmd = 'call (["openscad.com", "-o", "{}", "{}"])'.format(of, f) #create openscad command
exec(cmd)我也尝试过openscad,openscad.exe,openscad.com,到目前为止还没有成功。我得到的错误是:
Traceback (most recent call last):
File "C:\Users\Desktop\scad2stl.py", line 9, in <module>
exec(cmd)
File "<string>", line 1, in <module>
File "C:\Users\AppData\Local\Programs\Python\Python35\lib\subprocess.py", line 247, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Users\AppData\Local\Programs\Python\Python35\lib\subprocess.py", line 676, in __init__
restore_signals, start_new_session)
File "C:\Users\AppData\Local\Programs\Python\Python35\lib\subprocess.py", line 955, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The specified file could not be found有什么建议吗?
发布于 2019-03-21 23:10:35
我刚刚看到这个线程,我已经让它工作了,窗口电源外壳,不能使它工作在cmd到期。因此,例如,这在cmd>上不起作用
openscad -o render.png --imgsize=2048,2048 assembly.scad
但是它确实可以在power shell上工作(注意./在bigining中):
./openscad -o render.png --imgsize=2048,2048 assembly.scad
希望能帮上忙。诚挚的问候
https://stackoverflow.com/questions/44701602
复制相似问题