Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-26-2013, 12:22 PM   #1
Registered: Feb 2013
Posts: 273

Rep: Reputation: 9
executing a python code


I have installed a code which has been written by python. There in the tutorial, they have said to create a personal .pythonrc file:

import rlcompleter
import readline
readline.parse_and_bind("tab: complete")
from ase import *
I am baffled since I know nothing about python. What does this mean?
Old 06-26-2013, 12:32 PM   #2
LQ Guru
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
This may help you and it's free!
Old 06-26-2013, 01:25 PM   #3
Registered: Nov 2010
Posts: 59

Rep: Reputation: 24
A .pythonrc file is executed when the Python interactive shell is started, if
$PYTHONSTARTUP is in your environment and points to this file. In order for the Python shell to run your file on startup you need to set the PYTHONSTARTUP environment variable. Place the following line in one of your shell startup files:

import rlcompleter
import readline
---> The rlcompleter module defines a completion function suitable for the readline module by completing valid Python identifiers and keywords, rlcompleter adds tab-completion for Python symbols to the interactive interpreter. Importing the module causes it to configure a completer function for readline. The only other step required is to configure the tab key to trigger the completer. Simply put this module provides word completion for python keywords, identifiers using the tab key.
The statement
readline.parse_and_bind("tab: complete")
binds the tab key on your keyboard so you can hit tab for auto-completion of python keywords, identifiers, a standard feature found in almost all IDEs.
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Help executing shell commands in a Python script zippy4251 Programming 7 09-25-2012 11:20 AM
executing an external command with Python (CGI) laurapt Programming 1 07-08-2011 11:18 AM
executing C++ code from within PHP code vineet7kumar Programming 1 06-03-2007 04:13 PM
Crawling a directory and executing Python functions. Travis86 Programming 2 07-06-2005 01:06 AM
python, executing regular linux commands Robert0380 Programming 3 06-26-2003 03:35 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:09 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration