Created
February 27, 2009 08:07
-
-
Save billy3321/71351 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import commands | |
import re | |
user_homedir=commands.getoutput('cat /etc/passwd | grep %s | cut -d ":" -f 6' % (user_name)).split('\n') | |
ims_cmd = "export INPUT_METHOD=\"%s\"" % (selected_cin) | |
user_profile = open(str(user_homedir[0])+'/.profile', 'rw') | |
profile_contain = user_profile.readlines() | |
profile_len = len(profile_contain) | |
search_str = re.compile('^export INPUT_METHOD=') | |
for i in range(profile_len): | |
if search_str.match(profile_contain[i]): | |
del profile_contain[i] | |
user_profile.write() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment