Re: Quick help for a python newby, please

2016-11-23 Thread Wildman via Python-list
On Thu, 24 Nov 2016 14:49:27 +1100, Chris Angelico wrote: > On Thu, Nov 24, 2016 at 2:41 PM, Wildman via Python-list > wrote: >> Point taken. I did miss the python3 part. >> >> I switched to raw_input because it handles an empty >> input. An empty input would trigger the ValueError. >> No doubt

Re: Quick help for a python newby, please

2016-11-23 Thread Chris Angelico
On Thu, Nov 24, 2016 at 2:41 PM, Wildman via Python-list wrote: > Point taken. I did miss the python3 part. > > I switched to raw_input because it handles an empty > input. An empty input would trigger the ValueError. > No doubt with the correct code the same or similar > could be done with inpu

Re: Quick help for a python newby, please

2016-11-23 Thread Wildman via Python-list
On Thu, 24 Nov 2016 11:59:17 +1100, Chris Angelico wrote: > On Thu, Nov 24, 2016 at 10:02 AM, Wildman via Python-list > wrote: >> Try the code that is below: >> >> import datetime >> from datetime import date >> >> today = date.today() >> person = input("Enter your name: ") >> byear = raw_input("

Re: Quick help for a python newby, please

2016-11-23 Thread Chris Angelico
On Thu, Nov 24, 2016 at 10:02 AM, Wildman via Python-list wrote: > Try the code that is below: > > import datetime > from datetime import date > > today = date.today() > person = input("Enter your name: ") > byear = raw_input("Enter the four-digit year you were born: ") Please take care of Python

Re: Quick help for a python newby, please

2016-11-23 Thread Wildman via Python-list
On Wed, 23 Nov 2016 06:18:38 -0800, jones.dayton wrote: > I'm just learning, so please excuse my ignorance for > what I know is a simple issue... > > I'm writing a "Hello, World" type of script to see how > things work in python3. I'm asking for input to get a > person's birthday, then I want to

Re: Quick help for a python newby, please

2016-11-23 Thread justin walters
On Wed, Nov 23, 2016 at 7:13 AM, Dayton Jones wrote: > ah...yes, but then how could I strip the rest (h:m:s) from it? > > Enter the numerical month you were born: 3 > Enter the numerical day of the month you were born: 30 > Enter the year you were born: 1989 > 10100 days, 0:00:00 > -- > https://m

Re: Quick help for a python newby, please

2016-11-23 Thread Dayton Jones
Ah, perfect - thanks. I was overly complicating things. -- https://mail.python.org/mailman/listinfo/python-list

Re: Quick help for a python newby, please

2016-11-23 Thread Anssi Saari
jones.day...@gmail.com writes: > but how do I replace the "2008, 8, 18" and "2008, 9, 26" with *my* values? > I've tried several things (which I can't remember all of) but usually end up > with an error like this: Something like this? today = date.today() birthday = date(byear, bmonth, bday)

Re: Quick help for a python newby, please

2016-11-23 Thread Dayton Jones
ah...yes, but then how could I strip the rest (h:m:s) from it? Enter the numerical month you were born: 3 Enter the numerical day of the month you were born: 30 Enter the year you were born: 1989 10100 days, 0:00:00 -- https://mail.python.org/mailman/listinfo/python-list

Re: Quick help for a python newby, please

2016-11-23 Thread Thomas Nyberg
On 11/23/2016 09:18 AM, jones.day...@gmail.com wrote: but how do I replace the "2008, 8, 18" and "2008, 9, 26" with *my* values? I've tried several things (which I can't remember all of) but usually end up with an error like this: Does this not work for you? d = date(byear, bmonth,

Quick help for a python newby, please

2016-11-23 Thread jones . dayton
I'm just learning, so please excuse my ignorance for what I know is a simple issue... I'm writing a "Hello, World" type of script to see how things work in python3. I'm asking for input to get a person's birthday, then I want to compare that to "today" and see how many days have past. --code-

Re: Quick Help

2014-02-15 Thread Cameron Simpson
On 15Feb2014 07:27, kjaku...@gmail.com wrote: > Just need a bit of help understanding this so I can actually start it. > > The input to a program will come from a file called "asdf.in". This file will > have all the info needed for the course. The formatting of the input file is > described as

Re: Quick Help

2014-02-15 Thread Gary Herron
On 02/15/2014 07:27 AM, kjaku...@gmail.com wrote: Just need a bit of help understanding this so I can actually start it. The input to a program will come from a file called "asdf.in". This file will have all the info needed for the course. The formatting of the input file is described as follow

Quick Help

2014-02-15 Thread kjakupak
Just need a bit of help understanding this so I can actually start it. The input to a program will come from a file called "asdf.in". This file will have all the info needed for the course. The formatting of the input file is described as follows, with denoting # of white spaces and denoting

Re: Quick help needed: how to format an integer ?

2005-10-05 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > "10001234" -> ""10.001.234"" > So I need thousand separators. > Can anyone helps me with a simply solution (like %xxx) ? I think you're supposed to do a locale-specific conversion (I've never understood that stuff). You could also do something lik

Re: Quick help needed: how to format an integer ?

2005-10-05 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi ! > > I need to convert some integer values. > > "1622" ->"1 622" > > or > > "10001234" -> ""10.001.234"" > > So I need thousand separators. > > Can anyone helps me with a simply solution (like %xxx) ? The module locale does what you need, look at ist docs, espe

Re: Quick help needed: how to format an integer ?

2005-10-05 Thread Satchidanand Haridas
One possible solution. Don't know how efficient it is though. :-) >>> def put_decimal(s): ... return ''.join( [ [s[i], '.%s' % s[i]][(len(s)-i)%3 == 0] for i in range(0, len(s))]) ... >>> put_decimal("10001234") '10.001.234' >>> put_decimal("12622") '12.622' thanks, Satchit [EMAIL PROTE

Quick help needed: how to format an integer ?

2005-10-05 Thread [EMAIL PROTECTED]
Hi ! I need to convert some integer values. "1622" ->"1 622" or "10001234" -> ""10.001.234"" So I need thousand separators. Can anyone helps me with a simply solution (like %xxx) ? Thanx for it: dd Ps: Now I use this proc: def toths(i): s=str(i) l=[] ls=len(s) for i in rang