{"id":1620,"date":"2021-09-05T15:42:05","date_gmt":"2021-09-05T15:42:05","guid":{"rendered":"https:\/\/blog.colinjones.co.uk\/?p=1620"},"modified":"2021-09-05T15:42:44","modified_gmt":"2021-09-05T15:42:44","slug":"upgrading-my-9-year-old-code","status":"publish","type":"post","link":"https:\/\/blog.colinjones.co.uk\/index.php\/2021\/09\/05\/upgrading-my-9-year-old-code\/","title":{"rendered":"Updating My 9 Year Old Code"},"content":{"rendered":"\n<p><strong>Warning, lots of geeky words in this article!<\/strong><\/p>\n\n\n\n<p>New links for the next few months at work have been published. I tidy up the spreadsheets and make them available to all drivers at the depot. <br>I then port the sheet to my custom sheet so I can use my Python program to convert csv to iCal for import into my calendar.<\/p>\n\n\n\n<p><br>This time I decided to create a template for customised dated sheets for all, and to convert my program to a Windows executable. This is were the problems started.<\/p>\n\n\n\n<p><br>I installed Python in Windows (easy). Then I tried to install PyQt4 (the UI framework) that my 9 year old code uses.<br>It&#8217;s deprecated.<br>No install candidate for any version of Python I can get for Windows.<br>So I try to use PyQt5 instead.<br><br><strong>WHAT A FUCKING NIGHTMARE!<\/strong><\/p>\n\n\n\n<p>About 80% of the library calls have changed!(edited)<br>Most were simple, change from QtGui to QtWidgets.<br>One was dropped completely (softkey).<br>The last one was the file request. It used to return a single string, now it returns a list!<br>This means the variable is now the wrong type, but actually quite simple to fix, just use variable[0] instead of just variable. I did manage to get all that done and get the program running in native Python. Quite pleased with that.<\/p>\n\n\n\n<p>Then converted the program.<br>It does work, but\u2026<br>\u2026because it&#8217;s unsigned, Microsoft Defender doesn&#8217;t like it, and you have to jump through hoops to get it to run!<br><\/p>\n\n\n\n<p>Fucking Windows! XD<br>So much easier to just use Python directly, even in Windows!<br>I wanted to make it as simple as possible but as simple as possible still requires some decent computer aptitude! Ah well \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Warning, lots of geeky words in this article! New links for the next few months at work have been published. I tidy up the spreadsheets and make them available to all drivers at the depot. I then port the sheet &hellip; <a href=\"https:\/\/blog.colinjones.co.uk\/index.php\/2021\/09\/05\/upgrading-my-9-year-old-code\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,6],"tags":[],"class_list":["post-1620","post","type-post","status-publish","format-standard","hentry","category-general","category-work"],"_links":{"self":[{"href":"https:\/\/blog.colinjones.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/1620","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.colinjones.co.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.colinjones.co.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.colinjones.co.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.colinjones.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=1620"}],"version-history":[{"count":2,"href":"https:\/\/blog.colinjones.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/1620\/revisions"}],"predecessor-version":[{"id":1622,"href":"https:\/\/blog.colinjones.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/1620\/revisions\/1622"}],"wp:attachment":[{"href":"https:\/\/blog.colinjones.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=1620"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.colinjones.co.uk\/index.php\/wp-json\/wp\/v2\/categories?post=1620"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.colinjones.co.uk\/index.php\/wp-json\/wp\/v2\/tags?post=1620"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}