Giter VIP home page Giter VIP logo

Comments (4)

john144 avatar john144 commented on May 14, 2024

This might be related. I'm running Python 3.7 in Windows 10. I'm trying to create and write into a debug window using the code provided in the docs. However, the debug window will not remain open when the print loop finished. If I run this code from Idle in a .py file, the debug window remains open, but when I run it from a Windows commant prompt, or from PyCharm, or from Sublime Text, the debug window quickly opens, runs, and closes.

import PySimpleGUI as g
g.Print('Trying out the print cability')
print=g.Print
print('This really does work')
for i in range(100): 
     print(i)

from pysimplegui.

MikeTheWatchGuy avatar MikeTheWatchGuy commented on May 14, 2024

is there anything after the last print?

You need a Popup or some other window to stay open in order for the debug to remain.

There are problems with these non-blocking windows are the only thing remaining. You need to stay in the tkinter loop somehow and the best way is to print a sg.Popup at the end of your program.

import PySimpleGUI as g
g.Print('Trying out the print cability')
print=g.Print
print('This really does work')
for i in range(100):
     print(i)

g.Popup('End of my program')

from pysimplegui.

john144 avatar john144 commented on May 14, 2024

from pysimplegui.

MikeTheWatchGuy avatar MikeTheWatchGuy commented on May 14, 2024

I haven't used the debug print very much, so let me know how it goes :-)

Just be aware that when multiple windows are open closing one of them can potentially affect others. If you have any problems just speak up.

I fixed a big in this code that was causing the pypy issue. I'm closing out the bug

from pysimplegui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.