()
sensor = sys.argv[2]
body = parser.getMessage(sys.argv[1],sensor)
hubStatus = hubClient.sendMessage(body,hostname)
# return the HTTP status to the caller
print hubStatus
print hostname
print sensor
~/IOT/AZURE$ python send.py temperature:22,humidity:20 deviceid
404
ubuntu
deviceid
{ "DeviceId" : "ubuntu","SensorData": [ { "SensorId" : "deviceid",
"SensorType" : "temperature", "SensorValue" : 22 },{ "SensorId" :
"deviceid", "SensorType" : "humidity", "SensorValue" : 20 }]}
--
*Syed Khalid*
--
https://mail.python.org/mailman/listinfo/python-list
body
request.headers.append(('Content-Type',
'application/atom+xml;type=entry;charset
=utf-8'))
authentication.sign_request(request, httpclient)
request.headers.append(('Content-Length', str(len(request.body)))
--
*Syed Khalid*
--
https://mail.python.org/mailman/listinfo/python-list
Albert,
Code is not removing empty lines containing blank characters and not removing
leading and trailing spaces present in each line.
import glob, codecs, re, os
regex = re.compile(r"Age: |Sex: |House No: ") # etc etc
for txt in glob.glob("D:/Python/source/*.txt"):
with codecs.o
out.txt", "wb", encoding="utf-8") as w:
w.write(os.linesep.join(newlines))
This program is not deleting the empty lines containing blank characters.
Kindly do the needful.
On Mon, Nov 10, 2014 at 2:50 AM, Syed Khalid wrote:
>
> Code after adding path of .
ot;utf-8") as w:
w.write(os.linesep.join(newlines))
I executed code in edit rocket.
Error message :
File "EamClean.log", line 12
with codecs.open(txt + "_out.txt", "wb", encoding="utf-8") as w:
^
SyntaxError: invalid syntax
On Mon,
My Script,
I have added
import glob, codecs, re, os
regex = re.compile(r"Age: |Sex: |House No: ") # etc etc
Script I executed in EditRocket :
for txt in glob.glob("/D:/Python/source/*.txt"):
with codecs.open(txt, encoding="utf-8") as f:
oldlines = f.readlines()
for i, line
014 at 1:53 AM, Albert-Jan Roskam wrote:
>
>
>
>
> - Original Message -
> > From: Syed Khalid
> > To: python-list@python.org
> > Cc:
> > Sent: Sunday, November 9, 2014 8:58 PM
> > Subject: Python script that does batch find and replace in txt files
>
Python script that does batch find and replace in txt files Need a python
script that opens all .txt files in a folder find replace/delete text and save
files.
I have text files and I need to perform below steps for each file.
Step 1: Put cursor at start of file and Search for "Contact's Name:
I am attempting to import modules from Shogun to python from a non-standard
python directory ie from my /home/xxx directory. is there a way on ubuntu
to selectively some modules, scripts, data from one directory and others
modules, scripts from another directory. In other words, is there a file(s)
I am trying to do a "import shogun" in my python script. I can invoke shogun
with a command line with no problem. But I cannot with a python import
statement.
>invoking python from a command line...
Syedk@syedk-ThinkPad-T410:~/shogun-2.0.0/src/interfaces/cmdline_static$ shogun
| mo
10 matches
Mail list logo