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

  • Home
  • SEARCH
  • 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 8587527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:35:27+00:00 2026-06-11T22:35:27+00:00

I am trying to write a python script that will take a json object

  • 0

I am trying to write a python script that will take a json object from a web page and write it to a flat file. There are ten lines in the flat file and three web pages. I have come to this code with the help of various online resources:

#!/usr/bin/python

import requests
import simplejson

r = requests.get('https://github.com/timeline.json')
c = r.content
j = simplejson.loads(c)

for item in j:
    print item['repository']['name']

This code returns json objects from the github timeline events. The returned json objects are parsed and printed as a dictionary. I want to know is this a good way or is there a better way to do this?

Also, is there a way to send the json object to a python script that will update the flat file with the inputs from a webpage?

P.S Flat files are data files that contain records with no structured relationships. A normal .txt file with data.

  • 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-11T22:35:28+00:00Added an answer on June 11, 2026 at 10:35 pm

    requests can decode json text for you:

    #!/usr/bin/env python
    import requests
    
    r = requests.get('https://github.com/timeline.json')
    for item in r.json or []:
        print item['repository']['name']
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write a Python script that will copy files from one
I'm trying to write a small Python script that will get query results from
I am trying to write a python script that will change my cwd to
I am trying to write a Python script that will access and modify the
I'm trying to write a python script that does the following from within a
I am trying to write a function that will take an xml object, an
I am trying to write a python script that will SSH to a server
I'm trying to write a program that will take an HTML file and make
I am trying to write a Python script that will list all of my
I'm trying to write a Unix script that will let me print the Python

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.