Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; 'modify': 0.05; 'received:134': 0.05; 'result,': 0.05; 'sys': 0.05; '__name__': 0.07; 'main()': 0.07; 'python': 0.09; "'\\n')": 0.09; "'w')": 0.09; 'sep': 0.09; '~ethan~': 0.09; 'cc:addr:python- list': 0.10; 'def': 0.10; "'__main__':": 0.16; "'this": 0.16; '2.7.3': 0.16; '3.2,': 0.16; '3.3,': 0.16; 'main():': 0.16; 'pentium': 0.16; 'responded.': 0.16; 'runs.': 0.16; 'skip:i 120': 0.16; 'subject:3.3': 0.16; 'subject:Change': 0.16; 'underscore.': 0.16; 'string': 0.17; 'wrote:': 0.17; 'input': 0.18; 'code.': 0.20; 'versions': 0.20; 'bit': 0.21; 'import': 0.21; 'produces': 0.22; 'posted': 0.22; 'cc:2**0': 0.23; 'statement': 0.23; 'seems': 0.23; 'random': 0.24; 'cc:no real name:2**0': 0.24; 'linux': 0.24; 'machine': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'first,': 0.27; 'disk': 0.27; 'heading': 0.27; "doesn't": 0.28; 'skip:( 20': 0.28; 'initial': 0.28; 'run': 0.28; 'cpu': 0.29; 'second,': 0.29; 'skip:i 60': 0.29; 'that.': 0.30; 'code': 0.31; 'point': 0.31; "skip:' 20": 0.32; 'extract': 0.33; 'joined': 0.33; 'ram': 0.33; 'text': 0.34; 'doing': 0.35; 'pm,': 0.35; 'there': 0.35; 'compare': 0.36; 'subject:with': 0.36; 'test': 0.36; 'should': 0.36; 'being': 0.37; 'subject:: ': 0.38; 'skip:o 20': 0.38; 'some': 0.38; 'delete': 0.38; 'received:192': 0.39; 'received:192.168': 0.40; 'your': 0.60; 'free': 0.61; 'between': 0.63; 'url:%20': 0.63; 'more': 0.63; 'show': 0.63; 'url:%1': 0.68; 'increasing': 0.75; '6:11': 0.84; 'furman': 0.84; 'ethan': 0.91 Date: Sat, 23 Mar 2013 08:27:28 -0400 From: "Colin J. Williams" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 MIME-Version: 1.0 Newsgroups: comp.lang.python To: Ethan Furman Subject: Re: Change in Python 3.3 with the treatment of sys.argv References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-NCF-Filtered: By ProxSMTP on pallando Sat Mar 23 08:27:37 2013 -0400 (EDT) Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 74 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364041661 news.xs4all.nl 6929 [2001:888:2000:d::a6]:49299 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:41729 On 22/03/2013 6:11 PM, Ethan Furman wrote: > On 03/22/2013 02:57 PM, Colin J. Williams wrote: >> Below is an extract from some code to run on Python 2.7.3, 3.2.3 and >> 3.3.0 to compare speeds, both between versions and >> machines: >> >> if __name__ == '__main__': >> # Text string for initial test - Modify for your own machine or >> # delete it and and answer the input statement with your own machine >> # characteristics. >> sys.argv[1:]= ('Intel Pentium D CPU 3.0GHz 1.99 GB of RAM 221GB >> Disk Free space', ) >> main() >> >> >> def main(): >> if len(sys.argv) > 1: >> idMachine= ' '.join(sys.argv[1:]) >> ... >> oFile= open('FP' + now + '.log', 'w') >> oFile.writelines(idM + '\n' + sys.version + '\n') >> >> For 2.7, the result is: >> Intel_Pentium_D_CPU_3.0GHz_1.99_GB_of_RAM_221GB_Disk_Free_space >> 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] >> >> for 3.2, the result is: >> Intel_Pentium_D_CPU_3.0GHz_1.99_GB_of_RAM_221GB_Disk_Free_space >> 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] >> >> For 3.3, the result is: >> I_n_t_e_l___P_e_n_t_i_u_m___D___C_P_U___3_._0_G_H_z___1_._9_9___G_B___o_f___R_A_M___2_2_1_G_B___D_i_s_k___F_r_e_e___s_p_a_c_e >> >> >> 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit >> (Intel)] >> >> The full test result, for random matrices of increasing order is >> available >> here(http://web.ncf.ca/cjw/FP%20Summary%20over%20273-323-330.txt) > > First, this is what I get with 3.3: > > Python 3.3.0 (default, Sep 29 2012, 17:14:58) > [GCC 4.7.2] on linux > Type "help", "copyright", "credits" or "license" for more information. > --> import sys > --> sys.argv > [''] > --> sys.argv[1:] = ('this is a test!', ) > --> sys.argv > ['', 'this is a test!'] > --> ' '.join(sys.argv[1:]) > 'this is a test!' > > > Second, your code doesn't show being joined by an underscore. > > -- > ~Ethan~ APOLOGIES to those who responded. It seems that a change was made in the program between the 3.3 run and the other runs. Each produces the same heading now. Yes, I should have posted the test code. But, in these circumstances, there is no point in doing that. Colin W. Colin W.