如何从终端运行处理应用程序 [英] How to run Processing applications from the terminal

查看:46
本文介绍了如何从终端运行处理应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在将 Processing 用于一个小项目,但是我不喜欢随附的文本编辑器它.我使用 vim 编写所有代码.我找到了 .pde 文件的位置,我一直在从 vim 编辑它们,然后我重新打开它们并运行它们(重新加载脚本并运行它需要很多时间).这就是为什么我想要一个可以从终端编译所有内容的解决方案.

I'm currently using Processing for a small project, however I'm not liking the text-editor that comes with it. I use vim to write all of my code. I've found where the .pde file are and I've been editing them from vim and then I'm reopening them and running them (it takes a lot to reload the script and running it). That's why I want a solution where I can compile everything from the terminal.

经过仔细检查,我发现了处理 java 文件,该文件据说可以编译并运行草图.然而,无论我提供什么论据,它都会不断地吐出帮助页面.这是我如何运行它们的示例.

On close inspection I've found the processing-java file that supposedly compiles and runs a sketch. However whatever arguments I supply it, it keeps on spitting the help page. This is an example on how I'm running them.

(PS:我制作了一个运行processing-java的脚本并将其添加到/usr/bin)

(PS: I made a script that runs processing-java and added it to /usr/bin)

processing-java --sketch=/home/george/sketchbook/testproject --output=/tmp/processing/test --force --run

谁能帮我从终端运行我的草图?

Can anyone help me please run my sketchs from the terminal?

推荐答案

我通过创建一个名为 pjava 的 bash 脚本设法做到了,如果有人遇到这个问题,代码如下:

I managed to do it by creating a bash script called pjava and the code is as follow if anyone is having this question:

#!/bin/bash
rm -rf /tmp/processing
mkdir /tmp/processing
/home/euler/Desktop/processing-2.0b8/processing-java --output=/tmp/processing/ --force --sketch=$1 --run

我的运行方式如下:

如果我在名为 project 的文件夹中,我运行 pjava ../project 并且 project.pde 将被编译并运行.

If I am inside a folder called project, I run pjava ../project and project.pde will get compiled and run.

这篇关于如何从终端运行处理应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆