Code Monkey home page Code Monkey logo

jpserve's People

Contributors

dorinionescu avatar johnhuang-cn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jpserve's Issues

jpserver is not working on python 2.7.12

in jpserve.py code, at line number 38, replace socketserver with SocketServer. Also, at line number 204, replace, ThreadingTCPServer.init(self, server_address, RequestHandlerClass) with,
ForkingTCPServer.init(self, server_address, RequestHandlerClass)

cannot import name 'ForkingTCPServer'

@johnhuang-cn when I tried to call from jpserve.jpserve import JPServe. Spider gives me the following error:
from jpserve.jpserve import JPServe
Traceback (most recent call last):

File "", line 1, in
from jpserve.jpserve import JPServe

File "C:\ProgramData\Anaconda3\lib\site-packages\jpserve_init_.py", line 1, in
from .jpserve import JPServe

File "C:\ProgramData\Anaconda3\lib\site-packages\jpserve\jpserve.py", line 38, in
from socketserver import StreamRequestHandler, ThreadingTCPServer, ForkingTCPServer

ImportError: cannot import name 'ForkingTCPServer'

Can you help me?

Requests module

Hi John ,

I have been trying with with python - spring boot using Jython 2.7 , for a simple py file it worked , but my python files are using requests module as they fetching data from another application via Rest client . and output data was so huge i have use the python script. The code that i have got as sample is require to download the module manually but requests module have so many problem and never complied properly when added in resources folder of project ( spring) i tried other module works ok like json . I tried setting path for interpreter to jyhon lib folder but its just not compile the request module. Do you have suggestion pls ? even if not definite answers but something to explorer , i am stuck for almost a week now. most of my python file are like this :

import requests

from requests.auth import HTTPBasicAuth

user1= "rajnibh[email protected]"
password = "
*********"
baseurl = "https://central.oursecure.cloud:9440/api/nutanix/v3"

urlGet = baseurl + "/clusters/00***************99f0cf3a4"

urlPost = "https://central.oursecure.cloud:9440/API/nutanix/v3/clusters/list"
method="POST"
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
payload = {"length": 500}

def urlreq(url, verb, auth, user, passwd, params, verify, headers):
data = {
"kind": "cluster",
"sort_order": "ASCENDING",
"sort_attribute": "name"
}

print (url)

response = requests.post(url=url, data=data,auth=HTTPBasicAuth(user1,password))
return response

def getClusterList(url, method, user, password, headers, payload=None):
r = urlreq(url, verb=method, auth="BASIC", user=user1, passwd=password, params=payload, verify=False,
headers=headers)
return r

r = getClusterList(urlPost, method, user1, password, headers, json.dumps(payload))

if r.status_code == 401:
print("Response Status: " + str(r.status_code))

Can the server work with PySpark ?

Can JPServe work with PySpark? When i use SparkSession And SqlContext it gives me error SqlContext is not defined. While when i run the script normally without jpserve is it working.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.