Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Update Python Files
#1
How to update python apps Without using any framework Hand in pyqt5.
Another Problem: And Replace The Old Source Code File File With Updated? I Can't Figure Out Wall
Reply
#2
It will be a small miracle if someone understands that question. I can't wait to see the answer.
Reply
#3
I think the best solution is to have an independent update script, which is run by your program.
Then the update script needs to know the installation Path, the online-version and installed-version.
Then you compare them, if installed-version is lower than online-version, download the new files.
I think the best is to use an archive. Then you unpack it and after everything has been extracted,
the independent update script could use return code, to signal the main program not to start.

You'll find some examples if you look for "auto update script python".
QT is not required, you could do it with vanilla Python (no additional dependencies required)
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#4
Hmm Good! Answer Is Clear But Here The Problem Is How To Implement In Another Script If you have example plz share
My Approach to this Code:
information = { "__author__": "Harshil Pandey",
"__copyright__": "Copyright (C) 2020, Harshil Pandey",
"__credits__": "harshil Pandey",
"__license__": "The Apache-2.0 License",
"__version__": "1.0",
"__maintainer__": "Harshil Pandey",
"__email__": "[email protected]",
"__status__": "Stable"}

    def updating():
        local_version = float(information["__version__"])
        if local_version < data:
            print("Software Need TO Be Updated")
            requests.get('')
        else:
            print("Software Up-to Date")

    def update_using_manager():
        try:
            # -- Online Version File
            # -- Replace the url for your file online with the one below.
            global data
            response = requests.get(
                'https://raw.githubusercontent.com/Harshil783/QrCode_Tools_In_Python/master/version.txt')
            data = float(response.text.replace("__version__ = '","").replace("'",""))
            updating(data)
        except ConnectionError:
            print("SomeThing Went Wrong! Can Be Due To No Connection.")
Well I Have This thing in github And There Is Version.txt i retrieved but problem how to update i fetch all information but ho w to implement this to code Update The Source Code Of OutDated Python Source Code!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is it possible to update a CSS file from Python bigAL_python 4 2,197 Apr-20-2022, 01:38 PM
Last Post: bigAL_python
Question Python + Google Sheet | Best way to update specific cells in a single Update()? Vokofe 1 2,627 Dec-16-2020, 05:26 AM
Last Post: Vokofe
  XML update using python sathiyarajmca 1 2,055 Jun-18-2019, 06:11 PM
Last Post: Larz60+
  Python to update XML SubElement emersonivo 3 3,209 Aug-02-2018, 07:49 AM
Last Post: Larz60+
  Running a python tool transforming xml files into epub files silfer 7 5,313 May-10-2018, 03:49 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020