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 6469687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:01:22+00:00 2026-05-25T06:01:22+00:00

I am getting a json object from a remote server, and converting it to

  • 0

I am getting a json object from a remote server, and converting it to a python string like this:

a = eval(response)

Is this stupid in any way, or do I have a better option?

  • 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-05-25T06:01:23+00:00Added an answer on May 25, 2026 at 6:01 am

    Using eval is not a good way to process JSON:

    1. JSON isn’t even valid Python, because of true, false, and null.

    2. eval will execute arbitrary Python code, so you are at the mercy of malicious injection of code.

    Use the json module available in the standard library instead:

    import json
    data = json.loads("[1, 2, 3]")
    

    If you’re using a version of Python older than 2.6, you’ll need to download the module yourself. It’s called simplejson and can be downloaded from PyPi.

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

Sidebar

Related Questions

I am getting JSON response from the server..Inside that JSON string i am having
I'm getting this json string info from the server : {members:[[sd2840d,Johny],[jkld341,Marry]]} So I store
I have a JSON object returned from server. It looks like this : {1:{id:1,name:autos},
I am using Jquery for getting a json object from a solr server. When
I'm parsing a JSON object (from YQL) that includes some null values, like this:
I'm getting a json object from the server. If the json object has redirect
I have a JSON string (from PHP's json_encode() that looks like this: [{id: 1,
Getting Json from the Server and displaying it in the grid is relatively straight
im getting response in json, but this wont parse the json response. what m
I am getting a JSON object from a webMethod by the call below and

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.