Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8850179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:50:25+00:00 2026-06-14T12:50:25+00:00

In Pygame, how can I get graphical input(e.g. clicking exit button) and also get

  • 0

In Pygame, how can I get graphical input(e.g. clicking exit button) and also get input from the a terminal window simultaneously?

To give you context, my game has a GUI but gets its game commands from a “input()” command. How can I look for input from the command line while also handling graphics?

I’m not sure if this is possible, but if not, what other options do I have for getting text input from the user?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:50:27+00:00Added an answer on June 14, 2026 at 12:50 pm

    You can’t do that, unless you use the input command in a different thread, but then you have to deal with syncronization (which might be what you want or don’t want to do).

    The way I’d implement this is to create a kind of in-game console. When a special key (e.g. ‘\’) is pressed you make the console appear, and when your application is in that state you interpreter key pressing not as in-game commands but… well, as text. You can print them in the console (using fonts). When a key (e.g “return”) is pressed you can make the console disappear and the keys take back their primary functionality.

    I did this for my pet-project and it works as a charm. Plus, since you are developing in python you can accept python instructions and use exec to execute them and edit your game “on fhe fly”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Pygame/SDL's joystick module to get input from a gamepad. Every time I
Using PyGame, I get flickering things. Boxes, circles, text, it all flickers. I can
Is there a way I can display text on a pygame window using python?
Is it possible to get a fully transparent window in Pygame (see the desktop
short version: how can I get rid of the multiple-versions-of-python nightmare ? long version:
How can i prevent the sprite image from flickering uncontrollably? (image name is plumbers).
I have a Pygame program that needs text input. The way it does this
Where can i get python references for kinect. I would like to pull out
I'm trying to get pygame working with portable python 3.2.1.1 running off a USB
I am working on a project in python using pygame and pyro. I can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.