Hello all,

I'm beginning in Python and I need to input some information in a declared variable, like this:

XML = """<?xml version="1.0" encoding="utf-8"?>
            <Authentication xmlns="http://xxx">
            <SendMessage xmlns="http://xxx">
			<Phone>[B]I need to input text here[/B]</Phone>

I search how to make this, I found anything related to raw_input(), but nothing useful is this case.


Re: Python Input 80 80

Function raw_input() would force the user to type in the entire XML code. I don't think you want this.

Normally the XML code would come from file, something like this:

fin = open("Myxml.xml", "r")
xml_string = fin.read()

# now the xml code is represented by xml_string for you to work on.
Re: Python Input 80 80

Solved! I'm using sys.argv[] for this issue.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.