shlex.shlex.get_token()

shlex.get_token() Return a token. If tokens have been stacked using push_token(), pop a token off the stack. Otherwise, read one from the input stream. If reading encounters an immediate end-of-file, eof is returned (the empty string ('') in non-POSIX mode, and None in POSIX mode).

shelve.Shelf.sync()

Shelf.sync() Write back all entries in the cache if the shelf was opened with writeback set to True. Also empty the cache and synchronize the persistent dictionary on disk, if feasible. This is called automatically when the shelf is closed with close().

shlex.quote()

shlex.quote(s) Return a shell-escaped version of the string s. The returned value is a string that can safely be used as one token in a shell command line, for cases where you cannot use a list. This idiom would be unsafe: >>> filename = 'somefile; rm -rf ~' >>> command = 'ls -l {}'.format(filename) >>> print(command) # executed by a shell: boom! ls -l somefile; rm -rf ~ quote() lets you plug the security hole: >>> command = 'ls -l {}'.format(quote(filen

shlex.shlex

class shlex.shlex(instream=None, infile=None, posix=False) A shlex instance or subclass instance is a lexical analyzer object. The initialization argument, if present, specifies where to read characters from. It must be a file-/stream-like object with read() and readline() methods, or a string. If no argument is given, input will be taken from sys.stdin. The second optional argument is a filename string, which sets the initial value of the infile attribute. If the instream argument is omitte

shelve.Shelf

class shelve.Shelf(dict, protocol=None, writeback=False, keyencoding='utf-8') A subclass of collections.abc.MutableMapping which stores pickled values in the dict object. By default, version 3 pickles are used to serialize values. The version of the pickle protocol can be specified with the protocol parameter. See the pickle documentation for a discussion of the pickle protocols. If the writeback parameter is True, the object will hold a cache of all entries accessed and write them back to t

shelve.Shelf.close()

Shelf.close() Synchronize and close the persistent dict object. Operations on a closed shelf will fail with a ValueError.

shlex.shlex.commenters

shlex.commenters The string of characters that are recognized as comment beginners. All characters from the comment beginner to end of line are ignored. Includes just '#' by default.

shelve.DbfilenameShelf

class shelve.DbfilenameShelf(filename, flag='c', protocol=None, writeback=False) A subclass of Shelf which accepts a filename instead of a dict-like object. The underlying file will be opened using dbm.open(). By default, the file will be created and opened for both read and write. The optional flag parameter has the same interpretation as for the open() function. The optional protocol and writeback parameters have the same interpretation as for the Shelf class.

setattr()

setattr(object, name, value) This is the counterpart of getattr(). The arguments are an object, a string and an arbitrary value. The string may name an existing attribute or a new attribute. The function assigns the value to the attribute, provided the object allows it. For example, setattr(x, 'foobar', 123) is equivalent to x.foobar = 123.

set.update()

update(other, ...) set |= other | ... Update the set, adding elements from all others.