code: def create_rc_file(self, packages):
          
  
          print("Creating rcfile '%s'\n" % self.rc_filename)
  
          # TODO bug with == in config file
  
          if not self.config.sections():
              self._write_default_sections()
  
          sections = {}
          section_text = []
          for i, section in enumerate(self.config.sections()):
              if section == 'metadata':
                  continue
              sections[i] = section
              section_text.append('%s. %s' % (i, section))
          section_text = ' / '.join(section_text)
  
          self._remap_stdin()
          package_names = set()
          lines = packages.readlines()
          requirements = self._parse_requirements(lines)
          for (package, version) in requirements:
              package_names.add(package)
              section, configured_version = self._get_option(package)
              # Package already exists in configuration
              if section:
                  # If there is a configured version, update it. If not, leave it unversioned.
                  if configured_version:
                      if configured_version != version:
                          print("Updating '%s' version from '%s' to '%s'"
                                % (package, configured_version, version))
                          self.config.set(section, package, version)
                  continue
  
              section = self._get_section(package, sections, section_text)
              self._set_option(section, package, version)
  
          for section in self.config.sections():
              if section == 'metadata':
                  continue
              for option in self.config.options(section):
                  if option not in package_names:
                      print("Removing package '%s'" % option)
                      self.config.remove_option(section, option)
  
          rc_file = open(self.rc_filename, 'w+')
          self.config.write(rc_file)
          rc_file.close()
docs: Create a set of requirements files for config