Taking input from text boxes - python

I've looked at the documentation of Starlette, and can't seem to figure out how to take the content of a text box and link it to a python variable. The plan is to have a user enter text into several text boxes, click a button, and then the information will be used for an SQL query.
I really have no idea how to proceed.
Edit: I think people are misunderstanding. There is no code yet. I don't know how to reference a text box using Starlette.

Related

Formating text in a Qtext edit

I am working on a Pyqt5 soft which can print a text in a qtext edit.
2 qcombobox allows the user to choose the text.
The text displayed in the qtext edit is loaded from json files.
This part of the soft is ok.
For now, i want the user to be able to edit the files ( i need to change style, especially put the text in bold).
I think that the best way to do it is with html, but i can’t manage the balise insertion.
I also face issues by selecting only part of the text.
i don't really understand the cursor/ anchor fonctions and don't have find explicit documentation.
Any one to give me an advice, or even part of the code that can help me ?
thank you in advance !

I'm starting out using tkinter

I am just starting out to use tkinter in Python 3.5 and I don't understand it the best yet but hopefully will over time.
Anyway, what I was asking was how do I create a text box that a user can type into, I know it is possible but don't yet know how to execute this as, as I said at the beginning, I'm just starting out.
If there is any scaffolding code of a box that I could use to that would allow a user to enter text, it would be a great help if you could show it to me.
Also, to interact with this input, would it be the same as python?
I know this is a lot to be asking but any responses are welcome,
Thanks in advance :)
Both of the following links contain code relating to text entry.
http://effbot.org/tkinterbook/entry.htm
http://effbot.org/tkinterbook/text.htm
Entry is a single line box.
Text is a multiple line box and supports text formatting

Python (for Ren'Py Engine) ui.input into button?

I designed a character creation page, and included a bit where a person can input their name with ui.input() but the problem is, they can't push any buttons or do anything at all without submitting the text first and I am trying to figure out how to turn this ui.input into a clickable so it is only active when its selected.
Then engine has a page on the ui.input (and includes explaining that the button arg is possible) but it doesn't really give me any other example other than button=None. and anything else I try, the game won't even load.
Sorry if this is a really noob question. Seems like the most simple thing.
This is what I have for that part if it helps..
ui.input('', xalign=0.5, yalign=0.5)
first_name = ui.interact()
How about creating a character creation screen and using a graphic button?
In a custom screen, you can control everything using buttons and code, which is, in some senses, outside of your story.

How to take user input in matplotlib?

Is there any way of getting some input from a user in matplotlib? For example, a drop down list or a text box? What alternatives are there?
If there isn't anything, what would be the easiest way of displaying data based on what a user's input would be?
This could be a very very WIDESPREAD answer...
What exactly do you mean when you say "input from user?"
if you are just talking about a textbox and an okay button then
raw_input('Enter your text')
If you're wanting something a bit more sophisticated and controllable I suggest looking into the Tkinter tools and creating your own GUI where you can create things like combo boxes, checkboxes, entry widgets, popup boxes, and a lot more.
if this doesn't exactly answer what you are asking please post an example of your code then add something like
code code code
#HERE YOU WOULD PUT WHAT YOU WANT TO ACCOMPLISH
code code code

Python GUI: Organizing and Interacting with Displayed Text- Need help to find suitable widget/object

I am quite new to Python and have been writing my first GUI with tkinker with mostly ttk widgets. I have been searching for the better part of a day to figure out how to best go about solving a problem.
My goal: To create a document that will have check boxes next to each entry that when selected to perform an action. I have all the data management figured out. The issue is that I will have a variable number of entrees each with a variable about of text. What i am trying to do is figure out which widget or other object i should use to 1st keep inserted chunks of text aligned with a particular check box and 2nd have the view be scroll-able and locate-able(IE click on words in table of contents and have it bring to view said text from long list of entrees). Would anyone happen to have any suggested library or widgets i should look into to get this working?
I have thought about using many text boxes and linking check boxes to each text box. I cannot however figure out how to make these multitude of text boxes sit in a scroll-able frame that will re-size based on content and still have coordinates to point to that will adjust the view to the proper entry when selected from a table of contents.
A really great tutorial, which takes you through a bunch of widgets can be found here.
http://zetcode.com/gui/pyqt4/
I went through it today, and I already have a working application with QSliders, QFrames, a graph widget and a bunch of controls.

Categories