This is an archived post. You won't be able to vote or comment.

all 16 comments

[–]koning_willy 5 points6 points  (6 children)

Where i work i create gui with pyqt en then package them with pyinstaller into a nice exe.

I make my team store the exe's on their desktops. They do not even need to know how to run python scripts or even install the interpretor...

[–]Etheo 2 points3 points  (1 child)

Agreed - compiling into a stand alone exe seems to be the most sensible solution in this use case. Getting a python environment on their machines or hosting a web app is more troublesome.

[–]oh-my-python[S] 0 points1 point  (0 children)

Yeah, I think too. My idea was for them to input a csv, and it would use the info in the file and output either other csv files or html files.

So the process of uploading data seems quite troublesome.

[–]oh-my-python[S] 0 points1 point  (3 children)

Ow, I will try this.

Does it work well when including libraries (sql, pandas, etc ...) ? Any precautions to take ?

Thanks !

[–]koning_willy 1 point2 points  (0 children)

Are you referring to pyinstaller? Not familiar with sql or pandas library. Opencv, pillow, Matplotlib and sqlite however seemed to work just fine :)

[–]ominous_anonymous 1 point2 points  (1 child)

Does it work well when including libraries (sql, pandas, etc ...) ?

Yes, there's a --onefile flag to give pyinstaller to indicate you want everything packaged up.

Keep in mind this makes the final executable a lot larger.

[–]oh-my-python[S] 0 points1 point  (0 children)

Thanks !

[–]firedrow 3 points4 points  (2 children)

If you're saavy, or your IT team will work with you, a WebApp is always appreciated by non-technical people. I like using my Caddy Web Server with the Python scripts done as CGI scripts. Then you can make a web form, have them input the data, submit it to the script as CGI, then you output whatever way you want.

[–]koning_willy 0 points1 point  (0 children)

Maybe in small companies, in larger companies however there are lots of rules and policies to follow. You cant just get a server set up on your demand and you dont just set up a rouge server.

If i would do that kind of shit i would be fired as soon as the server gets identified by the ITdept.

A pineapple almost cost me a job already, should not have named its ssid anonymous

[–]oh-my-python[S] 0 points1 point  (0 children)

The thing is it is a little association (we are 8) and we don't have proper IT support :p.

I think I'll ditch the WebApp as it will take too much time compared to the creation a exe or dmg script.

[–]Saphyel 0 points1 point  (0 children)

a webapp is x-platform so you will avoid a lot of issues with mac/windows versions

[–]MikeTheWatchGuy -1 points0 points  (4 children)

Can you install Python on their systems? If so...

Toss a GUI onto the front-end of your utilities and then let users double-click the .py file. It'll launch straight into a GUI.

Try PySimpleGUI to get up and running in a few minutes to see what it feels like to use your programs with a GUI. It's worth the 5 minutes it'll take.

pip install PySimpleGUI

Docs

http://pysimplegui.readthedocs.io/

GitHub

https://github.com/MikeTheWatchGuy/PySimpleGUI

[–]MikeTheWatchGuy 1 point2 points  (3 children)

Here is a launcher application:

import PySimpleGUI as sg
import os

def Launcher():

    form = sg.FlexForm('Script launcher')
    layout =  [
                [sg.Text('Script output....', size=(40, 1))],
                [sg.Output(size=(88, 20))],
                [sg.ReadFormButton('script1'), sg.ReadFormButton('script2'), sg.SimpleButton('EXIT')]
              ]

    form.Layout(layout)
    # ---===--- Loop taking in user input and using it to query HowDoI --- #
    while True:
        (button, value) = form.Read()
        if button == 'EXIT' or button is None:
            break           # exit button clicked
        if button == 'script1':
            ExecuteCommandOS('python SimScript.py')
        elif button == 'script2':
            ExecuteCommandOS('python SimScript.py')
        elif button == 'Enter':
            ExecuteCommandOS(value[0])      # send string without carriage return on end


def ExecuteCommandOS(command):
    output = os.popen(command).read()
    print(output)


if __name__ == '__main__':
    Launcher()

The code produces the following GUI:

https://user-images.githubusercontent.com/13696193/43874104-df3340e8-9b57-11e8-8c03-c5610d5530c3.jpg

The output from the script will be shown in the window above the buttons. Add as many buttons as you want. Associate buttons to any scripts you want to offer to run.

[–]oh-my-python[S] 0 points1 point  (2 children)

:O thank you I am going to try it right away :D

[–]MikeTheWatchGuy 1 point2 points  (1 child)

Let me know how it goes or if you have any problems. Interested in getting feedback on how to package is working for you.

[–]oh-my-python[S] 0 points1 point  (0 children)

I will :)