<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://textserver.lsi.upc.edu/wiki/index.php?action=history&amp;feed=atom&amp;title=Python3_Batch_Client</id>
		<title>Python3 Batch Client - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://textserver.lsi.upc.edu/wiki/index.php?action=history&amp;feed=atom&amp;title=Python3_Batch_Client"/>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Batch_Client&amp;action=history"/>
		<updated>2026-05-07T05:49:01Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Batch_Client&amp;diff=164&amp;oldid=prev</id>
		<title>Padro at 09:33, 24 August 2018</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Batch_Client&amp;diff=164&amp;oldid=prev"/>
				<updated>2018-08-24T09:33:55Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 09:33, 24 August 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l34&quot; &gt;Line 34:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 34:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;dom = xml.etree.ElementTree.XML(resp)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;dom = xml.etree.ElementTree.XML(resp)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;tkid = dom.text &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;tkid = dom.text &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;print &amp;quot;Job sumbitted. Token id=&amp;quot;,tkid&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;print &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(&lt;/ins&gt;&amp;quot;Job sumbitted. Token id=&amp;quot;,tkid&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Batch_Client&amp;diff=158&amp;oldid=prev</id>
		<title>Padro: Created page with &quot;&lt;syntaxhighlight lang=&quot;python&quot; line=&quot;1&quot; &gt; #!/usr/bin/env python3  import requests import xml.etree.ElementTree  # set query elements fname = raw_input('Input ZIP file: ') lang...&quot;</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Batch_Client&amp;diff=158&amp;oldid=prev"/>
				<updated>2018-08-24T09:27:34Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt; #!/usr/bin/env python3  import requests import xml.etree.ElementTree  # set query elements fname = raw_input(&amp;#039;Input ZIP file: &amp;#039;) lang...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
&lt;br /&gt;
import requests&lt;br /&gt;
import xml.etree.ElementTree&lt;br /&gt;
&lt;br /&gt;
# set query elements&lt;br /&gt;
fname = raw_input('Input ZIP file: ')&lt;br /&gt;
lang = raw_input('Language: ')&lt;br /&gt;
out = raw_input('Output format (xml,json,conll,naf): ')&lt;br /&gt;
user = raw_input('TextServer Username: ')&lt;br /&gt;
pwd = raw_input('TextServer Password: ')&lt;br /&gt;
 &lt;br /&gt;
# Create request&lt;br /&gt;
request_data = {'username' : user&lt;br /&gt;
                'password' : pwd,&lt;br /&gt;
                'file' : open(fname,&amp;quot;rb&amp;quot;),&lt;br /&gt;
                'language': lang,&lt;br /&gt;
                'output': out,&lt;br /&gt;
                'interactive' : '0' }&lt;br /&gt;
&lt;br /&gt;
# service URL&lt;br /&gt;
service = &amp;quot;SERVICENAME&amp;quot;&lt;br /&gt;
url = &amp;quot;http://frodo.lsi.upc.edu:8080/TextWS/textservlet/ws/processQuery/&amp;quot;+service&lt;br /&gt;
&lt;br /&gt;
# Send request and get response    &lt;br /&gt;
resp = requests.post(url, files=request_data)&lt;br /&gt;
&lt;br /&gt;
# HTTP error, raise exception&lt;br /&gt;
if resp.status_code != requests.codes.ok : &lt;br /&gt;
   resp.raise_for_status()&lt;br /&gt;
&lt;br /&gt;
# No error. Server response should include a job tokenID, retrieve it&lt;br /&gt;
dom = xml.etree.ElementTree.XML(resp)&lt;br /&gt;
tkid = dom.text &lt;br /&gt;
print &amp;quot;Job sumbitted. Token id=&amp;quot;,tkid&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	</feed>