当前位置:网站首页>XII Golang others
XII Golang others
2022-07-04 05:24:00 【Willing to ride the long wind and break thousands of miles of w】
1. Execute the script
as follows golang It can be executed python Script
package main
import (
"fmt"
"os/exec"
)
func main() {
cmd := exec.Command("/usr/local/bin/python3.9", "/Users/haha/GolandProjects/awesomeProject5/test.py")
// The error output and standard output of the command are connected to the same pipe
stdout, err := cmd.StdoutPipe()
cmd.Stderr = cmd.Stdout
if err != nil {
return
}
err = cmd.Start()
if err != nil {
return
}
// Get the output from the pipeline in real time and print it to the terminal
for {
tmp := make([]byte, 1024)
_, err := stdout.Read(tmp)
fmt.Print(string(tmp))
if err != nil {
break
}
}
if err = cmd.Wait(); err != nil {
return
}
}
python The script is as follows :
#!usr/bin/python3
assert 3 == 4Execution results :
Traceback (most recent call last):
File "/Users/haha/GolandProjects/awesomeProject5/test.py", line 2, in <module>
assert 3 == 4
AssertionError
err = exit status 1边栏推荐
- Simple g++ and GDB debugging
- 力扣 第 300 场周赛
- Principle and practice of common defects in RSA encryption application
- A summary of the 8544 problem that SolidWorks Standard cannot obtain a license
- flink1.13 sql基础语法(一)DDL、DML
- C language simple student management system (including source code)
- [QT] timer
- 远程桌面客户端 RDP
- 1480. 一维数组的动态和
- Notepad++--显示相关的配置
猜你喜欢

2022年R2移动式压力容器充装复训题库及答案

数据标注是一块肥肉,盯上这块肉的不止中国丨曼孚科技

Trie数-字典树
![[high concurrency, high performance and high availability of massive data MySQL practice-7] - memory data drop disk](/img/b9/cf4db4f8a5d2ef3fb344258f0e30f5.jpg)
[high concurrency, high performance and high availability of massive data MySQL practice-7] - memory data drop disk

Letter meaning and parameter abbreviation of optical module Daquan

Just do it with your hands 7 - * project construction details 2 - hook configuration
![[wechat applet] template and configuration (wxml, wxss, global and page configuration, network data request)](/img/78/63ab1a8bb1b6e256cc740f3febe711.jpg)
[wechat applet] template and configuration (wxml, wxss, global and page configuration, network data request)

【兴趣阅读】Adversarial Filtering Modeling on Long-term User Behavior Sequences for Click-Through Rate Pre

LM small programmable controller software (based on CoDeSys) note XXI: error 3703

中科磐云—2022广东木马信息获取解析
随机推荐
小程序毕业设计---美食、菜谱小程序
[matlab] matlab simulates digital baseband transmission system eye diagram of bipolar baseband signal (class I part response waveform)
Topological sorting and graphical display of critical path
Graduation design of small programs -- small programs of food and recipes
cmake
练习-冒泡排序
[matlab] matlab simulates digital baseband transmission system - digital baseband transmission system
[QT] create mycombobox click event
Analysis of classical pointer and array written test questions in C language
NTFS security permissions
2022 t elevator repair operation certificate examination question bank and simulation examination
[QT] timer
力扣(LeetCode)184. 部门工资最高的员工(2022.07.03)
基于单片机的太阳能杀虫系统
[matlab] matlab simulates digital bandpass transmission systems - QPSK and OQPSK systems
中職組網絡安全—內存取證
Rollup各组件作用
中科磐云—D模块解析以及评分标准
724. 寻找数组的中心下标
Void convolution, deformable convolution, deformable ROI pooling