[Tutor] Fwd: Problem reading large files in binary mode

2014-06-12 Thread Mirage Web Studio
Hello I am new to python programming. while trying it out i find that in my code file io.read is not reading large files particularly over 1 gb. my code is posted below. i am working on python 3.3 on windows with ntfs partition and intel corei3 ram 3gb. the execution always stops saying error

[Tutor] How can I let the Python Console display more decimal precision?

2014-06-12 Thread Marino David
Hi All: I am a newbie at the Python. I type "26/12" in Python Console and get result of "2". It is obvious that the corresponding result should be 2... I don't know why the Console only returns the integer part of true result. Anyone can help me out? Thanks David _

[Tutor] MIT - Free Python course started today

2014-06-12 Thread Mario Py
Sort of off topic, (don't kill me) but then again very useful for beginners! MIT started free Python course today: https://www.edx.org/course/mitx/mitx-6-00-1x-introduction-computer-1841 Unfortunately they are using Python 2.7 :-( You can even get a certificate if you finish with high enough sc

Re: [Tutor] A couple newbie questions about Python

2014-06-12 Thread Deb Wyatt
Thanks very much Alan. As for the my concern about inaccuracy in float math, I suppose I am concerned because I was not aware of the issue before, and I wonder how you deal with such things when you need accuracy for financial things. Deb in WA, USA > -Original Message- > From: alan

[Tutor] AttributeError: 'module' object has no attribute 'start'

2014-06-12 Thread jason sam
Hi All, I am new to wxPython.I have made a simple GUI that contains a button and by pressing that button i am calling another .py file(top_block.py)...But i am getting error using the command: top_block.start() The error is: AttributeError: 'module' object has no attribute 'start' The code is a

Re: [Tutor] A couple newbie questions about Python

2014-06-12 Thread ALAN GAULD
I wonder how you deal with such things when you need accuracy for financial things. Financial applications traditionally work in the lowest unit of currency and use integers. For display purposes they convert the pennies into dollars/cents or pounds/pence or whatever.   Alan Gauld Author of the

Re: [Tutor] How can I let the Python Console display more decimal precision?

2014-06-12 Thread Lukas Nemec
Hi, from the question you're using python 2.x you can do either: 26.0/12 (float divide by int - it retypes both to floats and gets you 2.) or at the beginning do: from __future__ import division That will activate python3 way of dividing - which gives you 2. Lukas. On 06/12/2014 02:

Re: [Tutor] Fwd: Problem reading large files in binary mode

2014-06-12 Thread Peter Otten
Mirage Web Studio wrote: > I am new to python programming. while trying it out i find that in my > code file io.read is not reading large files particularly over 1 gb. my > code is posted below. i am working on python 3.3 on windows with ntfs > partition and intel corei3 ram 3gb. the execution a

Re: [Tutor] A couple newbie questions about Python

2014-06-12 Thread Mark Lawrence
Please don't top post, it makes following a long thread extremely difficult, thanks. On 12/06/2014 03:47, Deb Wyatt wrote: Thanks very much Alan. As for the my concern about inaccuracy in float math, I suppose I am concerned because I was not aware of the issue before, and I wonder how you

Re: [Tutor] MIT - Free Python course started today

2014-06-12 Thread Volodymyr Samodid
Thanks a lot. On 06/12/2014 01:42 AM, Mario Py wrote: Sort of off topic, (don't kill me) but then again very useful for beginners! MIT started free Python course today: https://www.edx.org/course/mitx/mitx-6-00-1x-introduction-computer-1841 Unfortunately they are using Python 2.7 :-( You can

Re: [Tutor] MIT - Free Python course started today

2014-06-12 Thread Dotan Cohen
On Thu, Jun 12, 2014 at 1:42 AM, Mario Py wrote: > Sort of off topic, (don't kill me) but then again very useful for beginners! > > MIT started free Python course today: > > https://www.edx.org/course/mitx/mitx-6-00-1x-introduction-computer-1841 > > Unfortunately they are using Python 2.7 :-( > Yo

Re: [Tutor] A couple newbie questions about Python

2014-06-12 Thread eryksun
On Thu, Jun 12, 2014 at 1:27 AM, Alex Kleider wrote: > On 2014-06-11 20:08, Dave Angel wrote: > >> I learned programming in 1967 with Fortran, and McCracken spent a >> chapter warning about that same thing. Probably everything he >> warned about still applies to Python and modern computers. > > A

Re: [Tutor] AttributeError: 'module' object has no attribute 'start'

2014-06-12 Thread Walter Prins
Hi, On 12 June 2014 05:51, jason sam wrote: > > Hi All, > I am new to wxPython.I have made a simple GUI that contains a button and by > pressing that button i am calling another .py file(top_block.py)...But i am > getting error using the command: > > top_block.start() > > The error is: > > Attr

Re: [Tutor] AttributeError: 'module' object has no attribute 'start'

2014-06-12 Thread Steven D'Aprano
On Thu, Jun 12, 2014 at 11:41:58AM +0100, Walter Prins wrote: > (What made you think that modules have a magic method > start() that causes them to run?) You should probably learn more > about Python itself, name binding, module objects etc. That's what this list is for! -- Steven

Re: [Tutor] How can I let the Python Console display more decimal precision?

2014-06-12 Thread Steven D'Aprano
On Thu, Jun 12, 2014 at 08:48:25AM +0800, Marino David wrote: > Hi All: > > I am a newbie at the Python. > > I type "26/12" in Python Console and get result of "2". > > It is obvious that the corresponding result should be 2... I don't > know why the Console only returns the integer part

Re: [Tutor] A couple newbie questions about Python

2014-06-12 Thread Alan Gauld
On 12/06/14 09:18, Mark Lawrence wrote: Besides Alan's previous statement about using integers you can also use things like Python's decimal module see https://docs.python.org/3/library/decimal.html#module-decimal Although Decimal doesn't solve the issue of rounding errors for financial calcul

Re: [Tutor] AttributeError: 'module' object has no attribute 'start'

2014-06-12 Thread Alan Gauld
On 12/06/14 05:51, jason sam wrote: Hi All, I am new to wxPython.I have made a simple GUI that contains a button and by pressing that button i am calling another .py file(top_block.py)... No you are not. You are importing it and then trying to access something called start which doesn't exist.

Re: [Tutor] AttributeError: 'module' object has no attribute 'start'

2014-06-12 Thread Mark Lawrence
On 12/06/2014 05:51, jason sam wrote: Hi All, I am new to wxPython.I have made a simple GUI that contains a button and by pressing that button i am calling another .py file(top_block.py)...But i am getting error using the command: top_block.start() The error is: AttributeError: 'module' object

Re: [Tutor] AttributeError: 'module' object has no attribute 'start'

2014-06-12 Thread Steven D'Aprano
On Thu, Jun 12, 2014 at 05:47:23PM +0100, Mark Lawrence wrote: > I suspect that you'll get better answers on the wxpython list, > especially consdiering that you asked there all of two minutes before > asking here. This is not aimed specifically at Mark. Can we please stop chastising people fo

Re: [Tutor] AttributeError: 'module' object has no attribute 'start'

2014-06-12 Thread Walter Prins
On 12 June 2014 13:11, Steven D'Aprano wrote: > On Thu, Jun 12, 2014 at 11:41:58AM +0100, Walter Prins wrote: > >> (What made you think that modules have a magic method >> start() that causes them to run?) You should probably learn more >> about Python itself, name binding, module objects etc. >

Re: [Tutor] code review

2014-06-12 Thread Cameron Simpson
On 12Jun2014 00:38, Alan Gauld wrote: On 11/06/14 11:43, Adam Gold wrote: # create snapshot names like the following: 2014-06-10T01-00-01.vm1.img.bz2 for i in vgxenList: DATE = datetime.datetime.now().strftime("%Y-%m-%d" + "T" + "%H-%M-%S") Why use addition? You could just insett the lite

Re: [Tutor] code review

2014-06-12 Thread Cameron Simpson
On 13Jun2014 12:28, Cameron Simpson wrote: snap_path = os.path.join(VXGEN_DIR, snapName) backupList.append(snap_name) Sorry, "snap_path" in both lines:-( Cheers, Cameron Simpson ___ Tutor maillist - Tutor@python.org To unsubscribe or change sub