I am trying to convert a python module (that contains the use of
NLTK.Corpus) by jythonc. It is not able to include nltk dependencies
within the java class it creates. So when i use this class in java, it
fails to recognize nltk. Can anyone please let me know how should i
use nltk in python/jython
Johny schrieb:
To get a number of the http processes running on my Linux( Debia box)
I use
ps -ef | grep "[h]ttpd" | wc -l
But If I want to use to get a number of the http processes from my
Python program I must use a popen command e.g.
popen2.popen3('ps -ef | grep "[h]ttpd" | wc -l')
that is
To get a number of the http processes running on my Linux( Debia box)
I use
ps -ef | grep "[h]ttpd" | wc -l
But If I want to use to get a number of the http processes from my
Python program I must use a popen command e.g.
popen2.popen3('ps -ef | grep "[h]ttpd" | wc -l')
that is I must call an ex
Tim Roberts wrote:
josh logan <[EMAIL PROTECTED]> wrote:
I am using Python 3.0b2.
I have an XML file that has the unicode character '\u012b' in it,
which, when parsed, causes a UnicodeEncodeError:
'charmap' codec can't encode character '\u012b' in position 26:
character maps to
This happens
> > Is there a cheap way to convert Myghty/Mako templates to Kid/Genshi?
> > There's some code written for Pylons that I want to incorporate
> > into a TurboGears 2 project and Genshi templates are more likely to
> > behave themselves with the tools I'm used to.
>
> Not that I'm aware of. And I t
What do I need to add to HTMLDecorator?
A simpler example:
import cgi
class ClassX(object):
pass # ... with own __repr__
class ClassY(object):
pass # ... with own __repr__
inst_x=ClassX()
inst_y=ClassY()
inst_z=[ i*i for i in range(25) ]
inst_b=True
class HTMLDecorator(object):
def
Tim Roberts wrote:
"bruce" <[EMAIL PROTECTED]> wrote:
it's the beautifulsoup() that's taking the "&E" and giving the "&E;"...
Right, as it should. "A&E" is not valid HTML, and beautifulsoup expects
valid HTML.
This can be difficult to fix in the general case, because your page might
already
Dear friends:
I'm trying to install python on irix 6, the lab server. It fail at '
make ' procedure for Modules/posixmodule.c. I've just configured the
prefix for my own path and no other option changed. make clean didn't
help.
Here it is:
gcc -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
"bruce" <[EMAIL PROTECTED]> wrote:
>
>it's the beautifulsoup() that's taking the "&E" and giving the "&E;"...
Right, as it should. "A&E" is not valid HTML, and beautifulsoup expects
valid HTML.
This can be difficult to fix in the general case, because your page might
already contain "&". If it
josh logan <[EMAIL PROTECTED]> wrote:
>
>I am using Python 3.0b2.
>I have an XML file that has the unicode character '\u012b' in it,
>which, when parsed, causes a UnicodeEncodeError:
>
>'charmap' codec can't encode character '\u012b' in position 26:
>character maps to
>
>This happens even when I a
Basically I have an existing (maybe a rather large and complicated
(existing) instance) that
I want to add new member to.
Cheers
N
Hacks/attempts follow:
from math import sqrt
try2
duck_obj = [ i*i for i in range(25) ] # OR a large sparse matrix
# I "want" to an a use
On Sep 1, 3:39 am, ssecorp <[EMAIL PROTECTED]> wrote:
>
> Traceback (most recent call last):
> File "C:/Python25/Progs//Movie.py", line 42, in
> class ActionComedy(Movie, ActionMovie):
> TypeError: Error when calling the metaclass bases
> Cannot create a consistent method resolution
from datetime import datetime
# batteries included
today = datetime.now()
xmas = datetime(today.year,12,25)
if (xmas - today).days > 1:
print "%d days until Christmas" % (xmas - today).days
else:
print "Merry Christmas!"
--
http://mail.python.org/mailman/listinfo/python-list
It works when I inherit from 2 classes but not when I inherit from 2
subclasses.
-
from __future__ import division
class Movie(object):
def __init__(self, movieId, grades, date):
self.movieId = movieId
self.grades = grades
Have you tried using subtraction on datetime.date objects
(http://docs.python.org/lib/datetime-date.html)? It produces a
timedelta which should be very close to what you want.
- Chris
On Sun, Aug 31, 2008 at 7:38 PM, W. eWatson <[EMAIL PROTECTED]> wrote:
> That's the question in Subject. For exam
also, how does super() work more exactly? I can't get it quite to
work.
class Movie(object):
def __init__(self, movieId, grades, date):
self.movieId = movieId
self.grades = grades
self.date = date
def newGrade(self, grade):
self.grades.append(grade)
d
I'm proud to release version 1.4.6 of Roundup.
1.4.6 is a bugfix release:
- Fix bug introduced in 1.4.5 in RDBMS full-text indexing
- Make URL matching code less matchy
If you're upgrading from an older version of Roundup you *must* follow
the "Software Upgrade" guidelines given in the maintenan
class Animal(object):
def __init__(self, name, weight):
self.name = name
self.weight = weight
def speak(self):
print "speak"
class Vegetable(object):
def __init__(self, name, volume):
self.name = name
self.volume = volume
def split(self):
That's the question in Subject. For example, the difference between
08/29/2008 and 09/03/2008 is +5. The difference between 02/28/2008 and
03/03/2008 is 4, leap year--extra day in Feb. I'm really only interested in
years between, say, 1990 and 2050. In other words not some really strange
period
On Sun, Aug 31, 2008 at 6:39 PM, ssecorp <[EMAIL PROTECTED]> wrote:
> Why/how is it possible to add variables like this? I don't understand
> this mechanism:
> http://docs.python.org/tut/node11.html#SECTION001133
Under the covers, Python objects are implemented using dictionaries,
Why/how is it possible to add variables like this? I don't understand
this mechanism:
http://docs.python.org/tut/node11.html#SECTION001133
class Employee:
pass
john = Employee() # Create an empty employee record
# Fill the fields of the record
john.name = 'John Doe'
john.dept
>
> Yes and no. My own experience with Debian packages
> is that with a standard
> apt-get install python2.5
> an attempt to
> import sqlite3
> results in
> ImportError: No module named _sqlite3
>
From Kubuntu 8.04
$ uname -a
Linux em1 2.6.24-19-generic #1 SMP
Wed Aug 20
On Sep 1, 9:53 am, ssecorp <[EMAIL PROTECTED]> wrote:
> A method on a class:
>
> def printSelf(self):
> def printReviews():
> for review in self.reviews:
> review.printSelf()
> print "Idnbr: ", self.idnumber, "Reviews: ", printReviews()
>
The above appea
> .
> Yes and no. My own experience with Debian packages
> is that with a standard
>
> apt-get install python2.5
>
> an attempt to
> import sqlite3
>
> results in
> ImportError: No module named _sqlite3
>
No problems here with Debian Lenny
All package
Yes, printReviews() is a closure. In particular, it's closing over the
variable "self", which it's getting lexically from printSelf().
- Chris
On Sun, Aug 31, 2008 at 4:53 PM, ssecorp <[EMAIL PROTECTED]> wrote:
> A method on a class:
>
> def printSelf(self):
>def printReviews():
>
A method on a class:
def printSelf(self):
def printReviews():
for review in self.reviews:
review.printSelf()
print "Idnbr: ", self.idnumber, "Reviews: ", printReviews()
I don't have to pass an argument to printReviews because everything
defined inside p
Cameron Laird schreef:
I now suspect that my 2.5 packaging has something to do with 64-bit builds;
all my 32-bit Ubuntu servers have Python 2.5.2, while the 64-bit ones are at
Python 2.5.
Strange: my 64-bit Ubuntu 8.04 has Python 2.5.2, with working sqlite:
[EMAIL PROTECTED] $ uname -a
Linux
On 31 Aug, 21:29, [EMAIL PROTECTED] (Cameron Laird) wrote:
>
[Lots of output suggesting correct package configuration]
> I'm certainly perplexed, and welcome suggestions.
Maybe...
which python
I think Jean-Paul might be on to something with his response. Are we
referring to the system-packag
In article <[EMAIL PROTECTED]>,
Jean-Paul Calderone <[EMAIL PROTECTED]> wrote:
>On Sun, 31 Aug 2008 18:05:08 +, Cameron Laird <[EMAIL PROTECTED]> wrote:
>>In article <[EMAIL PROTECTED]>,
>>Paul Boddie <[EMAIL PROTECTED]> wrote:
>> [snip]
>>
>>Thanks for pursuing this, Paul. You have me curio
aha...
it's the beautifulsoup() that's taking the "&E" and giving the "&E;"...
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf
Of Fredrik Lundh
Sent: Sunday, August 31, 2008 1:10 PM
To: python-list@python.org
Subject: Re: parsing "&A" in a string..
bruce wr
Hello,
I'm trying to implement a new character encoding defined in the GSM
standard. The problem is that the encoding uses an extension table
with an escaping character so I can not us a simple charmap. I think I
have to use an IncrementalEncoder/Decoder but the problem is I don't
know how to do i
Hi Fredrick
Thanks for the reply. But since I don't have control of the initial text, is
there something with python that will strip/replace this...
or are you saying I should do a search/replace on the "&" char with the
"amp&;" prior to parsing??
-Original Message-
From: [EMAIL PROTEC
bruce wrote:
a pretty simple question, i'm guessing.
i have a text/html string that looks like:
(A&E)
the issue i have is that when i parse it using xpath/node/toString,
i get the following
...(A&E;).
that's because your parser is interpreting the &E part as an entity
reference
In article <[EMAIL PROTECTED]>,
Paul Boddie <[EMAIL PROTECTED]> wrote:
>On 31 Aug, 20:05, [EMAIL PROTECTED] (Cameron Laird) wrote:
>>
>> Let's take a definite example: I have a convenient
>> Ubuntu 8.04.1
>> The content of /etc/apt/sources.list is
>> debhttp://us.archive.ubuntu.com/ubuntu
Hi.
a pretty simple question, i'm guessing.
i have a text/html string that looks like:
(A&E)
the issue i have is that when i parse it using xpath/node/toString,
i get the following
...(A&E;).
note the semicolon ";". I've tried to use the encoding function of toString
with no luck..
Asterix wrote:
> how could I test that those 2 strings are the same:
>
> 'séd' (repr is 's\\xc3\\xa9d')
>
> u'séd' (repr is u's\\xe9d')
You may also want to look at unicodedata.normalize(). For example, é can
be represented multiple ways:
>>> import unicodedata
>>> unicodedata.normalize('NFC',
On Sun, 31 Aug 2008 18:05:08 +, Cameron Laird <[EMAIL PROTECTED]> wrote:
In article <[EMAIL PROTECTED]>,
Paul Boddie <[EMAIL PROTECTED]> wrote:
[snip]
Thanks for pursuing this, Paul. You have me curious now.
Let's take a definite example: I have a convenient
Ubuntu 8.04.1
The content
Hello,
I am using Python 3.0b2.
I have an XML file that has the unicode character '\u012b' in it,
which, when parsed, causes a UnicodeEncodeError:
'charmap' codec can't encode character '\u012b' in position 26:
character maps to
This happens even when I assign this character to a reference in t
Par Toutatis !
Si tu avais posé la question à Ordralphabétix, ou sur un des ng français
consacrés à Python, au lieu de refaire "La grande Traversée", la réponse
aurait peut-être été plus rapide.
@-salutations
--
Michel Claveau
--
http://mail.python.org/mailman/listinfo/python-list
On 31 Aug, 20:05, [EMAIL PROTECTED] (Cameron Laird) wrote:
>
> Let's take a definite example: I have a convenient
> Ubuntu 8.04.1
> The content of /etc/apt/sources.list is
> debhttp://us.archive.ubuntu.com/ubuntuhardy main restricted
> debhttp://us.archive.ubuntu.com/ubuntuhardy-update
In article <[EMAIL PROTECTED]>,
Paul Boddie <[EMAIL PROTECTED]> wrote:
>On 31 Aug, 16:45, [EMAIL PROTECTED] (Cameron Laird) wrote:
>> Yes and no. My own experience with Debian packages is that with a
>> standard
>> apt-get install python2.5
>> an attempt to
>> import sqlite3
>> results in
>>
On Sun, 31 Aug 2008 07:29:26 -0700 (PDT), [EMAIL PROTECTED] wrote:
> Suppose I have a string which contains quotes inside quotes -
> single and double quotes interchangeably -
> s = "a1' b1 " c1' d1 ' c2" b2 'a2"
>>> s = "a1' b1 " c1' d1 ' c2" b2 'a2"
File "", line 1
s = "a1' b1 " c1'
In article <[EMAIL PROTECTED]>,
King <[EMAIL PROTECTED]> wrote:
>Hi,
>
>I am using subprocess module to execute a command and print results
>back.
>
>startupinfo = subprocess.STARTUPINFO()
>startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
>my_process = subprocess.Popen(cmnd, startupinfo=star
forgot the code, sorry,
the code:
import wx
class MyFrame(wx.Frame):
def __init__(self, parent, ID, title):
wx.Frame.__init__(self, parent, ID, title, size=(400, 250))
myscrolledwindow = wx.PyScrolledWindow(self, -1)
sizer = wx.BoxSizer()
myscrolledwindow.SetSizer(
why this code is no giving any scroll?
--
http://mail.python.org/mailman/listinfo/python-list
On 31 Aug 2008 04:07:36 GMT, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
>On Sun, 31 Aug 2008 05:12:01 +0200, Marin Brkic wrote:
>
>> I remember an older coleague who said; "open, free and whatever licence
>> type ... software is free, only up to some amount of $$/per hour".
>> After that you just
On Sat, 30 Aug 2008 22:09:31 -0700 (PDT), John Machin
<[EMAIL PROTECTED]> wrote:
>
>"write to a file" has connotations of updating an existing file;
>"write a file" or "create a file" are less ambiguous.
Hmm, yes, maybe you're right. Write to a file, as in, create a file
and then write to it is w
On 31 Aug, 16:45, [EMAIL PROTECTED] (Cameron Laird) wrote:
> Yes and no. My own experience with Debian packages is that with a
> standard
> apt-get install python2.5
> an attempt to
> import sqlite3
> results in
> ImportError: No module named _sqlite3
That's strange from the perspective of
On Jul 29, 10:56 pm, koblas <[EMAIL PROTECTED]> wrote:
> To that end why would somebody write big try catch blocks to see if
> modules exist and if they exist alias their names. Wouldn't it be
> better if there was a way that if I have an "interface compatible"
> native (aka C) module that has bet
John Machin wrote:
"""xlrd is still doing what it was designed to do: read Excel ... xls
files."""
oops... I had downloaded the sources from
"https://secure.simplistix.co.uk/svn/xlwt/trunk";
eh, xlWT .. obviously I cant find an "open" function in it..
Could you possibly be viewing the sour
In article <[EMAIL PROTECTED]>,
Fredrik Lundh <[EMAIL PROTECTED]> wrote:
>mark wrote:
.
.
.
>> Unfortunately I have only some knowledge of SQLite which is not an
>> option here.
>
>why is sqlite not an option? it's is bundled
Hi all,
Suppose I have a string which contains quotes inside quotes -
single and double quotes interchangeably -
s = "a1' b1 " c1' d1 ' c2" b2 'a2"
I need to start at b1 and end at b2 - i.e. I have to parse the
single quote strings from inside s.
Is there an existing string quote pa
Hi Alanm
Thanks a lot. This helped me to locate it:
In my case it is:
C:\Python25\Scripts\launch-gazpacho.py
thanks again
bye
N
Alan Franzoni wrote:
nntpman68 was kind enough to say:
[cut]
I didn't check, but if c:\python25 is your python install dir, you'll very
likely find it in c:\
Asterix wrote:
how could I test that those 2 strings are the same:
'séd' (repr is 's\\xc3\\xa9d')
u'séd' (repr is u's\\xe9d')
determine what encoding the former string is using (looks like UTF-8),
and convert it to Unicode before doing the comparision.
>>> b = 's\xc3\xa9d'
>>> u = u's\xe9
mark wrote:
> I need to extract data from text files (~4 GB) on this data some
> operations are performed like avg, max, min, group etc. The result is
> formated and written in some other text files (some KB).
you could probably do all that with data stream processing, but if you
haven't worked
On Aug 31, 11:04 pm, Asterix <[EMAIL PROTECTED]> wrote:
> how could I test that those 2 strings are the same:
>
> 'séd' (repr is 's\\xc3\\xa9d')
>
> u'séd' (repr is u's\\xe9d')
[note: your reprs are wrong; change the \\ to \]
You need to decode the non-unicode string and compare the result with
t
On Aug 31, 11:04 pm, Asterix <[EMAIL PROTECTED]> wrote:
> how could I test that those 2 strings are the same:
>
> 'séd' (repr is 's\\xc3\\xa9d')
No, the repr is 's\xc3\xa9d'.
>
> u'séd' (repr is u's\\xe9d')
No, the repr is u's\xe9d'.
To answer your question:
--
http://mail.python.org/mailman
Marin Brkic wrote:
...
I remember an older coleague who said; "open, free and whatever
licence type ... software is free, only up to some amount of $$/per
hour". After that you just want things to work, and if they don't
work, there are people who are paid $/per hour to make it work.
Well I he
Hi there,
I need to extract data from text files (~4 GB) on this data some
operations are performed like avg, max, min, group etc. The result is
formated and written in some other text files (some KB).
I currently think about database tools might be suitable for this. I
would just write the impor
Alessandro wrote:
John Machin wrote:
xlrd is still doing what it was designed to do: read (not "interface
with") Excel xls files. There is a currently active project to add
Can xlrd *read* xls files?
As far as I have used PyExecelerator, it can only *create* xls file.
Thats not true, pyexcel
how could I test that those 2 strings are the same:
'séd' (repr is 's\\xc3\\xa9d')
u'séd' (repr is u's\\xe9d')
--
http://mail.python.org/mailman/listinfo/python-list
Guillermo wrote:
Hi,
I've been playing with docutils in order to use ReStructedText with
Django, but I was wondering if apart from converting files to html it
adds anything to Python's self-documenting facilities.
For instance, the instructions tell you to run "buildhtml.py .." after
the instal
On Aug 31, 7:21 pm, Alessandro <[EMAIL PROTECTED]> wrote:
> John Machin wrote:
> > xlrd is still doing what it was designed to do: read (not "interface
> > with") Excel xls files. There is a currently active project to add
>
> Can xlrd *read* xls files?
Follow the bouncing ball and sing along with
Hi,
I've been playing with docutils in order to use ReStructedText with
Django, but I was wondering if apart from converting files to html it
adds anything to Python's self-documenting facilities.
For instance, the instructions tell you to run "buildhtml.py .." after
the installation, which gene
Marin Brkic wrote:
Actually, that might work. What I was needing (aiming for) was a way
to write to excel 2003 files. Formatting is not necessary, since what
I'm trying to write is some tabular data; results from fortran-python
simulation (I can explain, but the details seem irrelevant for thi
On Fri, 29 Aug 2008, bruce wrote:
Hi john.
Thanks for your reply. I tried your suggestion of using RobustFactory, and
still get a badly maligned html back!!! The html is listed below. I would
That's expected -- this affects the parsing of the HTML. It does not
modify the HTML.
have thou
On Sun, 31 Aug 2008 06:40:35 GMT, OKB (not okblacke) wrote:
>> Download the latest beta for your system and give it a try.
>
> Thanks for the advice, but I'd really rather not deal with
> installing the entire thing alongside my existing version, possibly
> causing conflicts in who knows w
John Machin wrote:
On Aug 31, 11:32 am, Marin Brkic <[EMAIL PROTECTED]> wrote:
Is there a way to access google
groups through a similiar interface program as a newsreader.
I don't know (question has never arisen before).
Never
used them before, and getting a lot of messages to my email e
John Machin wrote:
xlrd is still doing what it was designed to do: read (not "interface
with") Excel xls files. There is a currently active project to add
Can xlrd *read* xls files?
As far as I have used PyExecelerator, it can only *create* xls file.
I'm viewing the xlrd sources, but I can't f
Hi,
I am using subprocess module to execute a command and print results
back.
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
my_process = subprocess.Popen(cmnd, startupinfo=startupinfo)
print repr(my_process.communicate()[0])
This code executes on p
am a newbie to python language and kdevelop, so i would like to know
how to configure kdevelop for python programming? complete with a
debugger?
--
http://mail.python.org/mailman/listinfo/python-list
Ouray Viney wrote:
Hi All:
I am looking at writing a python script that will let me parse a
TestSuite xml file that contains n number of TestCases.
My goal is to be able to count the elements base on a key
value pair in the xml node.
Example
I would like to be able to count the number of T
Chris Babcock schrieb:
Is there a cheap way to convert Myghty/Mako templates to Kid/Genshi?
There's some code written for Pylons that I want to incorporate into a
TurboGears 2 project and Genshi templates are more likely to behave
themselves with the tools I'm used to.
Not that I'm aware of. An
> ShedSkinwill probably have scaling problems: as the program size
> grows it may need too much time to infer all the types. The author has
> the strict policy of refusing any kind of type annotation, this make
> it unpractical.
well, I admit I really don't like manual type annotations (unless fo
74 matches
Mail list logo