create account

Autocomplete for Python Coding in Sublime Text (ST3) by mafisicoder

View this thread on: hive.blogpeakd.comecency.com
· @mafisicoder · (edited)
$0.07
Autocomplete for Python Coding in Sublime Text (ST3)
### Wanted to be able to do AUTOCOMPLETE when editing my python codes
####Procedure
1. I search the Internet for resource and sublimed on [this](https://forum.sublimetext.com/t/python-autocomplete-for-methods-problems-with-parentheses/31911/2) which gave me recommendation on what to get
2. So I looked for **SublimeJEDI** [here](https://packagecontrol.io/packages/Jedi%20-%20Python%20autocompletion).
3. Following the instruction, I installed the *package* in my ST3.
4. Now to the configuration part. To configure ST3 for SublimeJEDI integration, I went to *Preference* (MAC) -> *Package Settings* -> *Jedi* -> *Settings -Default*
![](https://res.cloudinary.com/dyly6vbyg/image/upload/v1584166297/blog-post-images/Screen_Shot_2020-03-14_at_01.32.35_by0pjv.png)
5. Add your **Virtual Environment** and also the path any additional Python package
<code>
    {
        // You can set a path to your python virtualenv,
        // for example `/home/user/.virtualenvs/myenv)`.
        // Note: Interpreter path would be found automaticaly
        "python_virtualenv": "/Users/macbookpro/environments",

        // You can set a path to your python interpreter,
        // for example `/home/user/.virtualenvs/myenv/bin/python)`.
        "python_interpreter": "/Users/macbookpro/environments/bin/python3",

        // Additional python package paths.
        "python_package_paths": ["/Users/macbookpro/Documents/projects/autotask-python/autotask-Env/"],
    }
</code>

6. Add how you would want **Jedi** to handle the *autocompletting task*. My example below makes sure that **Jedi** provides autocomplete suggestions after a DOT and not during *typing*.
<code>
    // When to modifiy
    "only_complete_after_regex": "\\.",
</code>

7. The final step is to add the settings to User.Preference Settings. Preferences.sublime-settings - User
<code>    
    {
        // ........

        // Added my settings here
        // Modify Python on DOT
        //# User/Preferences.sublime-settings or User/Python.sublime-settings
        "auto_complete_triggers": [
        {
            "selector": "source.python",
            "characters": "."
        }],


        // Auto-completion ONLY on dot and not while typing, 
        // you can set (additionally to the trigger above):
        "auto_complete_selector": "-",

        // Jedi auto-completion only after the . character 
        // but don't want to affect auto-completion from other packages
        "only_complete_after_regex": "\\.",

    }
</code>
👍  
properties (23)
authormafisicoder
permlinkautocomplete-for-python-coding-in-sublime-text-st3
categorypython
json_metadata{"tags":["sublime","text","autocomplete","sublimejedi","programming","datascience"],"image":["https://res.cloudinary.com/dyly6vbyg/image/upload/v1584166297/blog-post-images/Screen_Shot_2020-03-14_at_01.32.35_by0pjv.png"],"links":["https://forum.sublimetext.com/t/python-autocomplete-for-methods-problems-with-parentheses/31911/2","https://packagecontrol.io/packages/Jedi%20-%20Python%20autocompletion"],"app":"steemit/0.2","format":"markdown"}
created2020-03-14 06:53:12
last_update2020-03-14 06:56:48
depth0
children1
last_payout2020-03-21 06:53:12
cashout_time1969-12-31 23:59:59
total_payout_value0.037 HBD
curator_payout_value0.037 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,502
author_reputation12,562,678,603
root_title"Autocomplete for Python Coding in Sublime Text (ST3)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id96,341,429
net_rshares322,074,234,818
author_curate_reward""
vote details (1)
@steemitboard ·
Congratulations @mafisicoder! You received a personal award!

<table><tr><td>https://images.hive.blog/70x70/http://steemitboard.com/@mafisicoder/birthday2.png</td><td>Happy Hive Birthday! You are on the Hive blockchain for 2 years!</td></tr></table>

<sub>_You can view [your badges on your board](https://steemitboard.com/@mafisicoder) and compare to others on the [Ranking](https://steemitboard.com/ranking/index.php?name=mafisicoder)_</sub>


###### [Vote for @Steemitboard as a witness](https://hivesigner.com/sign/account-witness-vote?witness=steemitboard&approve=1) to get one more award and increased upvotes!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-mafisicoder-20200403t205041000z
categorypython
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2020-04-03 20:50:42
last_update2020-04-03 20:50:42
depth1
children0
last_payout2020-04-10 20:50:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length616
author_reputation38,975,615,169,260
root_title"Autocomplete for Python Coding in Sublime Text (ST3)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id96,697,427
net_rshares0