Skip to content

()? -> "SyntaxError: invalid syntax" #4

Description

@jakeogh
2017-02-03_10:37:18 user@box ~ $ python
Python 3.4.5 (default, Dec 12 2016, 22:06:02) 
[GCC 4.9.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
Welcome to the ImprovedConsole. Type in \h for list of features
>>> \h
        Welcome to lonetwin's pimped up python prompt
    ( available at https://gist.github.com/lonetwin/5902720 )

You've got color, tab completion, pretty-printing, an editable input buffer
(via the '\e' command) and shell command execution (via the '!' command).

* A tab with preceding text will attempt auto-completion of keywords, name in
the current namespace, attributes and methods. If the preceding text has a
'/' filename completion will be attempted. Without preceding text four spaces
will be inserted.

* History will be saved in /home/user/.python_history when you exit.

* The '\e' command will open /bin/nano with the history for the current
session. On closing the editor any lines not starting with '#' will be
executed.

* The '!' command without anything following it will suspend this process, use
fg to get back.

  - If the '!' command is followed by any text, the text will be executed in
  /bin/bash and the output/error will be displayed.

  - You may pass strings from the global namespace to the command line using
  the `.format()` syntax assuming the globals are passed to format as kwargs.

  - Additionally '_' will contain a named tuple representing the
  (<stdout>, <stderror>, <return_code>) for the execution of the command.

  for example:
  >>> filename='/does/not/exist'
  >>> !ls {filename}
  ls: cannot access /does/not/exist: No such file or directory
  >>> _
  CmdExec(out='', err='ls: cannot access /does/not/exist: No such file or directory
', rc=2)

* Simply typing out a defined name followed by a '?' will print out the
object's __doc__ attribute if one exists. (eg: []? /  str? / os.getcwd? )


>>> []?
list() -> new empty list
list(iterable) -> new list initialized from iterable's items
>>> ()?
  File "<console>", line 1
    print().__doc__)
                   ^
SyntaxError: invalid syntax
>>> (1)
1
>>> [1]
[1]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions