I'm trying to read XML input from command line in Python3. So far I tried various method and following is my code for read XML,
import sys
import xml.dom.minidom
try:
input = sys.stdin.buffer
except AttributeError:
input = sys.stdin
xmlString = input.read()
But this continuedly getting inputs please someone can tell how to stop getting inputs after getting XML file
My XML file is,
<response>
<article>
<title>A Novel Approach to Image Classification, in a Cloud Computing Environment stability.</title>
<publicationtitle>IEEE Transactions on Cloud Computing</publicationtitle>
<abstract>Classification of items within PDF documents has always been challenging. This stability document will discuss a simple classification algorithm for indexing images within a PDF.</abstract>
</article>
<body>
<sec>
<label>I.</label>
<p>Should Haven't That is a bunch of text pattern these classification and cyrptography. These paragraphs are nothing but nonsense. What is the statbility of your program to find neural nets. Throw in some numbers to see if you get the word count correct this is a classification this in my nd and rd words. What the heck throw in cryptography.</p>
<p>I bet diseases you can't find probability twice. Here it is a again probability. Just to fool you I added it three times probability. Does this make any pattern classification? pattern classification! pattern classification.</p>
<p>
<fig>
<label>FIGURE.</label>
<caption>This is a figure representing convolutional neural nets.</caption>
</fig>
</p>
</sec>
</body>
</response>
Since this has number of lines I cant input this from conventional way using input()