Chris Angelico wrote:
> On Fri, Nov 1, 2013 at 9:18 PM, Ulrich Goebel wrote:
>> That gives me the solution. What I have, is an iterator object comming as a
>> SQLite database cursor object. So I could minimize the underliying SELECT
>> and build index = list(cursor). Then with Your hints I get wh
On Fri, Nov 1, 2013 at 9:18 PM, Ulrich Goebel wrote:
> That gives me the solution. What I have, is an iterator object comming as a
> SQLite database cursor object. So I could minimize the underliying SELECT
> and build index = list(cursor). Then with Your hints I get what I want.
Looks good! If y
Hi
Am 31.10.2013 23:35, schrieb Terry Reedy:
On 10/31/2013 5:29 PM, Ulrich Goebel wrote:
I'm locking for an "iterator" type with not only the .next() method, but
with a .previous(), .first() and .last() method, so that I can through
it from the beginning or from the end, and in both directions
On Thu, Oct 31, 2013 at 2:29 PM, Ulrich Goebel wrote:
> Hallo,
>
> I'm locking for an "iterator" type with not only the .next() method, but
> with a .previous(), .first() and .last() method, so that I can through it
> from the beginning or from the end, and in both directions, even
> alternately
On 10/31/2013 5:29 PM, Ulrich Goebel wrote:
I'm locking for an "iterator" type with not only the .next() method, but
with a .previous(), .first() and .last() method, so that I can through
it from the beginning or from the end, and in both directions, even
alternately (for example two steps forwa
On 2013-10-31, Ulrich Goebel wrote:
> I'm locking for an "iterator" type with not only the .next() method, but
> with a .previous(), .first() and .last() method, so that I can through
> it from the beginning or from the end, and in both directions, even
> alternately (for example two steps forwa
Hallo,
I'm locking for an "iterator" type with not only the .next() method, but
with a .previous(), .first() and .last() method, so that I can through
it from the beginning or from the end, and in both directions, even
alternately (for example two steps forward, one backward, two steps
forwar
On 09/05/2012 04:03 AM, Mark Lawrence wrote:
> On 05/09/2012 07:28, charvigro...@gmail.com wrote:
>> Hi,
>>
>> I have attached python interview questions and answers for beginners.
>>
>> Please visit http://www.f2finterview.com/web/CorePython/ for core
>> python and
>>
>> http://www.f2finterview.co
On 05/09/2012 07:28, charvigro...@gmail.com wrote:
Hi,
I have attached python interview questions and answers for beginners.
Please visit http://www.f2finterview.com/web/CorePython/ for core python and
http://www.f2finterview.com/web/PythonAdvanced/ for advanced python
The first question f
Hi,
I have attached python interview questions and answers for beginners.
Please visit http://www.f2finterview.com/web/CorePython/ for core python and
http://www.f2finterview.com/web/PythonAdvanced/ for advanced python
On Thursday, August 30, 2012 5:24:08 PM UTC+5:30, (unknown) wrote:
> Hello
On 8/30/2012 9:30 AM, Oscar Benjamin wrote:
On Thu, 30 Aug 2012 09:23:03 -0400, Dave Angel wrote:
I haven't discovered why sometimes the type output shows type
instead of
class. There are other ways of defining classes, however, and
perhaps
this is using one of them. Still, it is a class,
On 30/08/12 14:49:54, Ulrich Eckhardt wrote:
> Am 30.08.2012 13:54, schrieb boltar2003@boltar.world:
> s = os.stat(".")
> print s
>> posix.stat_result(st_mode=16877, st_ino=2278764L, st_dev=2053L,
>> st_nlink=2, st_u
>> id=1000, st_gid=100, st_size=4096L, st_atime=1346327745,
>> st_mtime=13
Am 30.08.2012 15:27, schrieb Marco Nawijn:
On Thursday, August 30, 2012 3:15:03 PM UTC+2, Ulrich Eckhardt wrote:
Am 30.08.2012 13:54, schrieb boltar2003@boltar.world:
What sort of object is posix.stat_result?
[...]
I guess that this is a named tuple, which is a tuple where the
attributes are
On Thu, 30 Aug 2012 09:23:03 -0400, Dave Angel wrote:
I haven't discovered why sometimes the type output shows type
instead of
class. There are other ways of defining classes, however, and
perhaps
this is using one of them. Still, it is a class, and stat() is
returning an instance of that
On Thursday, August 30, 2012 3:15:03 PM UTC+2, Ulrich Eckhardt wrote:
> Am 30.08.2012 13:54, schrieb boltar2003@boltar.world:
>
> s = os.stat(".")
>
> print s
>
> > posix.stat_result(st_mode=16877, st_ino=2278764L, st_dev=2053L, st_nlink=2,
> > st_u
>
> > id=1000, st_gid=100, st_size
On Thu, 30 Aug 2012 23:06:34 +1000
Chris Angelico wrote:
>Yep, you're using Python 2. A few things are subtly different. Unless
>you have good reason not to, do consider moving to Python 3; all sorts
Noted. Thanks.
B2003
--
http://mail.python.org/mailman/listinfo/python-list
On 08/30/2012 08:50 AM, boltar2003@boltar.world wrote:
> On Thu, 30 Aug 2012 13:14:57 +0100
> MRAB wrote:
>
> If its a class , why is it when I create my own class I get a completely
> different output with print and type?
>
class foo(object):
> .. def __init__(self):
> .. pa
Am 30.08.2012 13:54, schrieb boltar2003@boltar.world:
s = os.stat(".")
print s
posix.stat_result(st_mode=16877, st_ino=2278764L, st_dev=2053L, st_nlink=2, st_u
id=1000, st_gid=100, st_size=4096L, st_atime=1346327745, st_mtime=1346327754, st
_ctime=1346327754)
What sort of object is posix.stat_r
On Thu, Aug 30, 2012 at 10:50 PM, wrote:
> On Thu, 30 Aug 2012 13:14:57 +0100
> MRAB wrote:
>>What don't you ask Python? I'm sure you'' get something like this:
>>
>> >>> type(s)
>>
>
> Umm , no I don't.
>
type(s)
>
>
> Which isn't terrible helpful.
That's actually the same thing, except
On Thu, 30 Aug 2012 08:25:33 -0400
Dave Angel wrote:
>You can get more documentation directly from s by simply typing
>help(s) and/or help(os.stat)
I didn't know about help(). Thanks!
B2003
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 30 Aug 2012 13:14:57 +0100
MRAB wrote:
>On 30/08/2012 12:54, boltar2003@boltar.world wrote:
>> Hello
>>
>> I'm slowly teaching myself python so apologies if this is a dumb question.
>> but something has confused me with the os.stat() function:
>>
> s = os.stat(".")
> print s
>> pos
On Thu, Aug 30, 2012 at 9:54 PM, wrote:
> What sort of object is posix.stat_result? Its not a dictionary or list or a
> class object as far as I can tell. Thanks for any help.
There's some cool things you can do here. (Note that I'm testing this
on a Windows box, so it's marginally different.)
On 08/30/2012 07:54 AM, boltar2003@boltar.world wrote:
> Hello
>
> I'm slowly teaching myself python so apologies if this is a dumb question.
> but something has confused me with the os.stat() function:
>
s = os.stat(".")
print s
> posix.stat_result(st_mode=16877, st_ino=2278764L, st_dev=
On Thursday, August 30, 2012 1:54:08 PM UTC+2, (unknown) wrote:
> Hello
>
>
>
> I'm slowly teaching myself python so apologies if this is a dumb question.
>
> but something has confused me with the os.stat() function:
>
>
>
> >>> s = os.stat(".")
>
> >>> print s
>
> posix.stat_result(st_mo
In article ,
MRAB wrote:
> What don't you ask Python? I'm sure you'' get something like this:
>
> >>> type(s)
>
BTW, this points out one of the really powerful aspects of Python. The
combination of introspection and a handy interactive interpreter makes
it easy to "just ask the computer".
On 30/08/2012 12:54, boltar2003@boltar.world wrote:
Hello
I'm slowly teaching myself python so apologies if this is a dumb question.
but something has confused me with the os.stat() function:
s = os.stat(".")
print s
posix.stat_result(st_mode=16877, st_ino=2278764L, st_dev=2053L, st_nlink=2,
Hello
I'm slowly teaching myself python so apologies if this is a dumb question.
but something has confused me with the os.stat() function:
>>> s = os.stat(".")
>>> print s
posix.stat_result(st_mode=16877, st_ino=2278764L, st_dev=2053L, st_nlink=2, st_u
id=1000, st_gid=100, st_size=4096L, st_atim
On Sat, 18 Jul 2009 03:03:32 +0100, gabrielmonnerat
wrote:
Ronn Ross wrote:
How do you define a global variable in a class. I tried this with do
success:
class ClassName:
global_var = 1
def some_methos():
print global_var
This doesn't work. What am I doing wrong?
You ne
En Fri, 17 Jul 2009 22:42:43 -0300, Ronn Ross
escribió:
How do you define a global variable in a class. I tried this with do
success:
class ClassName:
global_var = 1
def some_method(self):
print global_var
This doesn't work. What am I doing wrong?
[some typos fixed]
In Pyth
nohics nohics wrote:
When defining your class methods, you /must/ explicitly list self as
the first argument for each method, including __init__. When you call
a method of an ancestor class from within your class, you /must/
include the self argument. But when you call your class method from
o
When defining your class methods, you *must* explicitly list self as the
first argument for each method, including __init__. When you call a method
of an ancestor class from within your class, you *must* include the
selfargument. But when you call your class method from outside, you do
not
specify
On Fri, 2009-07-17 at 21:42 -0400, Ronn Ross wrote:
> How do you define a global variable in a class.
I bit of a mix-up with words here. A variable can be a class variable
or a global variable (wrt the module).. not both.
> I tried this with do success:
> class ClassName:
> global_var = 1
>
Ronn Ross wrote:
How do you define a global variable in a class. I tried this with do
success:
class ClassName:
global_var = 1
def some_methos():
print global_var
This doesn't work. What am I doing wrong?
You need pass "self" to the function and "global_var" needs be called
How do you define a global variable in a class. I tried this with do
success:
class ClassName:
global_var = 1
def some_methos():
print global_var
This doesn't work. What am I doing wrong?
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 21 Mar 2008 13:34:27 -0700, John Machin wrote:
> On Mar 22, 2:53 am, klaus <[EMAIL PROTECTED]> wrote:
>> On Fri, 21 Mar 2008 10:31:20 -0500, Tim Chase wrote:
>>
>> <..>
>>
>> Ok thank you !
>>
>> I think I got a bit lost in all the possibilities python has to offer.
>
> IMHO you g
On Mar 22, 2:53 am, klaus <[EMAIL PROTECTED]> wrote:
> On Fri, 21 Mar 2008 10:31:20 -0500, Tim Chase wrote:
>
> <..>
>
> Ok thank you !
>
> I think I got a bit lost in all the possibilities python has to offer.
IMHO you got more than a bit lost. You seem to have stumbled on a
possibly unin
On Fri, 21 Mar 2008 10:31:20 -0500, Tim Chase wrote:
<..>
Ok thank you !
I think I got a bit lost in all the possibilities python has to offer.
But your answers did the trick.
Thank you all again for responding and elaborating.
Cheers,
KL.
--
http://mail.python.org/mailman/listinfo
klaus schrieb:
> Hello,
>
> I have a question regarding the return value of re.split() since I have
> been unable to find any answers in the regular sources of documentation.
>
> Please consider the following:
>
> #!/usr/bin/env python
>
> import re
>
> if __name__ == "__main__":
> datum
> datum = "2008-03-14"
> the_date = re.split('^([0-9]{4})-([0-9]{2})-([0-9]{2})$', datum, 3)
> print the_date
>
> Now the result that is printed is:
> ['', '2008', '03', '14', '']
>
> My question: what are the empty strings doing there in the beginning and
> in the end ? Is this due
Hello,
I have a question regarding the return value of re.split() since I have
been unable to find any answers in the regular sources of documentation.
Please consider the following:
#!/usr/bin/env python
import re
if __name__ == "__main__":
datum = "2008-03-14"
the_date = re.split('^
On Wed, 19 Mar 2008 05:57:04 -0500, Tim Chase wrote:
>> class example:
>> def __init__(self, foo, bar):
>> self.foo = foo
>> self.bar = bar
>>
>> def method(self):
>> print "method ... :"
>> print self.foo
>> print self.bar
>>
>> if __name__ == "__
On Mar 19, 9:40 pm, klaus <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm trying to learn python programming and so far so good. However when
> trying to master the oop side I ran into a small problem.
>
> I think I've done everything ok as outlined below. But I just don't
> understand why the `method'
> class example:
> def __init__(self, foo, bar):
> self.foo = foo
> self.bar = bar
>
> def method(self):
> print "method ... :"
> print self.foo
> print self.bar
>
> if __name__ == "__main__":
> obj = example
This makes "obj" a synonym for "e
Hello,
I'm trying to learn python programming and so far so good. However when
trying to master the oop side I ran into a small problem.
I think I've done everything ok as outlined below. But I just don't
understand why the `method' of `class' example isn't printing any of the
variables that I
Albert van der Horst schrieb:
> I'm starting with Python. First with some interactive things,
> working through the tutorial,
> then with definitions in a file called sudoku.py.
> Of course I make lots of mistakes, so I have to include that file
> time and again.
>
> I discovered (the hard way) th
I'm starting with Python. First with some interactive things,
working through the tutorial,
then with definitions in a file called sudoku.py.
Of course I make lots of mistakes, so I have to include that file
time and again.
I discovered (the hard way) that the second time you invoke
from sudok
[EMAIL PROTECTED] wrote:
> Thx
> but is there any simpleir way, if using not class, but just struct (or
> something like that, MATLAB equivalent for that one)?
Use this::
>>> A = type('', (), {})
>>> a = A()
>>> a
<__main__. object at 0x009E8490>
>>> a.foo = 42
>>> a.foo
42
But perhaps usin
Thx
but is there any simpleir way, if using not class, but just struct (or
something like that, MATLAB equivalent for that one)?
I'm thinking of rewriting some optimization solvers (non-smooth,
constrained, with (sub)gradients or patterns provided by user) to
Python and I don't know currently is it
[EMAIL PROTECTED] wrote:
> Thx
> but is there any simpleir way, if using not class, but just struct (or
> something like that, MATLAB equivalent for that one)?
> I'm thinking of rewriting some optimization solvers (non-smooth,
> constrained, with (sub)gradients or patterns provided by user) to
> P
Thx
but is there any simpleir way, if using not class, but just struct (or
something like that, MATLAB equivalent for that one)?
I'm thinking of rewriting some optimization solvers (non-smooth,
constrained, with (sub)gradients or patterns provided by user) to
Python and I don't know currently is it
[EMAIL PROTECTED] wrote:
> I have
> class A:
> def __init__(self, objFun, x0):
> #(I want to have self.primal.f = objFun)
> #both
> self.primal.f = objFun
> #and
> self.primal = None
> self.primal.f = objFun
None is a singleton, so if Python were to
I have
class A:
def __init__(self, objFun, x0):
#(I want to have self.primal.f = objFun)
#both
self.primal.f = objFun
#and
self.primal = None
self.primal.f = objFun
yields error
what should I do?
Thx
--
http://mail.python.org/mailman/listinfo/pytho
Jeff Reavis wrote:
> Spyce has support for pooling
True, but as covered by this message:
http://sourceforge.net/mailarchive/forum.php?thread_id=6381534&forum_id=10008,
for my purpose, Spyce must run as proxy server. However, when running as
proxy, it seems that I can't (really) run virtual hosts
> I'm satisfied with concept of mps, however It's fine that author hate
> writing HTML, but I want to; or better, I want to use Cheetah Templates -
> i think they are better for bigger sites (then homepage) as the one I want
> to write.
Also, check out simpletal (http://www.owlfish.com/software/si
Dan Perl wrote:
> Have you looked at these links?
> http://www.python.org/pycon/papers/framework/web.html
> Dan
Thank You, I haven't found this one...exactly what I was looking for.
--
Lukas "Almad" Linhart
[:: http://www.almad.net/ ::]
[:: The stars are constantly shining, but often we d
Spyce has support for Cheetah Templates:
http://spyce.sourceforge.net/doc-mod_template.html
as well as pooling:
http://spyce.sourceforge.net/doc-mod_pool.html
Spyce templates are converted into python before execution, and you can
enable caching in the Spyce configuration file. Spyce also comes w
"Almad" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> I'm currently starting with Python as a language for writing websites. I
> must say that I'm overwhelmed by the number of choices I have (mod_python
> with publisher, Vampire, mps, Spyce), cgi, fcgi, Webware, Zope,
>
Hello,
I'm currently starting with Python as a language for writing websites. I
must say that I'm overwhelmed by the number of choices I have (mod_python
with publisher, Vampire, mps, Spyce), cgi, fcgi, Webware, Zope,
Plone, ...).
Isn't there any article in style "this suite use this style of p
58 matches
Mail list logo