[Tutor] python launcher

Jan Karel Schreuder jan9447 at me.com
Mon Sep 1 20:14:14 CEST 2014


Until now I have used IDLE to write and run programs. I decided it was time to do it the hard way and use only a Terminal and a plain text editor, TextWrangler. I have Python 3.4.1 and OS 10.8.5. When I run the script by calling for the interpreter in the terminal with the script as the parameter (e.g. python3 shares.py), it runs fine. This is the output:

corrupt record.....removed
corrupt record.....removed
corrupt record.....removed
['description', 'symbol', 'current price', 'number of units']
			 List shares
			 Buy shares
			 Sell shares
			 Update prices
ridfx 21.98 833.592135342 18322.36
dodfx 46.99 390.964829507 18371.44
dfsvx 36.87 499.060771965 18400.37
pplix 15.42 1189.216568817 18337.72
total 73431.89

However, when I run it by using the Python Launcher, this is the result:

corrupt record.....removed
corrupt record.....removed
corrupt record.....removed
['description', 'symbol', 'current price', 'number of units']
('\t\t\t', 'List shares')
('\t\t\t', 'Buy shares')
('\t\t\t', 'Sell shares')
('\t\t\t', 'Update prices')
('ridfx', '21.98', '833.592135342', 18322.36)
('dodfx', '46.99', '390.964829507', 18371.44)
('pplix', '15.42', '1189.216568817', 18337.72)
('dfsvx', '36.87', '499.060771965', 18400.37)
('total', 73431.89)
Exit status: 0
logout

[Process completed]

Why the difference ? All the output was taken care of by the Print function.

Jan Schreuder


More information about the Tutor mailing list