![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programming Guru
![]() |
Keeping Your Publicly Released Programs Automatically Updated
Program: This will be run with Python once an update has or hasn't occured. Web Directory: The Update Instructions and Contents are here. Version Data: Contains a number with the current version number, in the same folder as the program and this file. Update Instuctions: Contains a number which if higer then the version number, will process all the listed files underneath to current working directory. Version Data: Update Instructions: 2 example_9.py Battle%20System.py Will ask if the user wants an update. Will copy all the files listed to the current working directory. Will execute main.py. I think it's a good idea at least. ![]() |
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
Yeh, nice script. Updates are pretty sweet.
Bear in mind using an except statement to except any error is really bad practice. Only except the errors you know that arise, or at least put in a print statement that will print the kind of exception that you received, the errno, and the traceback. |
|
|
|
|
|
#3 |
|
Programming Guru
![]() |
No the except is there in case they are not connected to the internet, or there is no update accessable at the given time. In which case it skips right to your program without worrying about an update.
|
|
|
|
|
|
#4 |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
Then you should except whatever error is thrown in the case of you not being connected to the internet or there being no update accessible at the given time.
|
|
|
|
|
|
#5 |
|
Programming Guru
![]() |
I did.
![]() |
|
|
|
|
|
#6 |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
No, you're catching every exception that may get thrown (KeyboardError, MemoryError, IOError, whatever).
How can I explain it... it's kind of like you doing: rm * rm *.txt *.rtf |
|
|
|
|
|
#7 |
|
Programming Guru
![]() |
Yes, I do indeed want to catch all those exceptions and go straight to the program.
![]() Basically I want every error caught and excepted to the main program. Everything except for the condition that an update may be there with a higher version number. |
|
|
|
|
|
#8 | |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
Quote:
I'm also a little confused why you have this: for a in range(len(x)):
try:x[a]=x[a].replace('\r','')
except:pass
try:x[a]=x[a].replace('\n','')
except:pass |
|
|
|
|
|
|
#9 |
|
Programming Guru
![]() |
In case there is no '\r' or '\n' ...
|
|
|
|
|
|
#10 |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
No exceptions are raised by replace. There'll just be no replacements.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|