python gui programming

gszaboky

New member
If you are using python for financial, you should try the Anaconda distribution. Many people in scientific and financial areas that code in python use the Anaconda distribution. https://www.anaconda.com/. Furthermore, you should know the numpy, pandas, and matplotlib packages for python. They are used extensively in financial and scientific python programing. Matplotlib is a gui package for python. You should also get familiar with jupyter notebooks, an interactive python notebook. Great for prototyping and creating content to discuss with other people. This is one of the best things about python.
 

Rich

New member
marcas, i'm in favor of sharing code and ideas. i find slack a little more inconvenient than this forum but i can
deal with it. i can't share my programs, for various reasons, but i have a few public web sites with some graphing
tools that anyone can use and i will share some code. most of what i do is java, javascript or vb. i have some
python code but not a lot, so far.

status1, there's another forum here called trading with microsoft excel. i haven't read many of the posts
but you might find help there.

I would suggest that we use a secure github repository, because then we can get proper version control. Getting complete source code packages in and out of Slack is worse than putting it in email.

Perhaps we should have Tom Nunamaker set up a code repository, so that it is not available to the general public.

Membership has its privileges !!
 

gszaboky

New member
Github is the only way to go. It's pretty much the standard way to manage software and collaborate amongst developers. The free account only allows 500MB of private storage. If we do anything significant, this would be insufficient and we would have to upgrade and buy space. Or declare the project is viewable by everyone and you get unlimited space. Depends on how everyone feels about open source. There other considerations that may incur an expense, but not initially. For example, running CI/CD operations as a gateway to committing any changes to the master repo. A great way to guarantee quality. There are considerations that do not incur an expense often but require effort. For example, if you have many branches, it can be a real headache managing all the changes. Again none of this is necessary initially. Most just want to share source code, but if the code base is popular and the community contributes a lot, then these other considerations will come into play. Put another way, if you want to do this, it may require effort and expense.
 

jim leahy

Member
since you guys hijacked my topic :) i want to return to my original problem: python gui programming.
the project i needed it for had to be sidelined because my data source went away but now my new
program needs a gui. i used tkinter and came up with the gui below. it's not pretty but it does the job.
if you knew how long it took me to get this far, you'd revoke my programming license. in all fairness, if i had
to do this in java w/o a gui editor it would be as painful. but i can't say i would recommend tkinter for anything
but the simplest gui.

Screenshot from 2020-08-08 17-11-05.png
 

Tb2018

Member
Just a thought : Be aware that Luis Hamilton (F1 6 time winner),is not a mechanic nor a car engineer!

Cheers
 

gszaboky

New member
Have you looked at Python GUI Programming Wiki? It lists all the GUI packages supported by category. Tkinter is python's standard package. It rides on top of tk and tk is required. Not the most efficient way of doing things, having one interpreted language riding on top of another. It sort of depends on what you are doing. If you are creating personal desktop apps where you don't care to much about the GUI appearance then tkinter is fine.
 

gszaboky

New member
At work, we run python as a backend. All of the GUIs (front-end) are browser-based. There are some browser-based packages like PyJamas for python. This allows you to write all of your code in python. We actually write the front end in javascript, because this the native language of browsers. For performance on backend processing, we use C++ and create python extensions so we can access the C++ code from python. Doing this in 3 languages gives you extreme flexibility and performance. The downside is you are developing in 3 languages and builds can be tricky.

Several years ago a package called nodejs came out that allows you to run javascript natively on the computer (no browser). This allows you to write all your front-end and back-end code in javascript, avoiding developing in 2 languages. running a nodejs program is just as fast if not faster than python. Furthermore, I can package a project as a browser-based app or a desktop app or tablet app or phone app or a PWA. All of my personal projects are now written this way. I use a standard GUI styling guideline called Material IO. I use SQLite as a database on the backend. With respect to my own projects, over the years I started with Java, moved to Python, and now Javascript.

Just curious, what programming editor are you using? For python, I think PyCharm or VS Code are the most used. I use VS Code because of the multi-language support. Both have extensive support and make it easy to spot issues.
 

jim leahy

Member
i use emacs for my python programming editor. i use jupyter to develop python and then convert to py.
my main programming effort is java and javascript. i won't do any future large desktop programs. i'm
moving mostly to the web. i use netbeans for java, javascript, and php and andriod studio for mobile.
if i were to get serious about large python programs i'd probably go with visual studio. i use visual studio for
visual basic but it's a very old version.
 

StefanS

New member
i had some kind of wakeup moment recently. i do C++ and python almost exclusively, some C++/Qt for user interfaces. on the python side i have felt handicapped whenever i needed a GUI, i am using dash and bokeh (great, but limited), and i had to dive into custom-extending those packages when i needed special things, an attempt which has fizzled. it struck me only recently that i might have been hammering nails with a screwdriver, insisting that my beloved python should do 100% of the job. i have also avoided javascript like the plague, while the world moved on to Typescript/React/Angular/Vue. so i grabbed Angular, stepped through its tutorial and was impressed that i could do so much in so little time (tutorials are like that), then did a little feasibility project with Angular and python/flask as the backend. much to learn, obviously, but i think i have been self-obstructing for the last 10 years by not opening up to web technology earlier.
 

gszaboky

New member
I am using Angular as a javascript framework. I am also using angular material for material.io styling. Angular is a much more heavyweight framework. It has everything and as such has a steeper learning curve. I am done some stuff with React. I hear good things about Vue.

If were to form a group what projects would you be interested in tackling?
 

jim leahy

Member
i didn't like my first version so i did a version 2. this one took much less time, mainly because i knew
what i was doing this time. i used the place() window manager that lets you specify coordinates for the
location so you can put controls anywhere you want. the previous version used a grid layout, which is
easier to place, but if you have different sized controls it doesn't look very good. with some planning
ahead of time, you can do something like this in way under an hour. it's still not a complicated gui and
it's not resizable, that would take considerably more work, but there's no reason to resize it. if anyone
wants to use this as a baseline, let me know and i'll make the code available.


server_window.png
 

jim leahy

Member
i can get etrade quotes, but not in this application. i may add it later. i have the api in java and can access quotes
with a java version of a quote server. etrade provides a sample java and python implementation when you
get approved for access. etrade uses oauth1, which is pretty complicated. the python code has a library
that implements it so it wouldn't take a lot of effort to quotes.
 

Marcas

Active member
If were to form a group what projects would you be interested in tackling?

This is a tough one.

It's tough for many reasons that don't need to be listed now. Few of us here have quite an experience in creating apps and undoubtedly are able to handle heavy lifting but I propose to start small and simple, if we are to start at all. Maybe let's look at some minuscule task that will have practical use. I propose to tackle code of TOST ( forums.aeromir.com/threads/tg1-reference-from-marcas.1481/ ). It is not because it's mine but because it is ready to start to be worked upon. Idea is decent, code is crappy. Each trader/coder can approach this individually and do whatever he wants with it and share results with others at the open. No formal cooperation needed. If necessary git-hub can be created, but only if project gets any traction. Non coders can look at it and provide ideas/requests. And also see what can be achieved.

TOST is just an example. It can be anything that have practical trading use. Anybody can pass ideas requests for other simple and useful applications, preferably broker and data independent. Starting this way we can see how it goes and, maybe, look for more complicated projects.
 
Top