Re: [Tutor] Hoping to benefit from someone's experience...

2008-04-17 Thread linuxian iandsd
just a thought ... there must be some way of using OpenOffice to convert your ORIGINAL word documents into HTML files ... then as html is a very nice & structured language that you can manipulate & modify with ease just by adding some tags inside where you want or wish this is also only if yo

[Tutor] HELP!!!!!

2008-04-17 Thread Michael Kim
Hi I am having a really hard time making my tictactoe program work. I was wondering if you could could check it out and help me with the error. Thanks blank = " " def asknumber(question, low, high): response = None while response not in range(low, high): response = int(raw_

Re: [Tutor] Nested dictionary with defaultdict

2008-04-17 Thread Kent Johnson
Kepala Pening wrote: > count = lambda x: [{y: x.count(y)} for y in set(x)] At least for long enough lists, this is likely to be more expensive than the approach using defaultdict. Your count() function iterates the list (1+m) times, where m is the number of distinct words - once to create the s

Re: [Tutor] HELP!!!!!

2008-04-17 Thread Kent Johnson
Michael Kim wrote: > Hi I am having a really hard time making my tictactoe program work. I > was wondering if you could could check it out and help me with the > error. Thanks What is the error? Kent ___ Tutor maillist - Tutor@python.org http://ma

Re: [Tutor] datetime module problem

2008-04-17 Thread Dick Moores
At 04:31 PM 4/15/2008, Dick Moores wrote: At 02:37 PM 4/15/2008, Kent Johnson wrote: >Dick Moores wrote: >>I'm really struggling with the datetime module. Trying for a script >>that will calculate the number of days between any two dates > >How about this: > >from datetime import datetime >date1

[Tutor] python assignments

2008-04-17 Thread Bala subramanian
Dear friends, I covered few introductory books on python. B4 going for an advanced book, i want to take up small, small assignments and try to solve with python. Can someone please suggest me any url where i can have assignments and solutions. Thanks, Bala

Re: [Tutor] datetime module problem

2008-04-17 Thread Kent Johnson
Dick Moores wrote: > from datetime import datetime > > print "Enter 2 dates, first the earlier date, then the later date." > def getDate(): > date = raw_input("Enter date as month/day/year, or enter nothing for > today: ") > if date == "": > date = datetime.now() > print

Re: [Tutor] python assignments

2008-04-17 Thread Kent Johnson
Bala subramanian wrote: > Dear friends, > > I covered few introductory books on python. B4 going for an advanced > book, i want to take up small, small assignments and try to solve with > python. Can someone please suggest me any url where i can have > assignments and solutions. Here are some

Re: [Tutor] datetime module problem

2008-04-17 Thread Dick Moores
At 05:10 AM 4/17/2008, Kent Johnson wrote: >Dick Moores wrote: > >>from datetime import datetime >>print "Enter 2 dates, first the earlier date, then the later date." >>def getDate(): >> date = raw_input("Enter date as month/day/year, or enter >> nothing for today: ") >> if date == "": >>

Re: [Tutor] python assignments

2008-04-17 Thread linuxian iandsd
http://www.pythonchallenge.com/ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] datetime module problem

2008-04-17 Thread Kent Johnson
Dick Moores wrote: >> You could either create n with hours=minutes=0, or round the >> difference up to the next whole number of days. > > I have no idea how to implement either of > your suggestions as to how to eliminate it. Could you please spell > them both out? 1. In [17]: n=datetime.tod

Re: [Tutor] Error with incorrect encoding

2008-04-17 Thread linuxian iandsd
Kent was right, >>> print u'\xae'.encode('utf-8') > (R) > but i think you are using the wrong source file, i mean don't copy & paste it from your browsers 'VIEW SOURCE' button. use python native urllib to get the file. ___ Tutor maillist - Tutor@pyth

Re: [Tutor] input and output files from terminal

2008-04-17 Thread Brain Stormer
Actually, Let me take that back with the raw_input comment since it is not the idle issue but I didn't want to the program to be interactive so I didn't want to wait for someone to put the information and press enter. Thanks for the file direction method but how do I get the names of the files so I

[Tutor] Best practice for installing new packages (eggs)

2008-04-17 Thread python
I would like to take a look at the wxOptParse package. This is my first time installing a package (vs. a module) so I'm looking for feedback on what installation technique I should use and where (in terms of folder paths) one would normally install 3rd party packages. For example, is are there conv

Re: [Tutor] HELP!!!!!

2008-04-17 Thread bob gailer
Michael Kim wrote: > Hi I am having a really hard time making my tictactoe program work. I > was wondering if you could could check it out and help me with the > error. Thanks > As Kent pointed out, we need to see the error you are getting in order to help. That usually shows up as a trace

Re: [Tutor] HELP!!!!!

2008-04-17 Thread Chris Calloway
On 4/17/2008 3:40 AM, Michael Kim wrote: > Hi I am having a really hard time making my tictactoe program work. I > was wondering if you could could check it out and help me with the > error. Thanks Heh. First, there are two obvious indentation errors you can find yourself. This may be a bypr

Re: [Tutor] input and output files from terminal

2008-04-17 Thread Alan Gauld
"Brain Stormer" <[EMAIL PROTECTED]> wrote > Thanks for the file direction method but how do I get the names of > the files > so I can use it inside my program. I'm not sure I understand. Thepoint of using redirection is that your code doesn't need to know anything about the files, it just read

Re: [Tutor] Error with incorrect encoding

2008-04-17 Thread Alan Gauld
I don't know the cause of the error here but I will say that parsing HTML with regular expressions is fraught with difficulty unless you know that the HTML will be suitably formatted in advance. You may be better off using one of the HTML parsing modules such as HTMLParser or even the more powerfu

Re: [Tutor] HELP!!!!!

2008-04-17 Thread Alan Gauld
"Michael Kim" <[EMAIL PROTECTED]> wrote > Hi I am having a really hard time making my tictactoe program work. > I > was wondering if you could could check it out and help me with the > error. Thanks Like to give us a clue as to what the error is? And include the error message if there is one p

Re: [Tutor] python assignments

2008-04-17 Thread Alan Gauld
"Bala subramanian" <[EMAIL PROTECTED]> wrote > someone please suggest me any url where i can have assignments and > solutions. The old Useless Python website had a whole bundle of these. And of course you should try the Python Challenge web game. Alan G

Re: [Tutor] python assignments

2008-04-17 Thread Dick Moores
At 04:42 AM 4/17/2008, you wrote: >Dear friends, > >I covered few introductory books on python. B4 going for an advanced >book, i want to take up small, small assignments and try to solve >with python. Can someone please suggest me any url where i can have >assignments and solutions. http://pro

Re: [Tutor] datetime module problem

2008-04-17 Thread Dick Moores
At 06:29 AM 4/17/2008, Kent Johnson wrote: >Dick Moores wrote: > >>>You could either create n with hours=minutes=0, or round the >>>difference up to the next whole number of days. >>I have no idea how to implement either of your suggestions as to >>how to eliminate it. Could you please spell them

Re: [Tutor] datetime module problem

2008-04-17 Thread Kent Johnson
Dick Moores wrote: > The script calculates correctly, but note the output, lines 34, 39, > 49, 53. Please show me how to print these in the form 4/17/2007. I've > tried everything I could think of. Come to think of it, you should be using datetime.date everywhere instead of datetime.datetime; y

Re: [Tutor] datetime module problem

2008-04-17 Thread Hansen, Mike
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Dick Moores > Sent: Thursday, April 17, 2008 2:21 PM > To: Python Tutor List > Subject: Re: [Tutor] datetime module problem > > At 06:29 AM 4/17/2008, Kent Johnson wrote: > >Dick Moores wrote: > > >

[Tutor] Need suggestion / advice - controlling remote server

2008-04-17 Thread dave selby
Hi all, I am after some advice / suggestions. I have written web interface for viewing CCTV images http://code.google.com/p/kmotion/wiki/ScreenShots its called 'kmotion'. Underneath its all Python daemons. It usually runs stand alone on headless servers. Now I am about to write a KDE interface in

Re: [Tutor] datetime module problem

2008-04-17 Thread Dick Moores
At 01:29 PM 4/17/2008, Hansen, Mike wrote: > > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Dick Moores > > Sent: Thursday, April 17, 2008 2:21 PM > > To: Python Tutor List > > Subject: Re: [Tutor] datetime module problem > > > > At 06:29 AM

Re: [Tutor] Need suggestion / advice - controlling remote server

2008-04-17 Thread Alan Gauld
"dave selby" <[EMAIL PROTECTED]> wrote > The question is how to communicate with the remote kmotion servers > Python daemons. I could access the images via port 80, no prob but I > need the KDE interface to change configs etc and restart services. You should still be able to do thast via a web i

Re: [Tutor] datetime module problem

2008-04-17 Thread Dick Moores
Got it, I think. The crucial lines are 22, 27. Thanks all, Dick UliPad <>: http://code.google.com/p/ulipad/ ___ Tutor maillist - Tutor@python.org http://mai

[Tutor] web programming tutorials?

2008-04-17 Thread Che M
[I thought I sent a similar msg to this list 2 days ago, but now I'm not sure it went through, so sorry if I've doubled] Can someone point me to a start-from-dead-scratch tutorial about the basics of web programming? I've been learning wxPython for GUI programming, but web programming (that i

Re: [Tutor] web programming tutorials?

2008-04-17 Thread Oleg Oltar
OK. take a look on the pages: 1. http://www.djangobook.com/ 2. Official docs on http://www.djangoproject.com/ 3. Dive into python (http://diveintopython.org/) 4. And the last one (but the best) showmedo: http://showmedo.com/ On Fri, Apr 18, 2008 at 6:20 AM, Che M <[EMAIL PROTECTED]> wrote: >

Re: [Tutor] web programming tutorials?

2008-04-17 Thread Norman Khine
Hi Che, I started with python web programming using Zope, but this was because I needed a quick CMS application for a small project I did and Zope's CMF fitted the bill nicely. Now I use itools (http://ikaaro.org/itools) it is relatively easy to setup and is 99% python (the parser is now in C)