if you please i want a help in running a nltk modules

enas khalil enas_khalil at yahoo.com
Thu Jun 30 09:07:37 EDT 2005


if you please i want a help
im a beginner in using python 
i want to know how can i run a GUI module 
i installed python on windows platform 
thanks 

python-list-request at python.org wrote:
Send Python-list mailing list submissions to
python-list at python.org

To subscribe or unsubscribe via the World Wide Web, visit
http://mail.python.org/mailman/listinfo/python-list
or, via email, send a message with subject or body 'help' to
python-list-request at python.org

You can reach the person managing the list at
python-list-owner at python.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Python-list digest..."
Today's Topics:

1. ANN: PyGaim released - Gaim Python plugin (Gerrit van Dyk)
2. multi regexp analyzer ? or how to do... (joh12005 at yahoo.fr)
3. Re: need help with MySQLdb (Wolfram Kraus)
4. Re: Favorite non-python language trick? (Paddy)
5. Re: need help with MySQLdb (Dennis Lee Bieber)
6. Re: some trouble with MySQLdb (dimitri pater)
7. Re: need help with MySQLdb (Dennis Lee Bieber)
8. python install settings... (jtan325)
9. Re: aligning text with space-normalized text (Peter Otten)
10. Re: Inheriting from object (Fuzzyman)
From: Gerrit van Dyk <gvandyk.nospam at agileworks.net>
To: python-list at python.org
Date: Thu, 30 Jun 2005 07:36:22 +0200
Subject: ANN: PyGaim released - Gaim Python plugin

PyGaim has been released.

Summary: Gaim Python plug-in. The product provides developers with the 
capability to develop python plugins for Gaim

This release is just a get it out there release and a lot of polishing 
still needs to be done.

However, it does enable a python developer to develop gaim plugins using 
python as the programming language.

The current packages is available from 
http://sourceforge.net/projects/pygaim

ToDo:

Web page
CVS
Instructions on installing and using
More examples
A interface to the gaim gui using pygtk
Lots of other stuff.

The mailing list should be up in the next 24 hours

From: joh12005 at yahoo.fr
To: python-list at python.org
Date: 29 Jun 2005 23:19:50 -0700
Subject: multi regexp analyzer ? or how to do...

Hello,

here is a trouble that i had, i would like to resolve it with python,
even if i still have no clue on how to do it.

i had many small "text" files, so to speed up processes on them, i used
to copy them inside a huge one adding some king of xml separator :


[content]


content is tab separated data (columns) ; data are strings

now here come the tricky part for me :

i would like to be able to create some kind of matching rules, using
regular expressions, rules should match data on one line (the smallest
data unit for me) or a set of lines, say for example :

if on this line , match first column against this regexp and match
second column
and on following line match third column
-> trigger something

so, here is how i had tried :

- having all the rules,
- build some kind of analyzer for each rule,
- keep size of longest one L,
- then read each line of the huge file one by one,
- inside a "file", create all the subsets of length <= L
- for each analyzer see if it matches any of the subsets
- if it occurs...

my trouble is here :

"for each analyzer see if it matches any of the subset"

it is really to slow, i had many many rules, and as it is "for loop
inside for loop", and inside each rule also "for loop on subsets lines"
i need to speed up that, have you any idea ?

i am thinking of having "only rules for one line" and to keep traces of
if a rule is a "ending one" (to trigger something) , or a "must
continue" , but is still unclear to me for now...

a great thing could also have been some sort of dict with regexp
keys...

(and actually it would be great if i could also use some kind of regexp
operator to tell one can skip the content of 0 to n lines before
matching, just as if in the example i had changed "following..." by
"skip at least 2 lines and match third column on next line - it would
be great, but i still have really no idea on how to even think about
that)

great thx to anybody who could help,

best


From: Wolfram Kraus <kraus at hagen-partner.de>
To: python-list at python.org
Date: Thu, 30 Jun 2005 08:41:37 +0200
Subject: Re: need help with MySQLdb

nephish at xit.net wrote:
> Hey there all,
> i have a question about how to point my python install to my sql
> database.
> 
> when i enter this: db = MySQLdb.connect(user="user", passwd="pass",
> db="myDB")
> 
> i get this:
> Traceback (most recent call last):
> File "
", line 1, in -toplevel-
> db = MySQLdb.connect(user="user", passwd="pass", db="MyDB")
> File "/usr/lib/python2.4/site-packages/MySQLdb/__init__.py", line 66,
> in Connect
> return Connection(*args, **kwargs)
> File "/usr/lib/python2.4/site-packages/MySQLdb/connections.py", line
> 134, in __init__
> super(Connection, self).__init__(*args, **kwargs2)
> OperationalError: (1049, "Unknown database 'MyDB'")
> 
> i am using the all in one package from lampp (now xampp) and i have
> tested a couple of python scripts from the cgi, but.... nothing that
> connects to the database.
> 
> any ideas?
> 
> thanks
> 
Try the following from the shell (NOT the python shell):
mysql -u user -p
[Enter passwd]
mysql> show databases;

If MyDB isn't in the list either something went wrong with the xampp 
installation or the database for xampp got a different name. (I am no 
xampp expert, so I can't help you any further)

HTH,
Wolfram

From: "Paddy" <paddy3118 at netscape.net>
To: python-list at python.org
Date: 29 Jun 2005 23:44:24 -0700
Subject: Re: Favorite non-python language trick?

Sadly, its not a solution that I'm after, but a particular toolkit that
can be used for solving that type of problem.

- Pad.


From: Dennis Lee Bieber <wlfraed at ix.netcom.com>
To: python-list at python.org
Date: Thu, 30 Jun 2005 06:47:18 GMT
Subject: Re: need help with MySQLdb

On 29 Jun 2005 21:56:49 -0700, nephish at xit.net declaimed the following
in comp.lang.python:


> any ideas?
>
Step 1: show us what the interactive command line tool "mysql"
does with...


mysql user -p
pass
use MyDB;

IOW, verify you can connect to the database using the MySQL
tools first, then figure out what is different with the MySQLdb call.

-- 
> ============================================================== <
> wlfraed at ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
> wulfraed at dm.net | Bestiaria Support Staff <
> ============================================================== <
> Home Page: <
> Overflow Page: <

From: dimitri pater <dimitri.pater at gmail.com>
CC: python-list at python.org
To: nephish <nephish at xit.net>
Date: Thu, 30 Jun 2005 08:58:41 +0200
Subject: Re: some trouble with MySQLdb

try:
db = MySQLdb.connect(host="localhost", user="user", passwd="pass",
db="myDB")
localhost can be a URL also (if MySQL is set up properly in the first place)
regards,
Dimtiri

On 6/30/05, nephish <nephish at xit.net> wrote:Hey there all,
i have a question about how to point my python install to my sql database.

when i enter this: db = MySQLdb.connect(user="user", passwd="pass",
db="myDB")

i get this: 
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in -toplevel-
    db = MySQLdb.connect(user="user", passwd="pass", db="MyDB")
  File "/usr/lib/python2.4/site-packages/MySQLdb/__init__.py", line 66, 
in Connect
    return Connection(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/MySQLdb/connections.py", line
134, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
OperationalError: (1049, "Unknown database 'MyDB'")

i am using the all in one package from lampp (now xampp) and i have
tested a couple of python scripts from the cgi, but.... nothing that
connects to the database. 

any ideas?

thanks
--
http://mail.python.org/mailman/listinfo/python-list




-- 
Please visit dimitri's website: www.serpia.com From: Dennis Lee Bieber <wlfraed at ix.netcom.com>
To: python-list at python.org
Date: Thu, 30 Jun 2005 06:57:54 GMT
Subject: Re: need help with MySQLdb

On Thu, 30 Jun 2005 06:47:18 GMT, Dennis Lee Bieber
declaimed the following in comp.lang.python:

> On 29 Jun 2005 21:56:49 -0700, nephish at xit.net declaimed the following
> in comp.lang.python:
> 
> 
> > any ideas?
> >
> Step 1: show us what the interactive command line tool "mysql"
> does with...
> 
> 
> mysql user -p
> pass
> use MyDB;
> 
> IOW, verify you can connect to the database using the MySQL
> tools first, then figure out what is different with the MySQLdb call.

{okay, slight error in the command line string -- I haven't ported MySQL
from the old W98 machine to the WinXP machine yet}

-- 
> ============================================================== <
> wlfraed at ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
> wulfraed at dm.net | Bestiaria Support Staff <
> ============================================================== <
> Home Page: <
> Overflow Page: <

From: "jtan325" <mr.jasontan at gmail.com>
To: python-list at python.org
Date: 30 Jun 2005 00:01:43 -0700
Subject: python install settings...

hi,

i am running Linux Ubuntu Hoary and am trying to build the Python
numarray package, v. 1.3.2 by hand since ubuntu's repos won't be
updated until breezy.

i have python 2.4, and gcc 3.3.5

after unpacking the tar, i run "python setup.py install", as it says in
the installation instructions. i get the following:

[colfax 53] numarray-1.3.2 > python setup.py install
Using EXTRA_COMPILE_ARGS = []
running install
running build
running build_py
copying Lib/numinclude.py -> build/lib.linux-i686-2.4/numarray
running build_ext
Traceback (most recent call last):
File "setup.py", line 222, in ?
main()
File "setup.py", line 213, in main
setup(**p)
File "/usr/lib/python2.4/distutils/core.py", line 149, in setup
dist.run_commands()
File "/usr/lib/python2.4/distutils/dist.py", line 946, in
run_commands
self.run_command(cmd)
File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command
cmd_obj.run()
File "/usr/lib/python2.4/distutils/command/install.py", line 506, in
run
self.run_command('build')
File "/usr/lib/python2.4/distutils/cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command
cmd_obj.run()
File "/usr/lib/python2.4/distutils/command/build.py", line 112, in
run
self.run_command(cmd_name)
File "/usr/lib/python2.4/distutils/cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command
cmd_obj.run()
File "/usr/lib/python2.4/distutils/command/build_ext.py", line 254,
in run
customize_compiler(self.compiler)
File "/usr/lib/python2.4/distutils/sysconfig.py", line 174, in
customize_compiler
cc_cmd = cc + ' ' + opt
TypeError: cannot concatenate 'str' and 'NoneType' objects


I had a similiar (but different) error earlier, but then I learned I
had to set my "CC" environment variable. So I set that to "gcc". i have
tried setting my "OPT" setting to something like "-g 02" (no idea what
it means just found it somewhere, but it still didn't work.

upon closer inspection of Python's distutils sysconfig.py, is the error
being caused by the ' ' in "cc_cmd = cc + ' ' + opt"? Any ideas on this
new error? Are there packages/settings I need to take care of before i
can use Python's distutils to install stuff?

Thanks,
Jason


From: Peter Otten <__peter__ at web.de>
To: python-list at python.org
Date: Thu, 30 Jun 2005 09:07:04 +0200
Subject: Re: aligning text with space-normalized text

Steven Bethard wrote:

> I have a string with a bunch of whitespace in it, and a series of chunks
> of that string whose indices I need to find.  However, the chunks have
> been whitespace-normalized, so that multiple spaces and newlines have
> been converted to single spaces as if by ' '.join(chunk.split()).  Some

If you are willing to get your hands dirty with regexps:

import re
_reLump = re.compile(r"\S+")

def indices(text, chunks):
lumps = _reLump.finditer(text)
for chunk in chunks:
lump = [lumps.next() for _ in chunk.split()]
yield lump[0].start(), lump[-1].end()


def main():
text = """\
aaa bb ccc
dd eee. fff gggg
hh i.
jjj kk.
"""
chunks = ['aaa bb', 'ccc dd eee.', 'fff gggg hh i.', 'jjj', 'kk.']
assert list(indices(text, chunks)) == [(3, 10), (11, 22), (24, 40), (44,
47), (48, 51)]

if __name__ == "__main__":
main()

Not tested beyond what you see.

Peter


From: "Fuzzyman" <fuzzyman at gmail.com>
To: python-list at python.org
Date: 30 Jun 2005 00:36:34 -0700
Subject: Re: Inheriting from object

The reason I ask is that I often (well... a couple of times anyway) see
cryptic omments like :

and if you inherit from object you get all the benefits of new
style classes

Now I know about the advantages of inheriting from the built in types
(if that's what you want to do) -but am a bit fuzzier on the 'general
benefits'.

I'm vaguely aware of properties.... I'll have to explore them at some
point.

Best Regards,

Fuzzy
http://www.voidspace.org.uk/python


-- 
http://mail.python.org/mailman/listinfo/python-list
		
---------------------------------
Yahoo! Mail Mobile
 Take Yahoo! Mail with you! Check email on your mobile phone.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20050630/3c507b2d/attachment.html>


More information about the Python-list mailing list