Jerry Hill, 22.08.2010 16:51:
Neither, as far as I know. The XML you get is perfectly valid XML.
It's clearly well-formed, but I can't see it being valid without some kind
of schema to validate it against.
Note that the OP has already written a follow-up but forgot to reply to the
origin
On 08/23/2010 01:10 AM, James Mills wrote:
On Mon, Aug 23, 2010 at 3:00 PM, Greg Bair wrote:
I have a method (I'll call it foo) that will either return None or an object
depending on a random value generated. What I want to happen is that if I
call foo(), i.e, f = foo() and it returns None
On Mon, Aug 23, 2010 at 3:00 PM, Greg Bair wrote:
> I have a method (I'll call it foo) that will either return None or an object
> depending on a random value generated. What I want to happen is that if I
> call foo(), i.e, f = foo() and it returns None, to re-call it until it
> returns something
I have a method (I'll call it foo) that will either return None or an
object depending on a random value generated. What I want to happen is
that if I call foo(), i.e, f = foo() and it returns None, to re-call it
until it returns something else. I would think this would be done with
a while l
On Mon, 23 Aug 2010 07:48:03 am Denis Gomes wrote:
> Nick,
>
>If you are using python 2.X, xrange(2,n) is just like range(2,n),
> the xrange function is faster. In python 3.X, they got rid of the
> slower range function and renamed xrange to range.
A slight over-simplification, but broadly co
On Mon, 23 Aug 2010 04:55:15 am Nick wrote:
> Is there a way I can set my email program to insert the ">" symbol to
> mark what I'm replying to without manually doing it?
Depends on your mail client.
What are you using? Outlook?
> I get the picture now, that was a great example. I wrote some
Nick,
If you are using python 2.X, xrange(2,n) is just like range(2,n), the
xrange function is faster. In python 3.X, they got rid of the slower range
function and renamed xrange to range. The x in [x for x in xrange...] will
just go from 2 to the number n, but not including n. This brings u
"Nick" wrote
Is there a way I can set my email program to insert
the ">" symbol to mark what I'm replying to without manually doing
it?
Give us a clue. What is your email program?
You can do it in most programs but the method will be different in
each!
HTH,
--
Alan Gauld
Author of the
Please try and reply to the list instead of just me.
raw_input did not the trick.
fruit.count is the next exercise.
Oke, I deleted the initialazion and change teller into letter.
Roelof
Should be alright now.. Hmmm
Can you paste your exact code AND the error you're getting? As I
understand
On 08/22/2010 09:35 PM, Roelof Wobben wrote:
Hello,
I made this programm :
def count_letters(n,a):
count = 0
for char in n:
if char == a:
count += 1
return count
fruit=""
letter=""
fruit= input("Enter a sort of fruit: ")
teller = input("Enter the character which
On 8/22/10, Roelof Wobben wrote:
>
> Hello,
>
>
>
> I made this programm :
>
>
>
> def count_letters(n,a):
> count = 0
> for char in n:
> if char == a:
> count += 1
> return count
>
> fruit=""
> letter=""
> fruit= input("Enter a sort of fruit: ")
> teller = input("E
"1 * 120 = 120
2 * 60 = 120
3 * 40 = 120
4 * 30 = 120
5 * 24 = 120
6 * 20 = 120
8 * 15 = 120
10 * 12 = 120
10.9545 * 10.9545 = 120
12 * 10 = 120 <=== already seen this one!
> Also I can write a program that
> tests whether the number is a factor of 2, 3, 5, 7, but I think
> you're trying to poin
On 08/22/2010 09:35 PM, Roelof Wobben wrote:
Hello,
I made this programm :
def count_letters(n,a):
count = 0
for char in n:
if char == a:
count += 1
return count
fruit=""
letter=""
fruit= input("Enter a sort of fruit: ")
teller = input("Enter the character which
Hello,
I made this programm :
def count_letters(n,a):
count = 0
for char in n:
if char == a:
count += 1
return count
fruit=""
letter=""
fruit= input("Enter a sort of fruit: ")
teller = input("Enter the character which must be counted: ")
x=count_letters (f
Hello,
Very wierd.
>From a python shell it works.
If a type it as module in SPE , it doesn't work.
Roelof
> Date: Sun, 22 Aug 2010 19:47:09 +0200
> From: knack...@googlemail.com
> To: tutor@python.org
> Subject: Re: [Tutor] type() problem
>
>
> > fruit="ramadana"
> > print "fruit
fruit="ramadana"
print "fruit heeft als type", type(fruit)
y=len(fruit)
print y
z=fruit[:3]
print z
These lines put in a module and executed print (using Python 2.7):
fruit heeft als type
8
ram
Strange that it doesn't work for you.
I can only advice you to check the file again or run the
Sorry wrong import!
from xml.minidom import parseString
from xml.etree import ElementTree
Karim
On 08/22/2010 05:24 PM, Karim wrote:
Hello Jerry,
Tricky solution using minidom (standard) Not tested:
import ElementTree
import minidom
def prettyPrint(element):
txt = ElementTree.tostring(
On Fri, Aug 20, 2010 at 3:49 AM, Knacktus wrote:
> Hi guys,
>
> I'm using Python 2.7 and the ElementTree standard-lib to write some xml.
>
> My output xml has no line breaks! So, it looks like that:
>
>
>
> instead of something like this:
>
>
>
>
>
> I'm aware of lxml which seems to have a
Hello,
This is my exercise:
Write Python code to make each of the following doctests pass:
"""
>>> type(fruit)
>>> len(fruit)
8
>>> fruit[:3]
'ram'
"""
I have made this :
>>> type(fruit)
>>> len(fruit)
8
>>> fruit[:3]
'ram'
"""
fruit="ramadana"
print "fruit
"Nick" wrote
I think I'm doing everything correctly now, but please tell me what
I'm not-- if such is the case.
One last thing - change the subject line to reflect the actual
subject.
Alan G.
___
Tutor maillist - Tutor@python.org
To unsub
20 matches
Mail list logo