|
|
clipka <ano### [at] anonymousorg> wrote:
> Am 13.09.2016 um 16:29 schrieb LanuHum:
> > clipka <ano### [at] anonymousorg> wrote:
> >> Am 12.09.2016 um 22:13 schrieb LanuHum:
> >>> "LanuHum" <Lan### [at] yandexru> wrote:
> >>>>
> >>>> We will look for errors. :))))
> >>>
> >>> :(
> >>> If I uncommented Py_Finalize(), application crash when the command Py_Finalize()
> >>> run. If I do not use the import of bpy, the application lives
> >>
> >> Have you finished your other homework yet?
> >>
> >
> > No. To learn your lesson, I started from scratch. I started all over again.
> > I wrote a single function.
> > The function must import the module, clean it and write "Hello World".
> ...
>
> > Where is the "Hello World"?
>
> Take even another step back: Write a program that does _not_ try to run
> Python at all, and instead just outputs "Hello World" to the standard
> output stream.
>
> How exactly are you running the program in the first place? What is this
> "Konsole"? Why is it writing "Blender quit" when you're testing a
> self-made program?
>
> In MS Visual Studio, if I simply run a "Hello World" program by hitting
> F5, I never see the output because the output window is closed as soon
> as the program exits.
>
> If you have a similar problem, make sure that your program reads a
> character from standard input at the end, so that you need to press a
> key before the window closes.
OK. My OS - Linux.
The first program for Windows is different from the first program for Linux.
For Windows:
#include <iostream>
#include <cstdlib> // for system
int main()
{
std::cout << "Hello, world!" << std::endl;
system("pause");
return 0;
}
For Linux:
#include <iostream>
int main() {
std::cout<<"Hello world!"<< std::endl;
return 0;
}
cmd in Widows = konsole, console, terminal, gnome-terminal, lxterminal, xterm in
Linux.
My IDE - Geany, NOT MS Visual Studio! :)))
Compiling object file in IDE:
g++ -Wall -c "%f"
Make binary:
g++ -Wall -o "%e" "%f"
Run:
"./%e"
IDE automatically runs a program from the konsole.
konsole displays the result.
I can run the program manually.
After quit program the console does not close.
This is our first step:
Post a reply to this message
Attachments:
Download 'konsole(kde4).jpg' (37 KB)
Preview of image 'konsole(kde4).jpg'
|
|