On Sun, Dec 30, 2012 at 8:18 PM, contro opinion wrote:
> here is my haha class
> class haha(object):
> def theprint(self):
> print "i am here"
>
haha().theprint()
> i am here
haha(object).theprint()
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: objec
On Sun, Dec 30, 2012 at 10:36 PM, contro opinion wrote:
> here is my haha class
> class haha(object):
> def theprint(self):
> print "i am here"
>
haha().theprint()
> i am here
haha(object).theprint()
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: obje
On 12/31/2012 01:36 AM, contro opinion wrote:
> here is my haha class
You posted the same question twice before, and it was answered two hours
ago. Read the first thread, instead of starting spurious ones.
--
DaveA
--
http://mail.python.org/mailman/listinfo/python-list
On 12/31/2012 01:32 AM, contro opinion wrote:
> import urllibimport lxml.html
> down='http://blog.sina.com.cn/s/blog_71f3890901017hof.html'
> file=urllib.urlopen(down).read()
> root=lxml.html.document_fromstring(file)
> body=root.xpath('//div[@class="articalContent "]')[0]print
> body.text_conten
On Sun, Dec 30, 2012 at 10:32 PM, contro opinion wrote:
> import urllib
> import lxml.html
> down='http://blog.sina.com.cn/s/blog_71f3890901017hof.html'
> file=urllib.urlopen(down).read()
> root=lxml.html.document_fromstring(file)
> body=root.xpath('//div[@class="articalContent "]')[0]
> print bo
On 2012.12.30 22:18, contro opinion wrote:
> here is my haha class
> class haha(object):
> def theprint(self):
> print "i am here"
>
haha().theprint()
> i am here
haha(object).theprint()
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: object.__new__()
In article ,
contro opinion wrote:
> here is my haha class
> class haha(object):
> def theprint(self):
> print "i am here"
>
> >>> haha().theprint()
> i am here
> >>> haha(object).theprint()
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: object.__new__() tak
here is my haha class
class haha(object):
def theprint(self):
print "i am here"
>>> haha().theprint()
i am here
>>> haha(object).theprint()
Traceback (most recent call last):
File "", line 1, in
TypeError: object.__new__() takes no parameters
why haha(object).theprint() get wrong o
Thank you Terry!
I was trying to follow the documentation but somehow didn't payed attention
to the lgettext/gettext distinction until I read your first response.
Changing lgettext to gettext solved the problem.
It prints correctly to my console because I have to environmental
variable PYTHONIOEN
On 12/30/2012 8:48 PM, Terry Reedy wrote:
On 12/30/2012 7:39 PM, Marcel Rodrigues wrote:
I'm using Python 3.3 (CPython) and am having trouble getting the
standard gettext module to handle Unicode messages.
Addition to previous response.
import gettext
t = gettext.translation("greeting", "lo
On 12/30/2012 7:39 PM, Marcel Rodrigues wrote:
I'm using Python 3.3 (CPython) and am having trouble getting the
standard gettext module to handle Unicode messages.
I have never even looked at the doc before, but I will take a look.
My problem can be isolated as follows:
I have 3 files in a f
I'm using Python 3.3 (CPython) and am having trouble getting the standard
gettext module to handle Unicode messages.
My problem can be isolated as follows:
I have 3 files in a folder: greeting.py, greeting.po and msgfmt.py.
-- greeting.py --
import gettext
t = gettext.translation("greeting", "lo
On 30Dec2012 12:32, Roy Smith wrote:
| In article ,
| Vlastimil Brom wrote:
| > you may check the new regex implementation for python
| > http://pypi.python.org/pypi/regex
[...]
| I'm not sure I like the fuzzy matching stuff. On the one hand, it can
| be useful. On the other hand, people alre
%s got the job done!!!
Thank you all for the info and links,
I appreciate it!
--
http://mail.python.org/mailman/listinfo/python-list
On 30/12/12 23:25:39, Evan Driscoll wrote:
> On 12/30/2012 4:19 PM, Hans Mulder wrote:
>> If it's okay to modify the original list, you can simply do:
>>
>> l[0] = split(l[0], ", ")
>>
>> If modifying the original is not okay, the simple solution would
>> be to copy it first:
>>
>> l2 = l
>> l2[0]
Hello,
Python does not support REAL numbers. It has float number, which
are approximations of real numbers. They behave almost, but not
quite, like you might expect.
It also has Decimal numbers. They also approximate real numbers,
but slightly differently. They might behave more like you'd ex
Alvaro Lacerda wrote:
> The code I wrote is supposed to ask the user to enter a number;
> Then tell the user what's going to happen to that number (x / 2 + 5) ;
> Then give the user an answer;
>
> I succeeded getting results from even numbers, but when I try diving an
> uneven number (i.e. 5) by
2012/12/30 Alvaro Lacerda :
> The code I wrote is supposed to ask the user to enter a number;
> Then tell the user what's going to happen to that number (x / 2 + 5) ;
> Then give the user an answer;
>
> I succeeded getting results from even numbers, but when I try diving an
> uneven number (i.e. 5
On 30-12-2012 23:37, Alvaro Lacerda wrote:
>
> I'm trying to get full number result using the %d command
Try %f instead. %d is the formatting symbol for integer numbers.
See http://docs.python.org/2/library/stdtypes.html#string-formatting-operations
Or have a look at what string.format() can do:
On Sun, Dec 30, 2012 at 5:37 PM, Alvaro Lacerda wrote:
> The code I wrote is supposed to ask the user to enter a number;
> Then tell the user what's going to happen to that number (x / 2 + 5) ;
> Then give the user an answer;
>
Try x / 2.5 + 5
>
> I succeeded getting results from even numbers, b
The code I wrote is supposed to ask the user to enter a number;
Then tell the user what's going to happen to that number (x / 2 + 5) ;
Then give the user an answer;
I succeeded getting results from even numbers, but when I try diving an uneven
number (i.e. 5) by 2, I get only the whole number (i.
On 12/30/2012 4:19 PM, Hans Mulder wrote:
> If it's okay to modify the original list, you can simply do:
>
> l[0] = split(l[0], ", ")
>
> If modifying the original is not okay, the simple solution would
> be to copy it first:
>
> l2 = l
> l2[0] = split(l2[0], ", ")
Um, that doesn't copy the lis
On 28/12/12 18:46:45, Alex wrote:
> Manatee wrote:
>
>> On Friday, December 28, 2012 9:14:57 AM UTC-5, Manatee wrote:
>>> I read in this:
>>>
>>> ['C100, C117', 'X7R 0.033uF 10% 25V 0603', '0603-C_L, 0603-C_N',
>>> '10', '2', '', '30', '15463-333', 'MURATA', 'GRM188R71E333KA01D',
>>> 'Digi-Key',
On Saturday, September 3, 2011 4:47:43 AM UTC+5:45, peter kalvin wrote:
> I have solutions manuals to all problems and exercises in these
> textbooks. To get one in an electronic format contact me at:
> kalvinmanual(at)gmail(dot)com and let me know its title, author and
> edition. Please this servi
On 30/12/12 19:57:31, Nicholas Cole wrote:
> Dear List,
>
> I'm hoping to use the tarfile module in the standard library to move
> some files between computers.
>
> I can't see documented anywhere what this library does with userids and
> groupids. I can't guarantee that the computers involved
On Sun, Dec 30, 2012 at 8:07 PM, Albert Hopkins wrote:
>
>
> On Sun, Dec 30, 2012, at 01:57 PM, Nicholas Cole wrote:
>
> Dear List,
>
> I'm hoping to use the tarfile module in the standard library to move some
> files between computers.
>
> I can't see documented anywhere what this library does wit
On Sun, 30 Dec 2012 19:57:31 +0100, Nicholas Cole wrote:Dear List,I'm hoping to use the tarfile module in the standard library to move some files between computers. I can't see documented anywhere what this library does with userids and groupids. I can't guarantee that the computers involved wil
On Sun, Dec 30, 2012, at 01:57 PM, Nicholas Cole wrote:
Dear List,
I'm hoping to use the tarfile module in the standard library to move
some files between computers.
I can't see documented anywhere what this library does with userids and
groupids. I can't guarantee that the computers invo
Dear List,
I'm hoping to use the tarfile module in the standard library to move some
files between computers.
I can't see documented anywhere what this library does with userids and
groupids. I can't guarantee that the computers involved will have the same
users and groups, and would like the ar
On 2012-12-30 17:32, Roy Smith wrote:
In article ,
Vlastimil Brom wrote:
you may check the new regex implementation for python
http://pypi.python.org/pypi/regex
Wow, I wasn't aware of such an effort.
At first reading, I'm amused by the concept of "strict fuzzy matching".
Those of us with
In article ,
Vlastimil Brom wrote:
> you may check the new regex implementation for python
> http://pypi.python.org/pypi/regex
Wow, I wasn't aware of such an effort.
At first reading, I'm amused by the concept of "strict fuzzy matching".
Those of us with long memories will be confused by the
2012/12/30 Helmut Jarausch :
> Hi,
>
> is there a means to specify that 'ignore-case' should only apply to a part
> of a regex?
>
> E.g.
>
> the regex should match Msg-id:, Msg-Id, ... but not msg-id: and so on.
>
> I've tried the pattern
> r'^Msg-(?:(?i)id):'
> but (?i) makes the whole pattern
On Mon, 2012-11-19 at 10:39 +, andrea crotti wrote:
> I have very long processes to spawn which I want to lauch as separate
> processes (and communicate with ZeroMQ), but now the problem is that the
> forked process appears in "ps" with the same name as the launcher
> process.
> This is a simpl
On Sun, Dec 30, 2012 at 10:20 AM, Roy Smith wrote:
> Helmut Jarausch wrote:
>
> > is there a means to specify that 'ignore-case' should only apply to a
> part
> > of a regex?
>
Python has excellent string methods. There seems to be a split between
people who first always grab regex for string
Helmut Jarausch wrote:
> is there a means to specify that 'ignore-case' should only apply to a part
> of a regex?
Not that I'm aware of.
> the regex should match Msg-id:, Msg-Id, ... but not msg-id: and so on.
What's the use-case for this?
The way I would typically do something like this
* Yuvraj Sharma [2012-12-28 01:37:23 -0800]:
> Use IDLE
> --
> http://mail.python.org/mailman/listinfo/python-list
>
The OP is already a proficient C, C++, perl, ... hacker using console based
tools and hardcore UNIX editors like vi(1) - I doubt he'll stay with IDLE for
very long - once you'
Hi,
is there a means to specify that 'ignore-case' should only apply to a part
of a regex?
E.g.
the regex should match Msg-id:, Msg-Id, ... but not msg-id: and so on.
I've tried the pattern
r'^Msg-(?:(?i)id):'
but (?i) makes the whole pattern ignoring case.
In my simple case I could say
r'M
Morten Guldager wrote:
> 'Aloha Friends!
>
> I'm trying to process some HTML using xml.etree.ElementTree
> Problem is that the HTML I'm trying to read have some not properly closed
> tags, as the shown in line 8 below.
>
> 1 from xml.etree import ElementTree
> 2
> 3 tree = ElementTree
>
On Sun, Dec 30, 2012 at 8:52 PM, Morten Guldager
wrote:
> Question is if it's possible to tweak xml.etree.ElementTree to accept, and
> understand sloppy html, or if you have suggestions for similar easy to use
> framework, preferably among the included batteries?
>
Check out BeautifulSoup, it's f
39 matches
Mail list logo