Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Command parsing... best module to use?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Collin D  
View profile  
 More options Nov 3, 1:27 am
Newsgroups: comp.lang.python
From: Collin D <collin.da...@gmail.com>
Date: Mon, 2 Nov 2009 06:27:25 -0800 (PST)
Local: Tues, Nov 3 2009 1:27 am
Subject: Command parsing... best module to use?
Hey everyone.

I am writing a game in python, and it includes a text console somewhat
like the one in WoW and Runescape. I want to be able to include "/"
commands, like IRC, and was wondering what the best module would be to
parse these.

Thanks a lot,
Collin D


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
TerryP  
View profile  
 More options Nov 3, 3:22 am
Newsgroups: comp.lang.python
From: TerryP <bigboss1...@gmail.com>
Date: Mon, 2 Nov 2009 08:22:37 -0800 (PST)
Local: Tues, Nov 3 2009 3:22 am
Subject: Re: Command parsing... best module to use?
On Nov 2, 2:27 pm, Collin D <collin.da...@gmail.com> wrote:

> Hey everyone.

> I am writing a game in python, and it includes a text console somewhat
> like the one in WoW and Runescape. I want to be able to include "/"
> commands, like IRC, and was wondering what the best module would be to
> parse these.

> Thanks a lot,
> Collin D

I'm not aware of any module designed for parsing arbitrary text in
that way, although it may be possible to subvert something to the
task. If you are following the usual IRC client behavioural pattern,
then just suck up the line - then see if the first non-whitespace
character is a '/', then react accordingly. Simple.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Tolonen  
View profile  
 More options Nov 3, 5:21 am
Newsgroups: comp.lang.python
From: "Mark Tolonen" <metolone+gm...@gmail.com>
Date: Mon, 2 Nov 2009 10:21:34 -0800
Local: Tues, Nov 3 2009 5:21 am
Subject: Re: Command parsing... best module to use?

"Collin D" <collin.da...@gmail.com> wrote in message

news:94dbc92b-0682-4995-b358-0c615c95a27a@x6g2000prc.googlegroups.com...

> Hey everyone.

> I am writing a game in python, and it includes a text console somewhat
> like the one in WoW and Runescape. I want to be able to include "/"
> commands, like IRC, and was wondering what the best module would be to
> parse these.

Check out the pyparsing module.  Here is a presentation given by the author
for parsing an interactive game.

http://us.pycon.org/zope/talks/2006/fri/track1/04/index.html

-Mark


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Collin D  
View profile  
 More options Nov 3, 12:14 pm
Newsgroups: comp.lang.python
From: Collin D <collin.da...@gmail.com>
Date: Mon, 2 Nov 2009 17:14:12 -0800 (PST)
Local: Tues, Nov 3 2009 12:14 pm
Subject: Re: Command parsing... best module to use?
Thanks for the replies. Pyparsing looks just like what I need.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Hibbs  
View profile  
 More options Nov 4, 2:17 am
Newsgroups: comp.lang.python
From: Simon Hibbs <simon.hi...@gmail.com>
Date: Tue, 3 Nov 2009 07:17:40 -0800 (PST)
Local: Wed, Nov 4 2009 2:17 am
Subject: Re: Command parsing... best module to use?
On 3 Nov, 01:14, Collin D <collin.da...@gmail.com> wrote:

> Thanks for the replies. Pyparsing looks just like what I need.

The cmd module in the standard library is fine for simple command
interpreters. Depending on your needs you might find it does what you
want. Doug Hellmann has covered it in his "Python module of the week"
series of articles.

http://www.doughellmann.com/PyMOTW/cmd/index.html

Simon Hibbs


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
van Asselt  
View profile  
 More options Nov 8, 9:27 am
Newsgroups: comp.lang.python
From: "van Asselt" <h...@pa3btl.demon.nl>
Date: Sat, 7 Nov 2009 23:27:15 +0100
Local: Sun, Nov 8 2009 9:27 am
Subject: Re: Command parsing... best module to use?
Hello Colin,

I have been using 'cmdloop.py' from Crutcher Dunnavant in a few programs....
See http://py-cmdloop.googlecode.com/svn/trunk/cmdloop.py

Regards,
Henk

---------------------

"Collin D" <collin.da...@gmail.com> wrote in message

news:94dbc92b-0682-4995-b358-0c615c95a27a@x6g2000prc.googlegroups.com...


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google