Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

MySQL

Python Examples for Perl programmers

  1. Example: empty dictionary, add values to it
    Code Block
    layer = {}
       
        layer["type"] = row[1]
            layer["status"] = row[2]
     
          layer["name"] = row[3]
    
           layer["numSamples"] = row[4]
         
      layer["platform"] = row[5]
    layer["version"]       = row[6]
    layer["versionqcBy"] = row[611]
    
  2. Example: empty two level dictionary, add values to it
    Code Block
    layer = {}
    layer['foo'] = {}
    layer['foo']['bar'] = 3
    layer["qcBy"'hello'] = row[11] {}
    layer['hello']['world'] = 42
    
  3. Example: create a populated dictionary
    Code Block
    CSV_TO_PRIMARY_FIELDS = {
        'name': 'name',
        'description': 'description',
        'Investigator': 'creator',
        'Creation Date': 'creationDate',
        'Status': 'status',
        'date_released': 'releaseDate',
        'version':'version'
        }
  4. Example: create a populated two-level dictionary
    Code Block
    
    MY_FAKE_LAYER = {'foo': {'bar': 3}, 'hello': {'world': 42}}
    
  5. Example: empty array, add values to it
    Code Block
    stringAnnotations = []
        stringAnnotations.append("foo")
    
  6. Example: create a populated array
    Code Block
    CSV_SKIP_FIELDS = ["db_id","user_agreement_file_path", "readme_file_path"];
    

MySQL

Subversion

For general SVN info see the SVN book

...