Greetings all,
Are there any programs for python that offer an "interactive" tutorial?
Something on the lines of the builtin emacs tutorial (which is
basically just a buffer that tells you to try this and try that with
itself) or the Inkscape tutorial (which is an SVG document that comes
along w
Hi ALL
I have gone through the object oriented programming in Python, I am
not able to understand OOP concept in python,
is there a methodical way to understand it and simplfy things
Thanks in Advance
Regards
Kaushal
___
Tutor maillist - Tutor@pyth
[EMAIL PROTECTED] wrote:
> anchor.findNext('code') fails:
>
> anchor = soup.fetch('a', {'href': '/wiki/List_of_country_calling_codes'})
> print anchor
>
> [Calling code]
>
> anchor.findNext('code')
> []
are you sure that's what you got? Looks like an AttributeError to me -
anchor is a *li
Terry Carroll wrote:
freq = {}
sampletext = "norwegian blue"
for char in sampletext:
>
> ... freq[char] = freq.setdefault(char,0)+1
Although I'm a big fan of setdefault() I think this particular example
is better written as
freq[char] = freq.get(char,0)+1
There is no need to s
Carroll, Barry wrote:
> Greetings:
>
> What is the purpose of the dictionary method setdefault(k[, x])?
setdefault() is perhaps badly named, but it is very useful. It doesn't
do what you think it does! From the docs:
setdefault() is like get(), except that if k is missing, x is both
return
On 28/03/06, Carroll, Barry <[EMAIL PROTECTED]> wrote:
> 1. Access by name (dict)
> 2. Access by position (list)
> 3. Addition of new items (dict, list)
> 4. Set a 'last used' item (??)
> 5. Set a 'default' item (dict???)
Probably your best bet is to define y
On Mon, 27 Mar 2006, Carroll, Barry wrote:
> So, what then is the proper use of setdefault()? And, if d.setdefault
> does not actually assign a default value for d, is there a way to do
> this?
It's a somewhat misleading name, but setdefault a) looks up an entry in a
dictionary and c) returns i
Greetings:
I have a function that computes the checksum of an integer, including or
excluding digits in the computation based on the content of a mask string. For
example,
cksum(123456789, '***...***')
will do its computation on 123789, masking out the three non-significant
digits.
M
On Monday 27 March 2006 22:21, Steve Slevinski wrote:
> Does this sound reasonable? Are their any alternatives to Movable
> Python? (http://www.voidspace.org.uk/python/movpy/)
Hi Steve,
I've got no experience of setting up such a beast or using movable python, but
I just wanted to say it sounds
Greetings:
What is the purpose of the dictionary method setdefault(k[, x])?
For example assume the following dictionary:
>>> colors = {'green':(0,255,0), 'red':(255,0,0), 'blue':(0,0,255),
>>> 'white':(255,255,255), 'black':(0,0,0)}
>>>
Now, execute the statement:
>>> colors.setdefault('black
Hi list,
I like the idea of portable apps. Load a USB drive and you're ready to go.
I am switching from PHP to Python and I'm curious if anyone has tried
using USB sticks for either development or distribution?
I was looking at purchasing Movable Python for a USB stick. I was then
going to l
> Can you please give me a quick example of how to do this:
Nevermind. I figured it out. Thanks anyway :-)
Patty
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
[EMAIL PROTECTED] writes:
>>jonasmg at softhome.net wrote:
>>> Hi!
>>>
>>> I'm trying to use BeautifulSoup for get data from a table (on right) from:
>>> http://en.wikipedia.org/wiki/United_states
>>>
>>> i.e. i would get data from 'Calling code' that it would be '+1'
>>>
>>>
Hi to all!
I'm playing around with VideoCapture and vpython, both open a secondary
window with nice images on it, well the one with my face is not so
great, anyway I wish to grab the content and put it into a PIL Image, in
VideoCapture there are a methods called saveSnapshot and getImage, but
some
Hi,
Can you please give me a quick example of how to do this:
> Then change printbox() to create the
> tag using a loop over the value. For each value, check to see if it is
> the same as the value passed in and generate the appropriate option tag.
The way i have it right now is:
hi, I face a typical problem that most python programmers face. Most users only want a click and run kind of thing..they are uninterested to install any software on their system , be it python or any other software..so the solution is to pack the code up as a py2exe program for windows and ask t
>jonasmg at softhome.net wrote:
>> Hi!
>>
>> I'm trying to use BeautifulSoup for get data from a table (on right) from:
>> http://en.wikipedia.org/wiki/United_states
>>
>> i.e. i would get data from 'Calling code' that it would be '+1'
>>
>> --
>>
>> import urll
>jonasmg at softhome.net wrote:
>> Hi!
>>
>> I'm trying to use BeautifulSoup for get data from a table (on right) from:
>> http://en.wikipedia.org/wiki/United_states
>>
>> i.e. i would get data from 'Calling code' that it would be '+1'
>>
>> --
>>
>> import urllib2
Ars wrote:
> Would a py2exe program be practical for a commercial program? I'd think
> people could read your source code too easily.
I think it is possible to create py2exe files that don't contain source
code, just compiled pyc files.
Kent
___
Tutor
Keo Sophon wrote:
> On Monday 27 March 2006 10:38, Ars wrote:
>
>>>On 27/03/06, Keo Sophon <[EMAIL PROTECTED]> wrote:
>>>
hi all,
Does anyone know how to compile a python filename.py to an executable
>>
>>file?
>>
>
>
> I don't know how python creates executable file. The purpose is
Hi jack, You are right. py2exe may not fit well in commercial software products that arent in the open source model. An executable that was py2exe'd could well be converted back to the source.. I feel that its one of the restrictions thats in the way of enterprization of python...(agreed google u
[EMAIL PROTECTED] wrote:
> Hi!
>
> I'm trying to use BeautifulSoup for get data from a table (on right) from:
> http://en.wikipedia.org/wiki/United_states
>
> i.e. i would get data from 'Calling code' that it would be '+1'
>
> --
>
> import urllib2
> from BeautifulSoup
Hi!
I'm trying to use BeautifulSoup for get data from a table (on right) from:
http://en.wikipedia.org/wiki/United_states
i.e. i would get data from 'Calling code' that it would be '+1'
--
import urllib2
from BeautifulSoup import BeautifulSoup
url="http://en.wikipedia
On 3/27/06, josip <[EMAIL PROTECTED]> wrote:
> Can someone give me exercises to do with loops, maybe functions to?
How about a program that produces truth tables for the basic gates?
AND, NAND, NOT, OR, XOR?
You could write a function for each gate, and one to produce a truth table.
S.
__
Hi, Python is my first language. I have finished loops, now I'm going to functions. I'm working with Learning Python 2ed book. Can someone give me exercises to do with loops, maybe functions to? Thanks
Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger wit
On 3/27/06, Noufal Ibrahim <[EMAIL PROTECTED]> wrote:
>
> On Mon, March 27, 2006 4:39 pm, Kaushal Shriyan wrote:
> > Hi
> >
> > I am a novice in Python, Which is the best source of learning python
> > for a beginner
>
> If you're already a "programmer", then the python tutorial at
> http://docs.pyt
On Mon, March 27, 2006 4:39 pm, Kaushal Shriyan wrote:
> Hi
>
> I am a novice in Python, Which is the best source of learning python
> for a beginner
If you're already a "programmer", then the python tutorial at
http://docs.python.org/tut/tut.html + a working python installation is
enough IMHO.
Kaushal Shriyan wrote:
> Hi
>
> I am a novice in Python, Which is the best source of learning python
> for a beginner
Read one of the tutorials listed here:
http://wiki.python.org/moin/BeginnersGuide/NonProgrammers
Write simple programs to try out what you have learned. Ask questions
here when
Hi
I am a novice in Python, Which is the best source of learning python
for a beginner
Regards
Kaushal
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On 26/03/06, Kent Johnson <[EMAIL PROTECTED]> wrote:
> Ed Singleton wrote:
> > How does one go about creating functions, classes, or callable objects
> > when you don't know their name in advance? (For example you want to
> > read their names in from a text file or database).
> >
> > I want to use
30 matches
Mail list logo