Implementing CURL command using libcurl in C/C++

2019-12-13 Thread Karthik Sharma
The `CURL` command that I am using is shown below. curl -F 'file=@/home/karthik/Workspace/downloadfile.out' http://127.0.0.1:5000/file-upload --verbose The response from the server is shown below. * Trying 127.0.0.1... * Connected to 127.0.0.1 (127.0.0.1) port 5000 (#0) > POST

Transfer a file to httpserver via POST command from curl

2019-12-12 Thread Karthik Sharma
I have written a python server app (actually copied from somewhere) using Flask, that I want to act as a http server. I expect this server to recieve a POST command (of a file) from CURL and save that file on the server. And I should be able to download that file when required. My python scripts a

Plotting a timeseris graph from pandas dataframe using matplotlib

2015-11-19 Thread Karthik Sharma
I have the following data in a csv file SourceIDBSs hour Type 7208 87 11MAIN 11060 67 11MAIN 3737 88 11MAIN 9683 69 11MAIN 9276 88 11MAIN 7754 62 11MAI

Plotting timeseries from a csv file using matplotlib

2015-11-12 Thread Karthik Sharma
I have some csv data in the following format. Ln Dr Tag Lab 0:01 0:02 0:03 0:04 0:05 0:06 0:07 0:08 0:09 L0 St vT 4R 0 0 00 0 0 00 0 L2 Tx st 4R

Re: Decoding JSON file using python

2015-05-27 Thread Karthik Sharma
x27;message {} \n\n'.format(message['Message'])) I get the following error. Traceback (most recent call last): File "test_json.py", line 23, in print('message {} \n\n'.format(message['Message'])) TypeError: list indices must be intege

Decoding JSON file using python

2015-05-27 Thread Karthik Sharma
I have the JSON structure shown below and the python code shown below to manipulate the JSON structure. import json json_input = { "msgType": "0", "tid": "1", "data": "[{\"Severity\":\"warn\",\"Subject\":\"Reporting \",\"Message\":\"tdetails:{\\\"Product\\\"

Error in processing JSON files in Python

2015-03-30 Thread Karthik Sharma
I have the following python program to read a set of JSON files do some processing on it and dump them back to the same folder. However When I run the below program and then try to see the output of the JSON file using `cat file.json | python -m json.tool` I get the following error `extra data

Python JSON processing - extra data error

2015-03-30 Thread karthik . sharma
I have the following python program to read a set of JSON files do some processing on it and dump them back to the same folder. However When I run the below program and then try to see the output of the JSON file using `cat file.json | python -m json.tool` I get the following error `extra dat

ZMQError: Resource temporarily unavailable

2014-10-08 Thread karthik . sharma
I am using zero-mq for IPC between two machines. My zmq function is given below def recieve_messages(self): string = self.sub_socket.recv(flags=zmq.NOBLOCK) print('flow mod messages recieved {}'.format(string)) When I run the program however I get the following err

query from sqlalchemy returns AttributeError: 'NoneType' object

2013-05-02 Thread karthik . sharma
from pox.core import core import pox.openflow.libopenflow_01 as of import re import datetime from sqlalchemy import create_engine, ForeignKey from sqlalchemy import Column, Date, Integer, String from sqlalchemy.ext.declarative import declarative_base from sqlalchemy