On Thu, Apr 16, 2009 at 3:45 PM, mbikinyi brat wrote:
> Dear ALL,
> I am a beginner in python and I just copied the code in blue below and
> execute and had the result in green. Then I thought *letter* should be a
> special word in python. Then I now replace letter whith *chic* and yet
> the same
for letter in "python":
> print "Current letter:", letter
for chic in "python":
> print "chic:", chic
When you write a for-in loop, you can use any variable name you feel
like using (letter, chic, mycoolvariable, x, etc.) It's that simple :)
Alan
__
Martin Walsh wrote:
> johnf wrote:
>> On Thursday 16 April 2009 05:04:39 pm Alan Gauld wrote:
>>> "johnf" wrote
>>>
> I want to save the list to the field and when I retrieve the string
> convert
> it back to a list.
>
> But this does NOT work.
> mylist=[1,2,3,4]
> myst
johnf wrote:
> On Thursday 16 April 2009 05:04:39 pm Alan Gauld wrote:
>> "johnf" wrote
>>
I want to save the list to the field and when I retrieve the string
convert
it back to a list.
But this does NOT work.
mylist=[1,2,3,4]
mystr=str(mylist)
newlist=
On Thursday 16 April 2009 05:04:39 pm Alan Gauld wrote:
> "johnf" wrote
>
> >> I want to save the list to the field and when I retrieve the string
> >> convert
> >> it back to a list.
> >>
> >> But this does NOT work.
> >> mylist=[1,2,3,4]
> >> mystr=str(mylist)
> >>
> >> newlist= list(mystr)
> >>
"johnf" wrote
I want to save the list to the field and when I retrieve the string
convert
it back to a list.
But this does NOT work.
mylist=[1,2,3,4]
mystr=str(mylist)
newlist= list(mystr)
I keep thinking there must be a simple way of get this done.
Is this a good way?
newlist = eval(mys
On Thu, Apr 16, 2009 at 6:52 PM, johnf wrote:
> I am dealing with a database field that can only store strings.
> I want to save the list to the field and when I retrieve the string convert it
> back to a list.
>
> But this does NOT work.
> mylist=[1,2,3,4]
> mystr=str(mylist)
>
> newlist= list(my
Weidner, Ronald wrote:
> One of your points represents a great opportunity to make mine. Suppose
> this code is several years old. Now we have a new requirement that
> states we need to work with the data as you described above. How
> much of the existing code would you have to change to make th
On Thursday 16 April 2009 03:52:02 pm johnf wrote:
> I am dealing with a database field that can only store strings.
> I want to save the list to the field and when I retrieve the string convert
> it back to a list.
>
> But this does NOT work.
> mylist=[1,2,3,4]
> mystr=str(mylist)
>
> newlist= lis
I am dealing with a database field that can only store strings.
I want to save the list to the field and when I retrieve the string convert it
back to a list.
But this does NOT work.
mylist=[1,2,3,4]
mystr=str(mylist)
newlist= list(mystr)
I keep thinking there must be a simple way of get this d
"wesley chun" wrote
i'm trying to collate a complete newbie-to-programming list of
resources and was wondering if you could help me fill in the holes...
thx in advance!
What about the free (and even the pay for) videos on the
ShowMeDo site. I thought they were pretty good especially for
sh
def f(x):
>
> '''f(x) -> x+5'''
> return x+5
>
help(f)
>
> Help on function f in module __main__:
>
> f(x)
> f(x) -> x+5
another thing that has not been mentioned is that if you put
docstrings everywhere, you can use tools like Epydoc, doxygen, or
sphinx to generate full documentation
wesley chun schrieb:
hey all,
...
Python: Visual QuickStart Guide (Fehily, 2001)
This is outdated. There is a new one:
Toby Donaldson: Python: Visual QuickStart Guide (2008)
Learn to Program Using Python (Gauld, 2000)
ONLINE
How to Think like a Computer Scientist
http://openbookproject
"mbikinyi brat" wrote
Then I thought letter should be a special word in python.
Why did you think that?
Python has a very specific (and small) set of keywords that have
special meaning - things like for, while and print
But you can call variables pretty much whatever you like and
Python
"wesley chun" wrote
Alan Gauld's Learning to Program
http://www.freenetpages.co.uk/hp/alan.gauld
Now at:
http://www.alan-g.me.uk/ for Python v2.x
http://www.alan-g.me.uk/l2p for Python v3 and under construction,
although well on th
"mbikinyi brat" wrote
I have defined variables as below and when I call them using
the print function, I have something discontinous as in pink colour.
How do I call it so that my output should be as in blue
print counter
101
print miles
1000
print name
joe
This is because you are u
"Logan Thomas" wrote
I'm new to python but do have a little programming knowledge with
C++I
got into programming so I could build Virtual Instruments because I love
the
world of sound and creating instruments that shape it..I was wondering if
you could direct me to some tutorials or sour
"mbikinyi brat" wrote
What is really the importance of Docstring in Python???
Some really great comments about comments, however the
significance of docstrings beyond normal comments is that
tools like help() work with them
Thus:
def f(x):
'''f(x) -> x+5'''
return x+5
help(f)
Help
wesley chun wrote:
hey all,
i'm trying to collate a complete newbie-to-programming list of
resources and was wondering if you could help me fill in the holes...
thx in advance!
Hi wesley,
A couple I liked;
One Day of IDLE Toying
http://hkn.eecs.berkeley.edu/~dyoo/python/idle_intro/index.html
mbikinyi brat wrote:
Dear ALL,
I am a beginner in python and I just copied the code in blue below and
execute and had the result in green. Then I thought *letter* should be a
special word in python. Then I now replace letter whith *chic* and yet
the same results is obtained.
of course -- c
Dear ALL,
I am a beginner in python and I just copied the code in blue below and execute
and had the result in green. Then I thought letter should be a special word in
python. Then I now replace letter whith chic and yet the same results is
obtained. I cannot reconcile them. Can someone explain
hey all,
i'm trying to collate a complete newbie-to-programming list of
resources and was wondering if you could help me fill in the holes...
thx in advance!
BOOKS
Python Programming for the Absolute Beginner (Dawson, 2005)
Python For Dummies (Maruch, Maruch, 2006)
Python Programming: An Introduc
mbikinyi brat wrote:
Dear ALL,
I have defined variables as below and when I call them using the print
function, I have something discontinous as in pink colour. How do I call it so
that my output should be as in blue
counter=101
miles=1000
name="joe"
print counter
try this print str(counter) + "\n" + str(miles) + "\n"+ name
On Thu, Apr 16, 2009 at 11:24 PM, mbikinyi brat wrote:
> **
> *Dear ALL,*
> I have defined variables as below and when I call them using the print
> function, I have something discontinous as in pink colour. How do I call it
> so that m
On Thu, Apr 16, 2009 at 1:37 PM, Spencer Parker wrote:
> I have a script that is putting elements into a list. Now instead of adding
> a for blah in blah statement...is there an easy way to print out the
> elements in a list that is similar to this? I don't have an absolute length
> on the size
Forwarding to the list
-- Forwarded message --
From: GG Labs 10
Date: Thu, Apr 16, 2009 at 10:28 AM
Subject: Re: [Tutor] Import Modules
To: Kent Johnson
Thankyou,
i think i've understood the problem.
Now, another App Engine related question:
This code:
---
import google
p
Dear ALL,
I have defined variables as below and when I call them using the print
function, I have something discontinous as in pink colour. How do I call it so
that my output should be as in blue
>>> counter=101
>>> miles=1000
>>> name="joe"
>>> print counter
101
>>> print miles
1000
>>> print
Le Thu, 16 Apr 2009 11:37:35 -0600,
Spencer Parker s'exprima ainsi:
> trying to clean up
> messy code for the most part
How does it look like?
Denis
--
la vita e estrany
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listin
Hi All,
Not sure if it's common knowledge, particularly for those who didn't
make it to PyCon this year, but all of the talks were recorded and will
be available online in good time, thanks to Carl Karsten and his merry
band of A/V volunteers. I can't even begin to grasp how much work is
required
I have a script that is putting elements into a list. Now instead of adding
a for blah in blah statement...is there an easy way to print out the
elements in a list that is similar to this? I don't have an absolute length
on the size of the list either since it changes depending on what I am
searc
Albert,
That was a great writeup on docstrings. I'm going to share that with my
dev team.
Thank you!
Malcolm
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Thu, Apr 16, 2009 at 6:59 AM, spir wrote:
> Hello,
>
> I have no clue whether there is a common place to publish some (free like the
> air) python source code for review, use, evolution...
> (It's about 17 5kb.)
If you just want a temporary place to put it for comments then
pastebin is good.
2009/4/16 spir :
> I have no clue whether there is a common place to publish some (free like the
> air) python source code for review, use, evolution...
> (It's about 17 5kb.)
Maybe http://python.pastebin.com is what you are looking for?
Greets
Sander
I'm new to python but do have a little programming knowledge with C++I
got into programming so I could build Virtual Instruments because I love the
world of sound and creating instruments that shape it...I have tried to find
a program that would be an ideal vehicle for this task...I've narrowed
Hello,
I have no clue whether there is a common place to publish some (free like the
air) python source code for review, use, evolution...
(It's about 17 5kb.)
Denis
--
la vita e estrany
___
Tutor maillist - Tutor@python.org
http://mail.python.or
Hello,
This question is rather intended to people who have some knowledge on parser
generation and/or on self-compiling languages.
I have a custom PEG parser generator in python, called 'pijnu', just
bootstrapped. Meaning it's a kind of specific language which generator
(compiler) is able to pr
On Thu, Apr 16, 2009 at 3:21 AM, ALAN GAULD wrote:
>
>
>> In general, importing a package does not give access to members of a
>> sub-package.
>
> Interestingly I added the comment about sub packages specifically
> because I remembered os.path and assumed it was the norm! :-)
Yes, it took me a lo
mbikinyi brat wrote:
Dear ALL,
What is really the importance of Docstring in Python???
Regards,
Henry
The same as comments, except at function, class, and module level. In
addition, Python provides hooks for extracting that information, and eg put it
in a document such as the standardlib docu
Le Thu, 16 Apr 2009 02:04:25 -0700 (PDT),
mbikinyi brat s'exprima ainsi:
> Dear ALL,
> What is really the importance of Docstring in Python???
> Regards,
> Henry
Very very very great, I guess ;-)
Denis
--
la vita e estrany
___
Tutor maillis
Dear ALL,
What is really the importance of Docstring in Python???
Regards,
Henry
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
> In general, importing a package does not give access to members of a
> sub-package. You have to explicitly import the subpackage. For
> example,
>
> In [1]: import xml
> In [2]: xml.dom.Node
> ---
> AttributeError
41 matches
Mail list logo