banner ad

Configure python path for Sublime Text 2

| March 27, 2013 | 0 Comments
0 Flares 0 Flares ×

I am using sublime text 2 for python development along.  Before you use this editor, you may need to edit path about sublime.

Edit Path ~~ /Library/Application Support/sublime text 2/Packages/Python : (path point to the Python path)
{
“path”: “/ opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/”,
/ / “cmd”: [“python”, “-u”, “$ file”],
“cmd”: [“python2.7”, “-u”, “$ file”],
“file_regex”: “^ [] * File \” (… *?) \ “, line ([0-9] *)”,
“selector”: “source.python”
}
Configuration, build directory to find the package;
Can not be executed the raw_input; However, you can use the sublime-repl to perform;
sublime
Delete key of redis:

from redis import Redis

ip_address = raw_input('input redis ip address: ')
redis_port = raw_input('input redis port: ')
keyname = raw_input('what is your prefix key: ')

if __name__ == '__main__':
    # connect to Redis
    cache = Redis(host=ip_address, port=int(redis_port), db=0)
    for key in cache.keys(keyname):
        print "will delete key: %s " % key
    yesorno = raw_input('really remove this keys,say yes or no: ')
    if 'yes' == yesorno  :
        for key in cache.keys(keyname):
                print "delete key %s" % key
                cache.delete(key)
    print 'Done'
Download PDF
0 Flares Twitter 0 Facebook 0 Google+ 0 Pin It Share 0 LinkedIn 0 Reddit 0 StumbleUpon 0 0 Flares ×

Tags: , ,

Category: Sublime Text

About the Author ()

My name is John Link.I am 26 years old. My major is Computer science and technology. I am a junior programmer with Python.

Leave a Reply

Your email address will not be published. Required fields are marked *

0 Flares Twitter 0 Facebook 0 Google+ 0 Pin It Share 0 LinkedIn 0 Reddit 0 StumbleUpon 0 0 Flares ×