我想在julia
中捕获shell命令的结果在ipython中有效:
import { Http, Response, Headers, RequestOptions } from '@angular/http';
constructor(private http: Http) {}
public sendData(uName, k) {
let content = {
username: uName,
key: k
};
return this.http.post(SERVER_URL,content)
.subscribe((res: any) => {
console.log(res);
});
}
我已经尝试了
[1]: x = ! date
In [2]: x
Out[2]: ['Thu Dec 14 15:34:06 PST 2017']
是读取字符串的最佳方法吗?还是有一个;方式呢?
答案 0 :(得分:5)
按;
仅适用于Julia REPL将其移至> shell 模式,且仅限于您在该行的开头。
在程序;
中是表达式终止符。因此x = ;date
是一个错误,因为x =
是一个格式错误的表达式。
从Julia 0.7开始,您将无法使用readstring
,而是
read(`date`, String)
如果您不想要字符串但只需要一个原始字节数组,只需写入
即可read(`date`)