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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:15:37+00:00 2026-05-25T21:15:37+00:00

I am looking around the net (so far I have found pickle ) for

  • 0

I am looking around the net (so far I have found pickle ) for an explanation for what I am doing wrong

I am trying to write a very large data structure (nested dictionary/list) to file. Using the below code I discovered that the problem might be because the passed string is too large:

f = open('/path/to/file' , 'w')

try:
 f.write(str(dataStructure))
except:
 try:
  f.write('ABC')
 except:
  print 'Even smaller strings such as ABC did NOT print to the file'
 else:
  print 'Smaller strings such as ABC DID print to the file'

the dataStructure dictionary has a great deal of clique information, in this case, around 10,000 – 100,000 floating point values. The whole reason I am dumping everything into a single file, instead of saving in subfiles is because I want to exec a single file to load it, rather than manually load a few dozen subsets of the file.

Before I start saving each clique (each neuron has several different incoming clique files, such that for a neuron we are looking at 20 indexed files) I was wondering if the file size was actually the problem, or if the problem must be in something else.

Thanks

  • 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-25T21:15:38+00:00Added an answer on May 25, 2026 at 9:15 pm

    I’m gonna guess that your problem is that the string you create is too large to exist in memory. For something that big you should write it out piece by piece to the disk.

    You could use pickle, json, xml or something which should handle this correctly.

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

Sidebar

Related Questions

I have been looking around ocn Google and Stackoverflow but haven't found what I
I've been looking around the net for a good few hours now, trying to
I've been looking around the net trying to find good resources for learning PostgreSQL's
Looking around I found http://www.devco.net/archives/2008/06/26/adventures_with_ruby.php where the blogger moan about GServer's bug to destory
For the past two days i have been looking around the net to find
I've been looking around for some decent tutorials on .NET remoting (old style MarshallByRef),
After looking around (for not terribly long I have to admit) I wonder if
I have been looking around for solutions, and tried to implement what is often
I've been looking around for quite a while and feel that I have a
I've been looking around, and so far haven't managed to find a good way

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.