But the default python interpreter that comes bundled with most linux distros (and also the OS X), lacks a killer feature of bash: tab completion. One can find this feature in some python interpreters like bpython, but they sometimes overdo it (popping up suggestions even when one doesn't want them, for example).
Anyway, I recently learned from this excellent blog post by Matthias Friedrich that it is REALLY easy to add tab completion in the python interpreter: all one needs to do is import rlcompleter and readline modules of python and assign a completer key (Tab is the most natural choice, of course). The blog post I linked above also describes how to set the PYTHONSTARTUP environment variable so that tab completion is enabled every time the interpreter is opened.
Since python's readline module uses the same GNU readline utility used by bash for tab-completion, it should be just as much fun, right? Well, that's not quite the case. Because tab completion imposes a severe restriction on you here: you cannot use the Tab key for indenting your code anymore. And using single space for python's code indentation is a very bad idea: trying to distinguish between different indentation levels in heavily nested code blocks is a trouble not worth taking even for sake of the benefits given by tab completion.
Anyway, I figured out a way to circumvent the problem by looking at these lines in the source code of the rlcompleter module (The file in question is /usr/lib/python2.6/rlcompleter.py for Debian and Ubuntu): When one presses the completion key the function complete(self, text, state) defined in line#29 is called with the word being typed as it's second argument. I simply added an extra elif after the 42nd line asking it to return '\t' if the argument consists of only whitespaces: So, now I have all the goodness of tab completion without losing the ability of using tab for code indentation!
Thank you.
ReplyDeleteExcellent Thank you.
ReplyDeleteFor most kids, Santa already rates pretty highly replica belts in their eyes, given the whole presents, elves and magical reindeer schtick. For the kids stuck behind a car crash in Coppell, Texas early last week prada replica, the jolly old elf has likely moved to hero status.
ReplyDeleteFormer Arlington, Texas volunteer fire fighter chanel outlet Brad Luddeke was on his way to deliver toys to needy kids when he came across the accident on Interstate 635. Luddeke training louis vuitton outlet went into full swing, as he pulled a driver from one of the crashed vehicles not only once, but again, when he noted the car replica handbags catching fire.
Heya i am for the first time here. I found this board and I find It truly useful & it helped me out a lot. I'm hoping to offer one thing again and aid others such as you helped me. seo manchester
ReplyDeleteacheter vente maillot nba pas acheter vente maillot nba pas cher cher Such bones humble and flatter not just the security they have, many people are present, because acheter vente maillot nba pas cher one acheter vente maillot nba pas cher kind of fear and a desire, or almost impossible for the kind of opportunity. cheap to pay the acheter vente maillot nba pas cher fare, because the http://www.nailartmetisse.fr poor sale after watching the film it is no extra money, of course, left the next bucks in his pocket, pulled out to not only make the .
ReplyDeleteBeing a interpreter is a very nice and interesting job but this job is not easy. An interpreter should be very educated and perfect in his job and in uk essay writing service and for this purpose he have to do much study and struggle.
ReplyDeleteicc t20 world cup
ReplyDeleteicc t20 world cup 2016
icc t20 world cup 2016 live
icc t20 world cup 2016 live streaming
icc t20 world cup live
t20 world 2016
t20 world cup
t20 world cup 2016 live
t20 world cup 2016 live streaming
t20 world cup live
IPL t20
IPL t20 2016
IPL t20 2016 live
IPL t20 2016 Streaming
IPL t20 2016 live Streaming
IPL t20 2016 Streaming
IPL t20 live Streaming
IPL t20 live
mobiles phones
hindi lyrics
Pnr Status
portable wireless bluetooth speaker reviews
ReplyDeletebest sound quality portable speakers
best budget portable bluetooth speakers
wireless bluetooth speakers for cell phones
when lunar eclipse live streaming 2016 in usa and other states
what happen during a lunar eclipse live streaming 2016
where can you see the lunar eclipse live streaming 2016 tonight
times for lunar eclipse live 2016 tonight
lunar eclipse live 2016 phase of moon during lunar eclipse streaming
how often does a lunar eclipse live streaming occur
leather motorcycle helmet
orange motorcycle helmet
skull motorcycle helmet
where to buy motorcycle gear
german style motorcycle helmet
custom made motorcycle helmets
best cool stormtrooper motorcycle helmets for sale
best low price bluetooth speakers
high quality portable bluetooth speakers
where to buy bluetooth speakers
review of portable bluetooth speakers
bluetooth speakers with audio output
the loudest portable bluetooth speaker
best sound quality portable speaker
best value portable bluetooth speaker
best wireless speakers with bass
top 3 best value portable bluetooth speaker
good mini portable speakers with bass
Its very good and very excellent article. i really enjoyed this post and i hope you will keep posting this kinds of post in future.
ReplyDeleteGreat
ReplyDeletevalentine day Facebook profile pic cute valentines day quotes valentines day quotes for him to make someone happy, and by this, you can also make someone your Valentine. You can decorate your PC and mobile screen on this event by these type of images
ReplyDeleteVisit us now to view & share beautiful collection of Best Images of
ReplyDeleterose day quotes
It can be hard to break through to the misfortune alleviation office if gathering specialists are debilitated from exchanging calls. This is one of the advantages of having an assistant, for example, a lawyer or a lodging advisor. The first will scare charge authorities and the second may have contacts inside the misfortune mit office. car title loans
ReplyDeleteThey were so pleasant. They clarified that losing a vocation was the ideal motivation behind why the bank ought to adjust their credit. They knew precisely who to converse with at the bank. They thought of an advance alteration plan and conveyed frames for Joe and Dawn to round out. Check Cashing
ReplyDeleteManaging an account organizations and money related loan specialists typically offer data just about their items. Their sites have data identifying with their product offering and you may locate some deceptive information that makes it troublesome for you to comprehend which items are really the best. cash advance corona
ReplyDeleteThe fortunate thing about secured home credit is that it is offered with lower financing cost. As a result of the security gave this kind of credit accompanies low intrigue. cash advance
ReplyDeleteHome value advances, when used to diminish obligation, for example, Visas, are a decent approach to help recover your FICO assessment fit as a fiddle. When taking out your new terrible credit home advance, you will need to search around a bit to get the absolute best arrangement conceivable on your advance terms. cash advance
ReplyDeleteI'm certain that I don't need to clarify what you could do with the cash, however you may be upbeat to realize that with a dealer credit; there are no confinements on how you spend it. Regardless of whether it be to make up for lost time with bills, make finance or extend your advertising endeavors, having the additional working capital can truly have any kind of effect in your business. payday loans chula-vista
ReplyDeleteOn the off chance that your application is affirmed, there is a couple of various elements that are included. There is be sum took into account financing, a rate of that sum that the bank will consider a service agreement, and the quantity of rate focuses that the merchant can add to the credit. car title loans
ReplyDeleteThis implies those hoping to purchase condo structures should be keen with their choices and ensure that he is working with a trustworthy organization that has involvement with this kind of venture when the economy is low. The accompanying is some present data about how the home loan banks are functioning. car title loans
ReplyDeleteDownload IDM 2018
ReplyDeleteDownload IDM 2018
Free Download IDM 2018
Free Download IDM 2018
Download IDM 2018
Download Internet Download Manager 2018
Download IDM 2018
On the off chance that you are hoping to settle your loan obligation, you will need to investigate your accounts. Settling any sort of obligation is a procedure when your paycheck is attempting to make least installments. Since a loan online is a transient credit, intrigue includes quick. Keep these minimal effort advances here and now when you pay them off on the first due date.
ReplyDeleterun 3 unblocked
ReplyDeleterun 3 unblocked 66
unblocked games run 3
run 3 unblocked 333
run 3 unblocked at school
Kenapa wanita ingin melakukan cara menggugurkan kandungan untuk mengakhiri kehamilan yang tidak di inginkan dengan paksa . Ada beberapa alasan seseorang ingin melakukan cara menggugurkan hamil seperti terlalu banyak anak , tidak siap menjadi ibu , masing mementingkan karir dan sebagainya . Menggugurkan kandungan mempunyai tingkat risiko yang sangat tinggi dan berat . Oleh sebab itu Anda harus memikirkan cara aborsi aman agar tidak membahayakan diri Anda . telat datang bulan merupakan hal yang wajar yang di alami oleh wanita , lantas bagaimana
ReplyDeletecara melancarkan haid ? Menjaga pola makan sehat dan hindari stress merupakan salah satu untuk mengatasi haid tidak lancar . Bagi pria perlu juga untuk mengetahui cara merangsang wanita agar pasangan Anda lebih bergairah dalam melakukan hubungan bersama Anda .
This information was really valuable, hope you keep it updated. Jual Lemari Arsip
ReplyDeleteI thank you for the information and articles you provided
ReplyDeleteWith the progression and modernisation of the general public, the requirement for 'recreation' has turned into a vital one which ought not be disregarded. Barbacue Catering
ReplyDeleteAlbeit a great many people go to school and graduate one of the various devoted instructive projects that are accessible, a few competitors can acquire certificate on the off chance that they have a four year college education that isn't explicit for recreational treatment, Gym Flooring
ReplyDelete