open-interpreter icon indicating copy to clipboard operation
open-interpreter copied to clipboard

How can I get interpreter to output all scripts to files neatly?

Open 621625 opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe.

The problem is interpreter will write a lot of code and try to execute it. But it doesn't output the programs to files neatly.

Describe the solution you'd like

I want interpreter to automatically output its programs to files like file1.sh, file2.sh, file3.sh or file1.py, file2.py, file3.py and so on.

Describe alternatives you've considered

No response

Additional context

No response

621625 avatar Sep 10 '24 16:09 621625

Have you asked it to? Maybe add your requirements from above as part of your prompt or system message?

bobemoe avatar Oct 23 '24 11:10 bobemoe

You can use a simple file writing operation. The sample code is as follows. shell_script_content = """ #!/bin/bash echo "Hello, World from the generated shell script!" """ with open("file1.sh", "w") as f: f.write(shell_script_content)

Lxh-377 avatar Nov 29 '24 10:11 Lxh-377