Python Forum
grep in python interpreter
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
grep in python interpreter
#1
I opened GNOME terminal, ran the following commands

>>> python
>>> import os
>>> dir(os)

It listed me many functioned present in this module, but they were all horizontally aligned and so were difficult to parse through at one look, so , I wanted to grep a particular function supported here named "system", so I did

>>> dir(os) | grep system

It gave me an error when I did this. Also I am not able to run shell commands in interpreter like I could have had used the "sed" tool to organize all functions presented to me by dir(os) aligned vertically one by one instead of horizontally all toghether.

How can I grep to find out if that particular function exists and also how can I show all the functions one by one, each function presented on a single line?
Reply


Messages In This Thread
grep in python interpreter - by rahul1913 - Jul-08-2017, 01:44 PM
RE: grep in python interpreter - by ichabod801 - Jul-08-2017, 01:57 PM
RE: grep in python interpreter - by rahul1913 - Jul-08-2017, 02:08 PM
RE: grep in python interpreter - by ichabod801 - Jul-08-2017, 02:11 PM
RE: grep in python interpreter - by snippsat - Jul-08-2017, 03:26 PM
RE: grep in python interpreter - by Larz60+ - Jul-08-2017, 04:46 PM
RE: grep in python interpreter - by DeaD_EyE - Jul-08-2017, 05:55 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020