I wrote an applet in Python using the Tkinter library. I finished writing the applet but now I want to make it public on my website. Does anyone know a way to get the python script to work on my website? I don't want it to have to be something that needs to be downloaded, but can just run in the browser if possible.
Thanks!
What you ask is not possible. Several years ago there was a Tcl/Tk browser plugin, but the last time anyone touched that sourceforge project was back in 2006. I seriously doubt it could be made to work with tkinter. For that matter, I doubt it works for tcl/tk either. Browsers have advanced quite a bit since then.
And no, getting it to work in jython so you can run it via a java plugin won't help. Tkinter works by working directly with a tcl/tk interpreter. The tcl/tk interpreter won't run in the JVM.
Related
This is my first post on stack overflow so I hope I'm doing it properly.
I am currently working on a Terminal User Interface for python applications. I know that there are many ready-to-use libraries such as npyscreen out there, but I wantend to create one as programming excercice. In particular, I wanted to to play with some architectural patterns to learn them.
All that said, I'm currently facing several problems with python curses library, that I'm using as low level interface to the terminal.
The problems arise when I try to resize my terminal. As you can see from the code (see below), I handle the terminal resizing in the main loop, invoking the getmaxyx()() method of my curses window and redrawing what is on the screen accordingly.
The problem is that the screen seems to flicker when I try to resize the terminal.
Moreover, my "curses application" works fine on MacOS but totally crashes on windows (even after installing windows curses).
To handle that I tried to re-write the low-level interfice by using the blessed library. It solved the windows crashing problem, but the flickering still remains.
I can not figure out what the problem is.
Fore those wishing to help me, here follows the github page of the project: Terminal GUI on GitHub
Thank you in advance.
With curses, there's (at least) 3 things to look for:
ncurses can handle SIGWINCH (PDCurses may not)
some Python configurations interfere with ncurses receiving SIGWINCH. If your program never receives KEY_RESIZE (which it's not checking for...), then it's time to file a bug report for Python to get that fixed.
some programs don't actively read keyboard input (and if KEY_RESIZE isn't read, ncurses won't update the screensize. That would make the program crash.
I tried to open a file, the filename is 1.txt. I tried to open it with webbrowser.open("1.txt") or os.startfile("1.txt") which worked perfectly fine, but I couldn't find any information about how to start programs or anything with Python in full screen. I'm using Linux and Python 3.6.
Any ideas how to perform something like that?
There are more answers to that question than there are GUI toolkits, and there are plenty of toolkits.
I think the first thing you need to do is decide on a GUI toolkit. Research it depending on your necessities (python version, OS support, etc). Once you settle on one, find out how to make a fullscreen app with that. If you can't, ask again.
Good luck.
I wrote an applet in Python using the Tkinter library. I finished writing the applet but now I want to make it public on my website. Does anyone know a way to get the python script to work on my website? I don't want it to have to be something that needs to be downloaded, but can just run in the browser if possible.
Thanks!
What you ask is not possible. Several years ago there was a Tcl/Tk browser plugin, but the last time anyone touched that sourceforge project was back in 2006. I seriously doubt it could be made to work with tkinter. For that matter, I doubt it works for tcl/tk either. Browsers have advanced quite a bit since then.
And no, getting it to work in jython so you can run it via a java plugin won't help. Tkinter works by working directly with a tcl/tk interpreter. The tcl/tk interpreter won't run in the JVM.
Im new to python and want to create a GUI front-end (desktop, rather than web) for my python script. The script essentially parses XML files and runs various searches over the contents (eg. accepts regex searches from the user, returns results etc).
It works well on the command line but I want to present a more user friendly interface.
There seems to be a lot of options out there - http://docs.python.org/faq/gui.html
Or should I look elsewhere?
Can someone recommend a GUI toolkit for Python?
Cheers.
I recommend using one of Tkinter, wxPython or PyQt. They are all equally suitable for a simple task. My personal favorite is Tkinter because I think it is the simplest way to get started. However, any of those would make a fine choice.
Here is a page on the Python wiki with some fifty options.
PyQt is great, although it's on GPL. There is also PySide alternative on LGPL.
You can also try wxPython or PyGTK if you don't like Qt for some reason. There is also gui library in python standard library called Tkinter, but I haven't used it and don't have any experience with it.
ok so for the past two weeks or so, ive been learning python as it is extremely simple to comprehend and a very handy method of creating a GUI for a program. However i have three problems.
First, when i open my .py file a command window opens , and then my program opens on top of that. Is there a way to just open the program? (and not the command window)
Second, ive been eagerly searching for a simple method of compiling (or "interpreting")
my .py filesinto .exe files. ive come across a few people saying that the program called py2exe is the best method, however i cant get it to work... Are there any easier methods for compiling python source codes into executable files?
Third, can anyone refer me to a site with a list of modules for python, along with their descriptions and.or examples? this would greatly help me as i tried using the built in help commands in the python command line, but i find that too generic, like it gives the syntax but no examples of what applications each command/module has.
P.S: Just wondering, is there a site that offers example programs (and their source codes) that were made with python that i could take a look at to better understand this language?
(examples: Python Games, Python GUI applications, Python Questionaires, Any Python Programs/applications that demonstrate the language's usefulness)
INFORMATION:
OS: WINDOWS 7: Ultimate Edition
Python Version: 2.6
Thanks in Advance!
To keep the command window from opening, you can save it as a .pyw file, as opposed to the usual .py. As for converting to exe, py2exe works best for me, I know there are several others, but not as fully developed as py2exe is. Python.org should contain a list of most modules. The same results could easily be procured by googling python modules.
EDIT:
Also, as for the gui, I have found that I personally like pyqt and tkinter best.
Use pythonw.exe instead of python.exe to run your program.
I use cx_freeze; docs on their website.
PyPI