Making a python UI - is Tkinter the best option? [closed] - python

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I currently have a script that automates sending Whatsapp messages. It takes an excel file full of contacts, receives a message argument and then sends the message to each contact. It's purpose is to help automate sending the same message about different services being offered to a bunch of groups.
I am making the program for a family member who is computer illiterate and am hoping to make some simple UI for them so they never have to interact with the code.
I have already been playing around in tkinter, and have figured out how to open a dialog to select the Excel file that needs to be used. I am confused about how the rest of the program would functionally work and if this is feasible for someone who has never used Tkinter before and is on a short deadline.
I was thinking it would look something like a button, to open up the dialog to choose the Excel file. A text box, to fill in the message. And, another button to open up a dialog to choose a photo to be sent along the message. Then once all that was done the program would run.
Is this functionally possible, and is Tkinter the best option to pursue? Also is this feasible first project for a novice Tkinter user?

Python is best for backend
Hey, so I think Python isn't the best language for UI at all.
In my opinion it is quite difficult to make a real good looking program with tkinter, but as I said before, Python is more for backend programming. But tkinter is not a bad choice for a simple program - if not the best. Also, the advantage of a tkinter program is that you can write your code and the GUI code in one file, which makes the program a bit more compact
But if you want a simple GUI program tkinter is you first choice

Related

Merge two exe files via python [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I want to merge two exe files through python and I've come to the conclusion that the easiest method of doing this would be to make an executable file that has both exe's in its resources and runs the resources of one exe, then the resources of the other (they do not have to execute simultaneously, rather just be packed into one file and take turns executing).
Any ideas?
The simplest way (which isn't simple at all) would be to first write a program in a compile-able language like c or c++. This program would open itself and look for a delimiter of when the next program begins.
Example:
[exe header][code]{delimiter}[program2]
From there you can read that code and write it into a new exe file (if the second program is a exe) or multiple other ways. Then run the second program. Python could be used to pack the second program onto the first one but...
This is almost exclusively used for malicious programs as the "unpacking" program can be made to not be detected by anti-viruses and the malicious program can be encrypted. Due to this, this is as far as I will go and I won't be giving any examples.
If you have any specific questions about code your working on like errors or unexpected results I am sure many people would be up to helping you. Please let me know if you have any questions!

A safe way to make an website run a python script [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I made a small script that solves an combinatorial optimization problem and I would like put it in a website so users can "play" with it, they could send a list of "points" to the server and this script would use a database to return the best combination of these "points".
The problem is I do not have much experience in web dev. I searched how to make an html button execute an script and I found this thread: https://stackoverflow.com/questions/48552343/how-can-i-execute-a-python-script-from-an-html-button#:~:text=To%20run%2C%20open%20command%20prompt,Hope%20this%20helpful.
But there says that an html button calling an python script is not safe. So what would be ideal What would be an ideal, safe alternative so that I could make sure that anyone who accesses my website can execute this script safely?
Well, there's no "easy" answer to your question. What you'd really need to do is to create a web-site in Python on your host computer – using a tool such as Django – and have one of the URLs supported by that website call your script.
Honestly, "what you're asking for here, really isn't the sort of question that StackOverflow is intended to answer." It's too big. Another one of the SE-family sites might be more appropriate, although I'm not quite sure which one ...
The solution that comes to mind would be setting up some Python-API (e.g. with Flask) which you could call with HTTP via JS, having different routes for different usages.
Here's a short overview of Flask showcasing how it could be used.

Programmatically Control Computer in Python [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I searched a lot, but couldn't find any precise answer to my question. I would like to programmatically be able to simulate user interactions with the computer. I would like to target OSX since that's what I am working on. For example, I would launch Dashboard or Mission Control, move the mouse and click on things, open a keyboard, etc.
I wonder if I should use Linux with Xlib or something like that... Would I be more free to execute these kinds of operations? And do you know any libraries that allow them easily, in Python preferably?
This kind of software is called a "robot", or "ui automation", which makes googling a little difficult. Here is one in python: http://code.google.com/p/robotframework/
I like to use Sikuli for this sort of thing. Last time I needed to automate a GUI app on OS X, I wrote a standalone Jython script which used Sikuli as a library.
You can also use the Sikuli IDE if you want to get something working quickly, which can be nice for experimentation.

How to externally force a running application to perform basic tasks? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I need to develop a code that causes a currently open application (running in the background) to perform basic tasks when a certain condition is met.
Let me explain through a random example…
Imagine I am working on a Microsoft word document and I want it to print exactly every 10 minutes automatically, i.e. without having to physically click the print button. What options do I have to implement something like this? Obviously gaining access to the MS word source code is an option, but is their an easier way…perhaps using a python script?
Thanks,
David
Microsoft Office products, as well as Internet Explorer and some other programs expose a Component Object Model (COM) interface. You can find more detail about COM and how it applies to Python here (including examples). They often expose every action you could do manually in the applications, but are aimed at automation and artificial input.
For a more generic application, you could work with sending messages. There's a Windows function called 'postmessage', and another called 'sendmessage' which have several wrappers in Python.
By the way, the MS Word source code is not freely available.

Creating a "less"-like console pager interface for pysqlite3 database [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I would like to add some interactive capability to a python CLI application I've writen that stores data in a SQLite3 database. Currently, my app reads-in a certain type of file, parses and analyzes, puts the analysis data into the db, and spits the formatted records to stdout (which I generally pipe to a file). There are on the order of a million records in this file. Ideally, I would like to eliminate that text file situation altogether and just loop after that "parse and analyze" part, displaying a screen's worth of records, and allowing the user to page through them and enter some commands that will edit the records. The backend part I know how to do.
Can anyone suggest a good starting point for creating that pager frontend either directly in the console (like the pager "less"), through ncurses, or some other system?
You might want to take a look at urwid. It is a console user interface library for Python. The examples should be more than enough to convince you that this is what you want, if you really want to go text-console UI.
I'd use something like pygtk instead though.
After looking around a bit, I found that less and other pagers actually use curses. When I thought of curses I always imagined the blue-boxed interface with menus and mouse interaction. These are library add-ons for curses, which offer exactly the basic terminal selection and editing control functionality I'm looking for.
Tutorial on Python Curses Programming
Curses Programming with Python
On the backend, when the user attempts to move the cursor above or below the currently displayed records, I'll have sqlite fetch me the next appropriate set of records for display.

Categories