Hi,
Pls take a look at this code:
--
>>> t1 = "1130748744"
>>> t2 = "461"
>>> t3 = "1130748744"
>>> t4 = "500"
>>> time1 = t1+"."+t2
>>> time2 = t3+"."+t4
>>> print time1, time2
1130748744.461 1130748744.500
>>> float(time2) - float(time1)
0.03934332275391
>>>
Why are there so m
Thanks Szabolcs and Laurence, it's not the crash of python but the
crash of cygwin. We can locate the line number but when we submit the
crash to cygwin's mail list, they told us they don't speak python. So
I'm just trying to re-produce the crash in C.
Regards,
Johnny
--
http://mail.python.org
Thanks for your tips Niemann:)
Regards,
Johnny
--
http://mail.python.org/mailman/listinfo/python-list
Szabolcs Nagy wrote:
> python creates bytecode (like java classes)
>
>
> you cannot translate python directly to c or machine code, but there
> are some projects you probably want to look into
>
>
> Pypy is a python implemetation in python and it can be used to
> translate a python scrip to c or l
Hi,
First, I want to know whether the python interpreter translate the
code directly into machine code, or translate it into C then into
machine code?
Second, if the codes are translated directly into machine codes, how
can I translate the codes into C COMPLETELY the same? if the codes are
tr
It looks like there isn't a last word of the differrences
--
http://mail.python.org/mailman/listinfo/python-list
Alex Martelli 写道:
> Johnny Lee <[EMAIL PROTECTED]> wrote:
>
> > But I still wonder what's the difference between the A().getMember and
> > A().member besides the style
>
> Without parentheses after it, getMember is a method. The difference
> between a meth
But I still wonder what's the difference between the A().getMember and
A().member besides the style
--
http://mail.python.org/mailman/listinfo/python-list
Peter Otten 写道:
> Johnny Lee wrote:
>
> > Class A:
> >def __init__(self):
> > self.member = 1
> >
> >def getMember(self):
> > return self.member
> >
> > a = A()
> >
> > So, is there any difference betw
Class A:
def __init__(self):
self.member = 1
def getMember(self):
return self.member
a = A()
So, is there any difference between a.member and a.getMember? thanks
for your help. :)
Regards,
Johnny
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden 写道:
> Good catch, John, I suspect this is a possibility so I've added the
> following note:
>
> """The Windows 2.4.1 build doesn't show this error, but the Cygwin 2.4.1
> build does still have uncollectable objects after a urllib2.urlopen(),
> so there may be a platform dependency her
Steve Holden wrote:
> Steve Holden wrote:
> > Johnny Lee wrote:
> > [...]
> >
> >>I've sent the source, thanks for your help.
> >>
> >
> > [...]
> > Preliminary result, in case this rings bells with people who use urllib2
> >
Steve Holden wrote:
> Johnny Lee wrote:
> > Alex Martelli wrote:
> >
> >>Johnny Lee <[EMAIL PROTECTED]> wrote:
> >> ...
> >>
> >>> try:
> >>> webPage = urllib2.urlopen(url)
> >>> excep
Alex Martelli wrote:
> Johnny Lee <[EMAIL PROTECTED]> wrote:
>...
> >try:
> > webPage = urllib2.urlopen(url)
> >except urllib2.URLError:
>...
> >webPage.close()
> >return True
> > --
Hi,
I was using urllib to grab urls from web. here is the work flow of
my program:
1. Get base url and max number of urls from user
2. Call filter to validate the base url
3. Read the source of the base url and grab all the urls from "href"
property of "a" tag
4. Call filter to validate every u
Hi,
I've met a problem while using anygui to create a GUI. Here is a
brief example from Dave:
###
def guidialog():
def ok(**kw):
win.destroy()
app.remove(win)
#
anygui.link(btn_ok, ok)
#
app.run()
return n #qtgui will NEVER get here
###
As you can see, the progra
Fredrik Lundh wrote:
> ".*" gives the longest possible match (you can think of it as searching back-
> wards from the right end). if you want to search for "everything until a
> given
> character", searching for "[^x]*x" is often a better choice than ".*x".
>
> in this case, I suggest using some
Hi,
I've met a problem in match a regular expression in python. Hope
any of you could help me. Here are the details:
I have many tags like this:
xxxhttp://xxx.xxx.xxx"; xxx>xxx
xx
xxxhttp://xxx.xxx.xxx"; xxx>xxx
.
And I want to find all the "http://xxx.xxx.
Roy Smith wrote:
>
> For closer control over output, use the write() function. You want
> something like:
>
> import sys
> for i in range(3):
>sys.stdout.write (str(i))
here is the output of my machine:
>>> import sys
>>> for i in range(3):
... sys.stdout.write(str(i))
...
012>>>
bruno modulix wrote:
>
> I dont see anything interesting nor problematic here. If you understand
> the difference between class attributes and instance attributes, the
> difference between mutating an object and rebinding a name, and the
> attribute lookup rules in Python, you'll find that all thi
Hi,
Look at the follow command in python command line, See what's
interesting?:)
>>> class A:
i = 0
>>> a = A()
>>> b = A()
>>> a.i = 1
>>> print a.i, b.i
1 0
---
>>> class A:
arr = []
>>> a = A()
>>> b = A()
>>> a
<__main__.A instance at 0x
Hi,
I've met a problem to understand the code at hand. And I wonder
whether there is any useful tools to provide me a way of step debug?
Just like the F10 in VC...
Thanks for your help.
Regards,
Johnny
--
http://mail.python.org/mailman/listinfo/python-list
Erik Max Francis wrote:
>
> You're going to have to be more clear; I don't understand your question.
> What's the difference between
>
> a = 1
>
> and
>
> b = 1
>
> besides the difference of name?
>
I thought there must be something special when you named a VAR with '_'
the first ch
Erik Max Francis wrote:
>
> No, of course not. One defines a class varaible named `_passxxx_', the
> other defines one named `passsxxx'.
>
I mean besides the difference of name...
--
http://mail.python.org/mailman/listinfo/python-list
As what you said, the following two code section is totally the same?
(I)
class TestResult:
_passxxx_ = "pass"
(II)
class TestResult:
passxxx = "pass"
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I'm new in python and I was wondering what's the difference between
the two code section below:
(I)
class TestResult:
_pass_ = "pass"
_fail_ = "fail"
_exception_ = "exception"
(II)
class TestResult:
pass = "pass"
fail = "fail"
exception = "ex
Here is the source:
#! /bin/python
[EMAIL PROTECTED] This is a xunit test framework for python, see TDD for more
details
class TestCase:
def setUp(self):
print "setUp in TestCase"
pass
def __init__(self, name):
print "__init__ in Te
27 matches
Mail list logo