title: Parallelizing for loop in Python 2.7
body: <p>I'm very new to Python (and coding in general) and I need help parallising the code below. I looked around and found some packages (eg. Multiprocessing &amp; JobLib) which could be useful.</p>
  
  <p>However, I have trouble using it in my example. My code makes an outputfile, and updates it doing the loop(s). Therefore is it not directly paralisable, so I think I need to make smaller files. After this, I could merge the files together.</p>
  
  <p>I'm unable to find a way to do this, could someone be so kind and give me a decent start?</p>
  
  <p>I appreciate any help,
  A code newbie</p>
  
  <p>Code:</p>
  
  <pre><code>def delta(graph,n,t,nx,OutExt):
      fout_=open(OutExt+'Delta'+str(t)+'.txt','w')
      temp=nx.Graph(graph)
      for u in range(0,n):
          #print "stamp: "+str(t)+" node: "+str(u)
          for v in range(u+1,n):
              #print str(u)+"\t"+str(v)
              Stat = dict()
              temp.add_edge(u,v)
              MineDeltaGraphletTransitionsFromDynamicNetwork(graph,temp,Stat,u,v)
              for a in Stat:
                  for b in Stat[a]:
                      fout_.write(str(t)+"\t"+str(u)+"\t"+str(v)+"\t"+str(a)+"\t"+str(b)+"\t"+str(Stat[a][b])+"\n")
              if not graph.has_edge(u,v):
                  temp.remove_edge(u,v)
      del temp
      fout_.close()
  </code></pre>