[OpenR8 solution] Print (Print text in the command window and open a new window to display images)
  1. Chapter1: Print Introduction

 

The function of Print is the content printed in the "DOS Window". The printed content can be int, bool, float, double, string, image, where the string supports printing the function containing the Chinese character string.

 

 

  1. Chapter2: Print folder introduction

 

Print is in the solution folder of OpenR8, as shown in Fig. 1, with two flow files, such as Fig. 2.

  1. Print.flow: Print out integers and float numbers.
  2. PrintUnicode.flow: Print the Chinese character string.

 

Fig. 1. Print location.png

Fig. 1. Print location.

 

Fig. 2. Print folder.png

Fig. 2. Print folder.

 

 

  1. Chapter3: Print.flow—Print integer and float

 

Please double-click “R8_Python3.6_CPU.bat or R8_Python3.6_GPU.bat” => “File” => “Open” => “Enter the solution under OpenR8 => “Select Print folder” => “Load Print.flow”, as shown in Fig. 3, Fig. 4.

 

Fig. 3. Select Print.flow.png

Fig. 3. Select Print.flow.

 

Fig. 4. Load Print.flow.png

Fig. 4. Load Print.flow.

 

Press the Run.

 

Fig. 5. Running the solution.png

Fig. 5. Running the solution.

 

Integer (123), a float of 0 (0.000000), and a float of 1 (1.000000) are printed in the "DOS Window".

 

The usage of the print function (Print, Println) will be introduced in Chapter 5.

 

 

  1. Chapter4: PrintUnicode.flow—Print String

 

Please double-click “R8_Python3.6_CPU.bat or R8_Python3.6_GPU.bat” => “File” => “Open” => “Enter the solution under OpenR8 => “Select Print folder” => “Load PrintUnicode.flow”, as shown in Fig. 6, Fig. 7.

 

Fig. 6. Select PrintUnicode.flow.png

Fig. 6. Select PrintUnicode.flow.

 

Fig. 7. Load PrintUnicode.flow.png

Fig. 7. Load PrintUnicode.flow.

 

Press “Run”.

 

Fig. 8. Run the solution.png

Fig. 8. Run the solution.

 

The Chinese string is printed in two different functions in the "DOS Window".

 

※The usage of the print function (Print, Println) will be introduced in Chapter 5.

 

 

  1. Chapter5: Print function introduction

 

Fig. 9. Print function.png

Fig. 9. Print function.

 

[Print] is the most commonly used function in the writing process, such as the process error, where to start looking for something wrong, or whether the content is wrong when executed, and the type it can print. There are the following:

 

  1. int: You can choose to print a variable whose variable type is an integer.
  2. bool: You can choose to print a variable whose variable type is a boolean.
  3. float: You can choose to print the variables whose variable type is float, up to six decimal places, as shown in Fig. 10.
  4. double: You can choose to print the variables whose variable type is double, up to ten decimal places, as shown in Fig. 10.
  5. string: You can choose to print a variable whose variable type is a string.
  6. image: Print the image as shown in Fig. 11.

 

※[Print] Only one variable can be printed at a time. If you want to print more than two, please use two [Print], as shown in Fig. 12.

 

※[Print] and [Println] Only the [Println] can be changed to the next line, as shown in Fig. 13.

 

※Only [Print], [Println] and [Debug_Print], [Debug_Println]  will be printed when [Debug_Print], [Debug_Println]  is in debug mode, and the execution mode will not be printed.

 

Fig. 10. Difference between float and double.png

Fig. 10. Difference between float and double.

 

Fig. 11. Printing images using Print .png

Fig. 11. Printing images using [Print].

 

Fig. 12. Situation when printing multiple variables.png

Fig. 12. Situation when printing multiple variables.

 

Fig. 13. Differences between print and println.png

Fig. 13. Differences between print and println.


Recommended Article

1.
OpenR8 - AI Software for Everyone (Download)