Why are some methods/functions named in this way in python? __len__
underscoreunderscoreNAMEunderscoreunderscore
Is there any speciality of naming such methods?
--- On Sun, 6/24/12, Ian Kelly wrote:
From: Ian Kelly
Subject: Re: How can i call array_length to get the length of array object?
To
Josh English wrote:
> I'm creating a cmd.Cmd class, and I have developed a helper method to
> easily handle help_xxx methods.
>
> I'm trying to figure out if there is an even lazier way I could do this
> with decorators.
>
> Here is the code:
> *
> import cmd
>
>
> def add_
@Ian,
The function name in arraymodule.c file is array_len but you have to call
something like: , why?
>>>arr=array('i',[5,8,7])
>>>lg=arr.__len__()
>>>print(lg)
Why __len__() where the original name if array_length? Why is method names like
__NAME__ ?
--- On Sun, 6/24/12, gmspro wrote:
Fro
@Ian,
The function name in arraymodule.c file is array_len but you have to call
something like: , why?
>>>arr=array('i',[5,8,7])
>>>lg=arr.__len__()
>>>print(lg)
Why __len__() where the original name if array_length? Why is method named like
__NAME__ ?
--- On Sun, 6/24/12, gmspro wrote:
Fro
Hi,
Now how can i write the p.py to take the username after submit button click and
display on webpage?
How to run web server too? How can i make it work under apache2 ?
#!/path/to/python3
...
Any answer will be highly appreciated.
Thanks.
--
http://mail.python.org/mailman/
gmspro, 24.06.2012 10:01:
> Why are some methods/functions named in this way in python? __len__
>
> underscoreunderscoreNAMEunderscoreunderscore
>
> Is there any speciality of naming such methods?
Yes. Look up "special methods" in the documentation.
You may have noticed the correspondence betwe
Hi,
I see there are some files here started with underscore(_) , is there any
convention of something for it?
http://hg.python.org/cpython/file/3b7230997425/Modules
_bisectmodule.c
_bz2module.c
_codecsmodule.c
_collectionsmodule.c
_cryptmodule.c
_csv.c
_curses_panel.c
_cursesmodule.c
_datetime
On Sun, Jun 24, 2012 at 6:42 PM, gmspro wrote:
>
> Hi,
>
> I see there are some files here started with underscore(_) , is there any
> convention of something for it?
>
> Is there any convention or something?
They're private implementations of public APIs. You can ignore them as
implementation de
gmspro, 24.06.2012 10:42:
> I see there are some files here started with underscore(_) , is there any
> convention of something for it?
>
> http://hg.python.org/cpython/file/3b7230997425/Modules
>
> _bisectmodule.c
> [...]
> _winapi.c
>
> Is there any convention or something?
Yes. Please read
gmspro, 24.06.2012 02:16:
> Why is python source code not available on github?
>
> Make it available on github so that we can git clone and work on source code.
github != git.
You can use git to work on the sources if you wish. Just install a
Mercurial plugin for it and clone the code from the s
gmspro wrote:
> Why is python source code not available on github?
>
> Make it available on github so that we can git clone and work on source
> code.
http://thread.gmane.org/gmane.comp.python.devel/121885/focus=122111
--
http://mail.python.org/mailman/listinfo/python-list
ATTENTION: Limited Time OFFER For F.REE!!
* You will be shocked With This Amazign OFFER!!
* Weight Loss Calculator .. Down.load F.ree
>> http://www.book-mall.com/offers/weightloss-calculator/
- The weight loss calculator allows you to estimate your weekly and
monthly weight loss. Just enter
Peter Otten <__pete...@web.de> wrote:
> gmspro wrote:
> > Why is python source code not available on github?
Why should every free software project be available on a single proprietary
platform?
Also, see:
http://arstechnica.com/business/2012/03/hacker-commandeers-github-to-prove-vuln-in-ruby/
On 24.06.2012, at 03:58, Josh English wrote:
> I'm creating a cmd.Cmd class, and I have developed a helper method to easily
> handle help_xxx methods.
When I need custom help processing I tend to simply override do_help().
Stefan
http://pypi.python.org/pypi/kmd
--
Stefan H. Holek
ste...@ep
On 24/06/2012 09:15, gmspro wrote:
Why __len__() where the original name if array_length? Why is method names like
__NAME__ ?
Why are you too bloody lazy to do any research before you post questions?
--
Cheers.
Mark Lawrence.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for your reply, Terry.
On Sun, Jun 24, 2012 at 1:12 AM, Terry Reedy wrote:
> On 6/23/2012 1:29 PM, Michael Gundlach wrote:
>
>> Am I do something wrong, or is this bug still not fixed? Any pointers
>
> would be appreciated. Python 2.6.6 (r266:84292, Dec 7 2011, 20:48:22)
>> on 64-bit L
Hi,
I posted this mail on Friday and received no replies..
I'm curious..
Is it because
1) Python is not the language to use for Facebook, use Javascript or XXX ??
instead ? Please tell.
2) I've missed the point and this is very well documented so RTFM (I
couldn't find it)
3) You guys don't use
On Mon, Jun 25, 2012 at 1:16 AM, Jerry Rocteur wrote:
>
> Hi,
>
> I posted this mail on Friday and received no replies..
>
> I'm curious..
>
> Is it because
>
> 1) Python is not the language to use for Facebook, use Javascript or XXX
> ?? instead ? Please tell.
> 2) I've missed the point and this
davecotef...@gmail.com wrote:
> On Monday, 9 April 2012 20:24:54 UTC-7, CM wrote:
>> Shot in the dark here: has any who reads this group been successful
>> with getting Python to programmatically post an image to Facebook?
>>
>> I've tried using fbconsole[1] and facepy[2], both of which apparen
This is the most active one, forked from the official facebook one
(when they used to maintain it themselves):
https://github.com/pythonforfacebook/facebook-sdk
On Mon, Jun 25, 2012 at 1:35 AM, Chris Angelico wrote:
> On Mon, Jun 25, 2012 at 1:16 AM, Jerry Rocteur
> wrote:
>>
>> Hi,
>>
>> I pos
The Quran on Human Embryonic Development
In the Holy Quran, God speaks about the stages of man’s embryonic
development:
“We created man from an extract of clay. Then We made him as a drop
in a place of settlement, firmly fixed. Then We made the drop into an
alaqah(leech, suspended thing, and b
Just hoping to get some opinions: Grok vs Django for REST? I've started
evaluating TastyPie with Django. Is there something similar for Grok?
I'm working on a project that will mostly be mobile-app based. Though there
will be a web interface, the mobile part is more important to us. Our data
mo
Tiffany - Read/Write Multipage-Tiff with PIL without PIL
Tiffany stands for any tiff. The tiny module solves a large set of
problems, has no dependencies and just works wherever Python works.
Tiffany was developed in the course of the *DiDo
On 6/19/2012 6:07 AM, Wolfgang Keller wrote:
And the lack of success of Python so far to replace, in your
application case, Labview, or, in my application case, all those
proprietary 4GL IDEs/frameworks/GUI builders (just check the success
that Realbasic has) proves imho that the Python communi
Well, I use wxFormBuilder for my embryonic GUIs, but I have no qualms (or is
that quorans) about changing the generated code to make it more efficient.
--
http://mail.python.org/mailman/listinfo/python-list
The code:
print("pre-chunkLine")
chunks=[]
try:
chunks=self.chunkLine (l)
except:
print("caught exception")
print (sys.exc_info()[:2])
Sorry, I left out:
er$ python3 --version
Python 3.2.3rc1
On 06/24/2012 03:26 PM, Charles Hixson wrote:
The code:
print("pre-chunkLine")
chunks=[]
try:
chunks=self.chunkLine (l)
except:
On Mon, Jun 25, 2012 at 8:26 AM, Charles Hixson
wrote:
> The code:
> finally:
> print ("at finally")
> print ("chunks =")
> produces this result:
> path 3...
Can you state more clearly the problem, please? I'm seeing output that
can't have come fr
On 24/06/2012 23:26, Charles Hixson wrote:
The code:
print("pre-chunkLine")
chunks=[]
try:
chunks=self.chunkLine (l)
except:
print("caught exception")
On 06/24/2012 06:30 PM, Charles Hixson wrote:
> Sorry, I left out:
> er$ python3 --version
> Python 3.2.3rc1
>
> On 06/24/2012 03:26 PM, Charles Hixson wrote:
>> The code:
>> print("pre-chunkLine")
>> chunks=[]
>> try:
>>
On 24/06/2012 23:36, Chris Angelico wrote:
On Mon, Jun 25, 2012 at 8:26 AM, Charles Hixson
wrote:
The code:
finally:
print ("at finally")
print ("chunks =")
produces this result:
path 3...
Can you state more clearly the problem, please? I'm se
On 06/24/2012 03:43 PM, MRAB wrote:
On 24/06/2012 23:26, Charles Hixson wrote:
The code:
print("pre-chunkLine")
chunks=[]
try:
chunks=self.chunkLine (l)
except:
On Mon, Jun 25, 2012 at 9:16 AM, Charles Hixson
wrote:
> But what I wanted was to catch any exception. A problem was happening and I
> had no clue as to what it was. (It turned out to be "self is not defined".
> A silly mistake, but a real one.)
>
> The odd thing was that if I ran it without th
On 06/24/2012 07:16 PM, Charles Hixson wrote:
> On 06/24/2012 03:43 PM, MRAB wrote:
>> On 24/06/2012 23:26, Charles Hixson wrote:
>>>
>>>
>>>
>> Don't use a bare "except"; it'll catch _any__exception. Catch only what
>> you expect.
>>
>> For all I know, it could be that the name "l" doesn't exist.
Mark Lawrence writes:
> On 24/06/2012 09:15, gmspro wrote:
>
> > Why __len__() where the original name if array_length? Why is method
> > names like __NAME__ ?
These are questions answered by getting a thorough grounding in the
fundamentals of Python. Please follow the Python tutorial
http://doc
Tiffany - Read/Write Multipage-Tiff with PIL without PIL
Tiffany stands for any tiff. The tiny module solves a large set of
problems, has no dependencies and just works wherever Python works.
Tiffany was developed in the course of the *DiDo
Tiffany - Read/Write Multipage-Tiff with PIL without PIL
Tiffany stands for any tiff. The tiny module solves a large set of
problems, has no dependencies and just works wherever Python works.
Tiffany was developed in the course of the *DiDo
Can any image(not for line plot, but for pixel set) lib behaves like a
person? that is to say:
when we are doing image processing( for exapmle,
http://www.freebasic.net/forum/viewtopic.php?f=17&t=20057&p=176300#p176300)
, the new image maybe have a bigger canvas size than the original
image's, and
You could implement REST protocol for Grok using
http://pypi.python.org/pypi/restkit/
2012/6/25 TG
> Just hoping to get some opinions: Grok vs Django for REST? I've started
> evaluating TastyPie with Django. Is there something similar for Grok?
>
> I'm working on a project that will mostly be mo
I have written a script to map a 2D numpy array(A) onto another array(B) of
different dimension. more than one element (of array A) are summed and
mapped to each element of array B. To achieve this I create a list where I
store the index of array A to be mapped to array B. The list is the
dimensio
On 06/24/2012 03:43 PM, Charles Hixson wrote:
On 06/24/2012 03:36 PM, Chris Angelico wrote:
On Mon, Jun 25, 2012 at 8:26 AM, Charles Hixson
wrote:
The code:
finally:
print ("at finally")
print ("chunks =")
produces this result:
path 3...
C
If you are not sure about the Exception, You can adopt a generic way of
handling exception.
try:
except Exception,e:
print str(e)
-Shambhu
-Original Message-
From: MRAB [mailto:pyt...@mrabarnett.plus.com]
Sent: 25/06/2012 4:14 AM
To: python-list@python.org
Subject: Re: e
On 6/25/2012 12:27 AM, Charles Hixson wrote:
> The documentation section covering the except statement could stand to
> be a *LOT* clearer. I read the sections on the except statement and
> exception handlers several times and couldn't figure out was the "as"
> argument of the except statement
43 matches
Mail list logo