If you're writing code in Python 2 (2.7.x) ... and want an easy port to Python 3
a) Use the format method in all your prints - example (
[here]
b) Use // if you're dividing and want an integer result
c) Wrap standard functions that you need to return a list in
list( through
)
d) used
sorted in preference to
sort
e) Inherit lowest base classes from
object even though not needed in Python 3
f) test the code in Python 3 occasionally ... at a
unit test level even if not the whole application!
(written 2016-11-06)
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
Z300 - Politics and Religion [216] Cheap purchase - votes paid for with selfish promises - (2005-02-15)
[257] Politics gets nasty. Must be an election coming up. - (2005-03-25)
[280] Spotted - the local MP - (2005-04-15)
[289] MP for Devizes, Wiltshire - (2005-04-23)
[301] General Election day, UK - (2005-05-05)
[313] Making bona fide international marriages more difficult - (2005-05-16)
[326] UK Tax payment totals and where the money is spent - (2005-05-27)
[335] Sad priorities - (2005-06-03)
[377] A Strengthened City - (2005-07-14)
[384] Managing conflict and disappointment - (2005-07-20)
[415] Campaign Drift and efficiency. - (2005-08-15)
[469] Yesterday was Kiss and Ride - (2005-10-19)
[505] Would you steal ... petrol? ... a training course? - (2005-11-26)
[539] rich and famous - (2005-12-23)
[602] MP face to face - (2006-02-12)
[607] On being British - (2006-02-14)
[671] Both ends of the animal - (2006-04-05)
[674] Wiltshire to get an extra MP - (2006-04-07)
[682] Iran has enriched uranium ... - (2006-04-12)
[696] Is than an uphill or downhill task? - (2006-04-23)
[750] Almost everyone loses - (2006-06-07)
[780] Separation and Integration - (2006-06-27)
[875] Wilfred Emmanuel-Jones - (2006-09-22)
[967] Realistic on line shoot'em up - (2006-12-05)
[1003] Room at the Inn, Guy at the station - (2006-12-21)
[1060] What a relief from the tax office. - (2007-02-01)
[1109] False imprisonment - a contrast from the news - (2007-03-15)
[1135] Government pressure on me to shut up after I make the papers - (2007-04-05)
[1175] Local elections - choosing who to vote for - (2007-05-03)
[1247] An afternoon at a public enquiry - (2007-06-27)
[1260] An inspirational business talk from one of our prospective MPs - (2007-07-06)
[1350] FSB (Federation of Small Businesses) Western Region - (2007-09-13)
[1386] New software product for warmblooded programmers - (2007-10-10)
[1428] Travel Across Wiltshire - the game - (2007-11-11)
[1526] Carers at work - court case changes - (2008-02-01)
[1573] Budget tax increases hit vehicle market - (2008-03-14)
[1579] Rome, and the faith of Rome - (2008-03-17)
[1729] Back from the future - (2008-07-30)
[1769] July child ponders on August children - (2008-08-23)
[1872] Barack Obama wins US Predidency - (2008-11-05)
[1881] Wiltshire Council says - part 1 - (2008-11-13)
[1882] Wiltshire Council says - part 2 - (2008-11-14)
[1987] One Cheer for Local Democracy - Asda in Melksham - (2009-01-11)
[2012] The Wiltshire Police - (2009-01-29)
[2028] Things people say on the phone - (2009-02-06)
[2075] Supporting Parkinsons and Trains - (2009-03-11)
[2178] Melksham Candidates for Wiltshire Unitary Election - (2009-05-12)
[2206] Spot the odd one out - (2009-05-29)
[2257] Ramblings on church and state linkage in Melksham - (2009-06-25)
[2270] Wiltshire - a chance to improve life for everybody - (2009-07-05)
[2279] Understanding the new local government structure in Wiltshire - (2009-07-11)
[2288] Wiltshire Community Area Partnerships - (2009-07-15)
[2353] All change - Wiltshire Parliamentary - (2009-08-13)
[2640] How is your tax pound spent? - (2010-02-18)
[2689] Can my dog eat potatoes? Doggie Dietary Research, and political sleaze! - (2010-03-23)
[2712] A more informed decision than ever before - (2010-04-08)
[2740] Melksham Hustings at George Ward School - (2010-04-26)
[2752] Voting day - UK General Election - (2010-05-06)
[2757] Bodicea, Lincoln, and our new MP - (2010-05-09)
[2792] Should Government compete with private industry? - (2010-06-03)
[2824] A pint of Black Rat, and a lazy barman - (2010-06-25)
[2856] Two sides of the coin - (2010-07-06)
[2864] Changing with weather and seasons - (2010-07-10)
[2870] Old prices - what would the equivalent price have been in 1966? - (2010-07-14)
[2948] Melksham shamefully makes the national headlines - (2010-09-07)
[2971] Should the public sector compete with businesses? and other deep questions - (2010-09-26)
[3051] Positively reforming the system - could it be done? - (2010-11-14)
[3264] Alternative Vote (AV) - explaining and an example - (2011-04-25)
[3313] What does our MP do on a Bank Holiday? - (2011-05-30)
[3323] Is Melksham town centre dying? - (2011-06-11)
[3325] The Olympic Torch, and Melksham House - (2011-06-14)
[3438] Melksham to become a part of Trowbridge? - (2011-09-13)
[3592] Are we one man, one vote? No, and we never have been. - (2012-01-26)
[3676] Rising prices, changing habits and society - (2012-03-31)
[3806] 2011 Census results - initial figures for Wiltshire. - (2012-07-17)
[3845] Good cause giving - getting the charity beggars off the street - (2012-08-21)
[3905] How should we choose our Wiltshire Police and Crime Commissioner? - (2012-10-27)
[3921] On rememberance, on war, and on preventing the war cycle - (2012-11-11)
[4079] Melksham Area - Unitary Council results, May 2013 - (2013-05-04)
[4223] Democracy - alive and well with the beauty pagent starting up again - (2013-12-16)
[4275] Eurpoean Elections, and other elections ahead. Some thoughts on campaigns and policies - (2014-05-08)
[4286] Reaction in Radstock to new First bus prices - (2014-07-12)
[4343] Politics and the railway the connects Wiltshire - (2014-12-06)
[4354] Wiltshire Police - assuming someone is guilty just on the say-so of a member of the public? - (2014-12-16)
[4476] Upcoming election - Chippenham Constituency - the major candidates compared - (2015-04-29)
[4485] Misusing statistics? - the seedy side of election campaigning - (2015-05-04)
[4489] Election results - what if we had a party list system? - (2015-05-08)
[4548] Melksham - two small townships, or one big one? - (2015-10-22)
[4597] Not standing as your local councillor - (2015-12-18)
[4614] PC Plod - alive and scaremongering in Wiltshire? - (2016-01-04)
[4625] Where does Wiltshire bus subsidy money come from? - (2016-01-19)
[4720] Celebrating our diversity rather than discriminating for it - (2016-11-02)
[4729] The oldest part of Los Angeles - (2016-11-23)
[4734] Thoughts on the new Blackmore Ward of Melksham Without Parish - (2017-02-22)
[4735] Revisiting - should I stand for Melksham Without Parish Council in May? - (2017-02-24)
Some other Articles
Visiting Los Alamitos Bay Yacht ClubLearning from travelling further afieldTransWilts Partner Update for Melksham Area BoardWriting Python 2 such that Python 3 is easyFrom and Import in Python - where is the module loaded from?Conditional operators in PythonEmbedding more complex code into a named blockWhen to check an object type - Python isinstance example