Re: [Tutor] Need some help on output

2011-03-04 Thread Gaurav Malhotra
I am beginner...I want to know best book to start with when it comes with python programming ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Need some help on output

2011-03-04 Thread David Hutto
That depends on what your motivation is for learning python. I'd start with a few hello world tutorial online. like print "hello world"/ python 3.0 print("hello world"), and on that not, decide on the version you want to use on your system first. ___ Tuto

Re: [Tutor] How to extract data from text to excel?

2011-03-04 Thread tee chwee liong
bug in the previous code so the final code should be: import xlwt """Reads robert.txt This is the final script that writes by incrementing each row but maintain one column""" # Create workbook and worksheet wbk = xlwt.Workbook() sheet = wbk.add_sheet('python') row = 0 # row counter f = ope

[Tutor] Book Request [Was: Re: Need some help on output]

2011-03-04 Thread Alan Gauld
"Gaurav Malhotra" wrote I am beginner... Welcome. But when posting messages please start a new thread do not use an existing one. Otherwise your message is likely to be missed by anyone not reading the previous subject. I want to know best book to start with when it

Re: [Tutor] Help! (solution)

2011-03-04 Thread michael scott
I know that the question has long been answered (and probably due today), but I solved it and it was great exercise for me (as I'm not in college at the moment and I need assignments like these to gauge my skills). I'll probably build a gui for it tomorrow, just so I can practice at that. I wis

[Tutor] Fwd: Re: Help! (solution)

2011-03-04 Thread Wolf Halton
Put the timing code for one itemt in a while loop and have the variable for elapsed time incremented by the amount of time the fabricator has to cool every time the modulus of the loop counter / 127 is 0 AND the count is above 0. production = 0 time = 127 # seconds timer = 0 rest = 313 run = input

[Tutor] Help - want to display a number with two decimal places

2011-03-04 Thread lea-parker
HelloI have created the following code but would like the program to include two decimal places in the amounts displayed to the user. How can I add this?My code:# Ask user to enter purchase pricepurchasePrice = input ('Enter purchase amount and then press the enter key $') # Tax ratesstateTaxRate =

[Tutor] Shared web host and setting the python environment...

2011-03-04 Thread Modulok
List, Background: I'm on a linux based shared web host. They cater to PHP, not python. (There's no third party python modules even installed!) So I installed a virtual python in my home directory, plus easy_install and a bunch of modules. Great! The Problem: Unfortunately, the web server uses the

Re: [Tutor] Help - want to display a number with two decimal places

2011-03-04 Thread Modulok
On 3/4/11, lea-par...@bigpond.com wrote: > Hello > > I have created the following code but would like the program to include two > decimal places in the amounts displayed to the user. How can I add this? > > My code: > > > # Ask user to enter purchase price > purchasePrice = input ('Enter purchase

[Tutor] Error while using calendar module in Python 2.7

2011-03-04 Thread ranjan das
I ran the following code in python 2.6 and then in python 2.7 (using calendar module) to manipulate dates and times The following code works fine in Python 2.6 but throws up an error in Python 2.7. Can anyone please say why? CODE: import datetime import calendar while monday.weekday() != cal

Re: [Tutor] Error while using calendar module in Python 2.7

2011-03-04 Thread David Hutto
Could you paste the whle code, because I get: >>> import datetime >>> import calendar >>> >>> >>> >>> while monday.weekday() != calendar.MONDAY: ... File "", line 2 ^ IndentationError: expected an indented block >>> monday -= oneday File "", line 1 monday -= oneday ^ Indentati

Re: [Tutor] Error while using calendar module in Python 2.7

2011-03-04 Thread David Hutto
>>> >>> while monday.weekday() != calendar.MONDAY: ... monday -= oneday ... oneweek = datetime.timedelta(days=7) ... nextweek = today + oneweek ... print "next week" ... Traceback (most recent call last): File "", line 1, in NameError: name 'monday' is not defined >>> This means

Re: [Tutor] Error while using calendar module in Python 2.7

2011-03-04 Thread ranjan das
Sorry David The correctly indented code with the while loop is while friday.weekday() != calendar.MONDAY: MONDAY -= oneday oneweek = datetime.timedelta(days=7) nextweek = today + oneweek nextyear = today.replace(year=today.year+1) print "Today (year-month-day) =", today print "Most r

Re: [Tutor] Error while using calendar module in Python 2.7

2011-03-04 Thread ranjan das
Please consider this corrected example The correctly indented code with the while loop is while monday.weekday() != calendar.MONDAY: MONDAY -= oneday oneweek = datetime.timedelta(days=7) nextweek = today + oneweek nextyear = today.replace(year=today.year+1) print "Today (year-month