Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
Entrambe le parti precedenti la revisione Revisione precedente | |||
programmazione:msys2:avviare_applicazioni [26/11/2018 - 11:50] Fabio Di Matteo |
programmazione:msys2:avviare_applicazioni [04/12/2018 - 10:45] (versione attuale) Fabio Di Matteo |
||
---|---|---|---|
Linea 20: | Linea 20: | ||
==== Python ==== | ==== Python ==== | ||
<file>C:\msys64\usr\bin\mintty.exe -w hide /bin/env MSYSTEM=MINGW64 /mingw64/bin/python3 /c/path/to/miotest.py</file> | <file>C:\msys64\usr\bin\mintty.exe -w hide /bin/env MSYSTEM=MINGW64 /mingw64/bin/python3 /c/path/to/miotest.py</file> | ||
+ | oppure creare un eseguibile con questo codice: | ||
+ | <code c> | ||
+ | #include <stdio.h> | ||
+ | #include <string.h> | ||
+ | #include <windows.h> | ||
+ | |||
+ | #include <libgen.h> | ||
+ | |||
+ | int main(int argc, char** argv) | ||
+ | { | ||
+ | char cmd[200]; | ||
+ | char* msys2= "\\usr\\bin\\mintty.exe -w hide /bin/env MSYSTEM=MINGW64 /mingw64/bin/python3 " ; | ||
+ | sprintf ( cmd, "%s%s%s", dirname(argv[0]),msys2,argv[1] ); | ||
+ | |||
+ | STARTUPINFO info={sizeof(info)}; | ||
+ | PROCESS_INFORMATION processInfo; | ||
+ | if (CreateProcess(NULL, cmd, NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &info, &processInfo)) | ||
+ | { | ||
+ | CloseHandle(processInfo.hProcess); | ||
+ | CloseHandle(processInfo.hThread); | ||
+ | }else { | ||
+ | MessageBox( NULL, "Creazione del processo fallita!", "Attenzione", MB_OK | MB_ICONERROR| MB_TASKMODAL); | ||
+ | } | ||
+ | |||
+ | return 0; | ||
+ | } | ||
+ | |||
+ | </code> | ||
+ | |||
+ | **makefile** | ||
+ | <file> | ||
+ | all: | ||
+ | gcc run.c -mwindows -o runmsys2 | ||
+ | |||
+ | </file> | ||
Il nostro wiki installa solamente cookie tecnici necessari al funzionamento della piattaforma "Dokuwiki". Niente analitics, statistiche, tracciamenti o altro.