Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8049789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:53:00+00:00 2026-06-05T06:53:00+00:00

I am trying to send a list( specifically numpy or python’s list) of numbers

  • 0

I am trying to send a list( specifically numpy or python’s list) of numbers and get the sum of them using xml-rpc, to be familiar with the environment. I get an error always in the client side.

<Fault 1: "<type 'exceptions.TypeError'>:unsupported operand type(s) for +: 'int' and 'list'">

Server side code:

from SimpleXMLRPCServer import SimpleXMLRPCServer
def calculateOutput(*w):
    return sum(w);

server = SimpleXMLRPCServer(("localhost", 8000))
print "Listening on port 8000..."
server.register_function(calculateOutput,"calculateOutput");
server.serve_forever()

Client side code:

import xmlrpclib
proxy = xmlrpclib.ServerProxy("http://localhost:8000/")
print(proxy.calculateOutput([1,2,100]);

Does anyone know how to fix this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T06:53:01+00:00Added an answer on June 5, 2026 at 6:53 am

    Send through proxy.calculateOutput([1,2,100]) as proxy.calculateOutput(1,2,100) or change the arguments for your server-side function from def calculateOutput(*w): to def calculateOutput(w):.

    As an aside, you don’t need the semi-colons.

    The reason for this behaviour can be illustrated with a short example

    >>> def a(*b):
    >>>    print b
    
    >>> a(1,2,3)
    (1, 2, 3)
    >>> a([1,2,3])
    ([1, 2, 3],)
    

    As you can see from the outputs, using the magic asterix will package up however many arguments you pass through to the function as a tuple itself so it can handle n amount of arguments. As you were using that syntax, when you sent through your arguments already contained in a list they were then packaged further into a tuple. sum() only expects a list/tuple as the argument, hence the error you were receiving when it tried to sum a contained list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using asp.net mvc2 and trying to send a list of json objects with
I am trying to send a generic list to a jersey servlet using put
I'm trying to send a Python list in to client side (encoded as JSON).
So I'm trying to send an xml-rpc message to moses xml-rpc server in Java,
I'm trying to send a list of 600 records over TCP/IP sockets using a
I am trying to send the clicked value of a dropdown list to my
I am trying to input a list into the function and it send me
I'm trying to emit a signal and send two parameters, one is a list
Im trying to send a List to next activity the list List mGF =
I am trying to send a jquery sortable list of items to my MVC

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.