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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:00:57+00:00 2026-06-02T01:00:57+00:00

I have a list, called filelist = [] to which I’m appending a dictionary

  • 0

I have a list, called filelist = []
to which I’m appending a dictionary of some key value pairs.

filelist.append({"url": url, "exename": ename, "filename": fname}] as I loop through a set of files.
Later, loads() the below json object to a "json" key: 

for file in filelist: file["json"] = json.loads(json)

I am having no trouble pulling out the first layer of dictionary values, ie.

for files in filelist:
    print files["json"]["response_code"]

>>> 1

However, I am having issues at getting to the inner dictionary I’m assuming is bound to
files[“json”][“scans”]
for example:

for files in filelist:
    for avvendors in files["json"]["scans"]

I’m really interested in pulling out the “detected” key but it seems python is not loading the “scans” key as a dictionary but instead is storing it as a string. I’m thinking of doing a second loads() on the inner dictionary to see what happens.

for stuff in avvendors:
    if stuf["detected"]:
        #do something

I’m not really sure what is happening here. I know I will likely figure it out but some insight into what python does with the json internally would be nice. Also, I will not get a chance to work on this till Monday or Tuesday, maybe even Wednesday and the suspense is killing me.

Here’s the full block for readability:

for files in filelist:
for avvendors in files[“json”][“scans]:
if avvendors[“detected”]:
#Do something useful

{"response_code": 1,
"verbose_msg": "Scan finished, scan information embedded in this object",

"resource": "99017f6eebbac24f351415dd410d522d",
"scan_id": "52d3df0ed60c46f336c131bf2ca454f73bafdc4b04dfa2aea80746f5ba9e6d1c-1273894724",
"md5": "99017f6eebbac24f351415dd410d522d",
"sha1": "4d1740485713a2ab3a4f5822a01f645fe8387f92",
"sha256": "52d3df0ed60c46f336c131bf2ca454f73bafdc4b04dfa2aea80746f5ba9e6d1c",

"scan_date": "2010-05-15 03:38:44",

"positives": 40,
"total": 40,
"scans": {"nProtect": {"detected": true, "version": "2010-05-14.01", "result": "Trojan.Generic.3611249", "update": "20100514"},
"CAT-QuickHeal": {"detected": true, "version": "10.00", "result": "Trojan.VB.acgy", "update": "20100514"},
"McAfee": {"detected": true, "version": "5.400.0.1158", "result": "Generic.dx!rkx", "update": "20100515"},
"TheHacker": {"detected": true, "version": "6.5.2.0.280", "result": "Trojan/VB.gen", "update": "20100514"},
"VirusBuster": {"detected": true, "version": "5.0.27.0", "result": "Trojan.VB.JFDE", "update": "20100514"},
"NOD32": {"detected": true, "version": "5115", "result": "a variant of Win32/Qhost.NTY", "update": "20100514"},
"F-Prot": {"detected": false, "version": "4.5.1.85", "result": null, "update": "20100514"},
"Symantec": {"detected": true, "version": "20101.1.0.89", "result": "Trojan.KillAV", "update": "20100515"},
"Norman": {"detected": true, "version": "6.04.12", "result": "W32/Smalltroj.YFHZ", "update": "20100514"},
"TrendMicro-HouseCall": {"detected": true, "version": "9.120.0.1004", "result": "TROJ_VB.JVJ", "update": "20100515"},
"Avast": {"detected": true, "version": "4.8.1351.0", "result": "Win32:Malware-gen", "update": "20100514"},
"eSafe": {"detected": true, "version": "7.0.17.0", "result": "Win32.TRVB.Acgy", "update": "20100513"},
"ClamAV": {"detected": false, "version": "0.96.0.3-git", "result": null, "update": "20100514"},
"Kaspersky": {"detected": true, "version": "7.0.0.125", "result": "Trojan.Win32.VB.acgy", "update": "20100515"},
"BitDefender": {"detected": true, "version": "7.2", "result": "Trojan.Generic.3611249", "update": "20100515"},
"Comodo": {"detected": true, "version": "4842", "result": "Heur.Suspicious", "update": "20100515"},
"F-Secure": {"detected": true, "version": "9.0.15370.0", "result": "Trojan.Generic.3611249", "update": "20100514"},
"DrWeb": {"detected": true, "version": "5.0.2.03300", "result": "Trojan.Hosts.37", "update": "20100515"},
"AntiVir": {"detected": true, "version": "8.2.1.242", "result": "TR/VB.acgy.1", "update": "20100514"},
"TrendMicro": {"detected": true, "version": "9.120.0.1004", "result": "TROJ_VB.JVJ", "update": "20100514"},
"McAfee-GW-Edition": {"detected": true, "version": "2010.1", "result": "Generic.dx!rkx", "update": "20100515"},
"Sophos": {"detected": true, "version": "4.53.0", "result": "Troj/VBHost-A", "update": "20100515"},
"eTrust-Vet": {"detected": true, "version": "35.2.7490", "result": "Win32/ASuspect.HDBBD", "update": "20100515"},
"Authentium": {"detected": false, "version": "5.2.0.5", "result": null, "update": "20100514"},
"Jiangmin": {"detected": true, "version": "13.0.900", "result": "Trojan/VB.yqh", "update": "20100514"}, [...] }
  • 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-02T01:00:58+00:00Added an answer on June 2, 2026 at 1:00 am

    Be careful when iterating over a dict. It just returns the keys. If you want the keys and values, use the .iteritems() method (or in Python3, .items()):

    for files in filelist:
       for avvendor, stuf in files["json"]["scans"].iteritems():
           if stuf["detected"]:
              #do something
    

    In your case, the value of the scans key is a dict: "scans": {"nProtect": ...}

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

Sidebar

Related Questions

I have a struct called coordinate which is contained in a list in another
I have a list called 'optionlist' which may change length from day to day,
I currently have a list called regkey and a string called line_to_delete, which I
I am working with Python plugins. I have my list called station_list ,to which
I have a list called com, which contains a bunch of integers. I need
I have a list called Countries, and each country has a list of Towns,
I have List where myObj has it own list of objects called example mySubObj.
I have a list of objects called Activity: class Activity { public Date activityDate;
If I have a list of objects called Car: public class Car { public
I have 2 datatables in a dataset. One table has a list called CostTypes.

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.