-1

I had a python code and I used Pyinstaller to make it a stand-alone .exe executable.

In my code, I use "print" function to output result. However, if the result is really long, (several screen page long) the result is cut short because the limitation of the console, I can scroll up but I guess the total length of the viewable text region is limited. (I am running my .exe in Windows)

Is there a way to extend the visible range so I can see all my output?

Thanks!

================

update: I agree with @supremefist that it is the shell that is limit the visible range.

Is there a way to pass parameters to the shell so that when I double click it in Windows, the view range is extended.

Also, if it is possible, I would like to have my executable robust across different OSs. I am trying to write a small program and my target users maybe inexperienced computer users.

================

update2:

Now, I understand that Pyinstaller is only for Windows, previous update for different Oss is completely wrong.

The good news is that I switch to Qt and this problem goes away as I am now displaying my result in a window rather than a shell console.

Niebieski
  • 591
  • 1
  • 8
  • 16
  • You might enjoy http://stackoverflow.com/questions/9682024/how-to-do-what-head-tail-more-less-sed-do-in-powershell – Veedrac Jun 01 '14 at 14:16
  • so if I made the .exe and double clicked it in Windows, which "shell" am I running my program in? – Niebieski Jun 01 '14 at 14:21
  • That would be an auto-spawned shell. You should open a Command Prompt manually, and run it from there with `my_command | more`. – Veedrac Jun 01 '14 at 14:23

1 Answers1

1

I don't think the limit is related to PyInstaller, but to the constraints being set on your windows shell. You could try changing your shell settings by doing the following:

  1. Open a windows shell by either running 'cmd' or by finding it under Accessories in your Start Menu.
  2. Right click on the title of the shell window and select Properties.
  3. Increase the screen buffer height setting under the 'Layout' tab to a large number. Something like 9999.
  4. Re-run your program, you should see a much longer history of text.
  • I agree it is the windows shell, but is there a way to pass that "screen buffer" as a parameter to the shell? – Niebieski Jun 01 '14 at 14:34
  • I would follow @Veedrac advice and run it manually through a command prompt that you start and configure yourself. Otherwise, if you configure the shell that is spawned by python, the settings should persist the next time the shell is spawned! – supremefist Jun 01 '14 at 14:48
  • Maybe I could write bash file to launch my exe file? – Niebieski Jun 01 '14 at 14:59
  • Definitely! You can create a file named "bla.bat" and place the following inside: python bla.py I'm pretty sure that if long bits of console output is a feature in your program, you should rather be logging to a text file using a platform independent logging framework. That way you have no (unreasonable) size limits and you can more easily process and maintain the output of the program. – supremefist Jun 01 '14 at 15:03