echo -n 123456 | dmtxwrite -s 16x48 -o image.png
exec.Commad()
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/c6aaba94-453b-41dc-83a4-ffd4f3912494o%40googlegroups.com.
On Mon, Jun 22, 2020 at 8:54 AM Franco Marchesini <franco.m...@gmail.com> wrote:
Help,--how I can translate this shell command :
echo -n 123456 | dmtxwrite -s 16x48 -o image.pngto golang
exec.Commad()Thanks in advanceFranco
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golan...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/c6aaba94-453b-41dc-83a4-ffd4f3912494o%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/e84a97ec-d326-4ccc-8e31-bf25991ec897o%40googlegroups.com.
func main() { cmd := exec.Command("dmtxwrite", "-s", "16x48", "-o", "image2.png")
cmd.Stdin = strings.NewReader("123456")
if err := cmd.Run(); err != nil {
panic(err.Error())
}
}
You can avoid calling the shell by observing that you are simply passing "123456" as input, which you can do in a Go Program itself.
On Jun 22, 2020, at 8:54 AM, Franco Marchesini <franco.m...@gmail.com> wrote:
Help,how I can translate this shell command :
echo -n 123456 | dmtxwrite -s 16x48 -o image.pngto golang
exec.Commad()Thanks in advanceFranco--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golan...@googlegroups.com.