Does anyone use PyCharm?

General discussion for off-topic subjects.
User avatar
Kill
Member
Posts: 88
Joined: Wed Aug 31, 2016 10:05 pm

Does anyone use PyCharm?

Postby Kill » Fri Sep 02, 2016 12:06 pm

Hello,

If so, can You please tell me how to make it autocomeplete?
User avatar
Mahi
Senior Member
Posts: 236
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Re: Does anyone use PyCharm?

Postby Mahi » Fri Sep 02, 2016 12:42 pm

I suggest you google... :p
User avatar
Kill
Member
Posts: 88
Joined: Wed Aug 31, 2016 10:05 pm

Re: Does anyone use PyCharm?

Postby Kill » Fri Sep 02, 2016 12:48 pm

Mahi wrote:I suggest you google... :p


I google more than You can think :P
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: Does anyone use PyCharm?

Postby iPlayer » Fri Sep 02, 2016 2:24 pm

I use PyCharm.

1) Settings
Image

2) Project Structure
Image

3) +Add Content Root Image
4) Select addons/source-python/packages/source-python in your SP installation
Image

5) Using +Add Content Root, also add addons/source-python/packages/site-packages and addons/source-python/packages/custom
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
Kill
Member
Posts: 88
Joined: Wed Aug 31, 2016 10:05 pm

Re: Does anyone use PyCharm?

Postby Kill » Fri Sep 02, 2016 2:29 pm

Thanks a lot iPlayer!
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: Does anyone use PyCharm?

Postby satoon101 » Fri Sep 02, 2016 2:54 pm

Don't add external libraries like ../addons/source-python/package/source-python/ as Content Roots, add them as external libraries. To do this, go into Project Interpreter, click the "gear" on the right side of the Project Interpreter line, and select "More...". Then, while your interpreter is highlighted, there are 5 buttons on the bottom left. Click the one on the right (out of those 5). The text for it, when hovering over, should say "Show paths for the selected interpreter". Once in there, click the plus-sign on the bottom left and select the directory you wish to add.
Image
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: Does anyone use PyCharm?

Postby iPlayer » Fri Sep 02, 2016 2:58 pm

Didn't know that! Learning something new every day, huh
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
Kill
Member
Posts: 88
Joined: Wed Aug 31, 2016 10:05 pm

Re: Does anyone use PyCharm?

Postby Kill » Fri Sep 02, 2016 3:05 pm

satoon101 wrote:Don't add external libraries like ../addons/source-python/package/source-python/ as Content Roots, add them as external libraries. To do this, go into Project Interpreter, click the "gear" on the right side of the Project Interpreter line, and select "More...". Then, while your interpreter is highlighted, there are 5 buttons on the bottom left. Click the one on the right (out of those 5). The text for it, when hovering over, should say "Show paths for the selected interpreter". Once in there, click the plus-sign on the bottom left and select the directory you wish to add.



I can't "apply" this. Thanks tho :)
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: Does anyone use PyCharm?

Postby satoon101 » Fri Sep 02, 2016 3:06 pm

? Not sure why you couldn't. What's stopping you?
Image
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: Does anyone use PyCharm?

Postby satoon101 » Fri Sep 02, 2016 3:18 pm

Ok, sorry, on Windows, the 5 buttons are on the upper right and are listed vertically. Choose the bottom one of those 5. And the plus-sign on the next page is on the upper right, as well.

I'm assuming that might have been your issue, but "I can't apply this" doesn't really help to solve the situation.
Image
User avatar
Kill
Member
Posts: 88
Joined: Wed Aug 31, 2016 10:05 pm

Re: Does anyone use PyCharm?

Postby Kill » Fri Sep 02, 2016 4:05 pm

satoon101 wrote:Ok, sorry, on Windows, the 5 buttons are on the upper right and are listed vertically. Choose the bottom one of those 5. And the plus-sign on the next page is on the upper right, as well.

I'm assuming that might have been your issue, but "I can't apply this" doesn't really help to solve the situation.


This is what i meant, I can't apply the configuration
Image
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: Does anyone use PyCharm?

Postby satoon101 » Fri Sep 02, 2016 4:07 pm

There's nothing to Apply. I'm assuming this is on the Project Interpreter screen itself. The Apply button will only be active if you are actually changing the interpreter you are using. You shouldn't be doing that at all in what I posted. You're just modifying the existing interpreter.

*Edit: ok, I was wrong, you should have to apply when adding additional external libraries. But, the Apply button will only activate once you have done so. If the button is not activating, there is something wrong with your installation. I have tested this on both the community and professional versions on Windows and on Mac (professional version only), and they all work the same.
Image
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: Does anyone use PyCharm?

Postby iPlayer » Fri Sep 02, 2016 6:37 pm

satoon101 wrote:Don't add external libraries ... as Content Roots

Well, might also notify necavi of this. He told me to do so back in the day :tongue:
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: Does anyone use PyCharm?

Postby satoon101 » Fri Sep 02, 2016 6:47 pm

It's in BackRaw's post here, too:
viewtopic.php?f=31&t=863&p=5410#p5410

I have even used that method in the past, before I knew better. I mean, it does "work". But, all the extra directories in the project structure really annoyed me, since they aren't an actual part of my project. So, I did a quick google search on how to add directories into the External Libraries, and found this method. I have been much happier ever since :)
Image
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: Does anyone use PyCharm?

Postby iPlayer » Fri Sep 02, 2016 7:15 pm

On the bright side, I can quickly look up sources of the Python-side of Source.Python. And good thing these extra directories are not commited to the repo nor deployed. Though if they were, I guess I'd find out about interpreter's external libs way before now.
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: Does anyone use PyCharm?

Postby satoon101 » Fri Sep 02, 2016 7:49 pm

You still have quick access, as they are listed in the External Libraries right underneath. Plus, Ctrl-B (command-B on Mac) takes you to the object's declaration.
Image
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

Re: Does anyone use PyCharm?

Postby BackRaw » Thu Sep 08, 2016 6:16 pm

satoon101 wrote:Don't add external libraries like ../addons/source-python/package/source-python/ as Content Roots, add them as external libraries. To do this, go into Project Interpreter, click the "gear" on the right side of the Project Interpreter line, and select "More...". Then, while your interpreter is highlighted, there are 5 buttons on the bottom left. Click the one on the right (out of those 5). The text for it, when hovering over, should say "Show paths for the selected interpreter". Once in there, click the plus-sign on the bottom left and select the directory you wish to add.

Didn't know that either - thanks!

Return to “Whatever”

Who is online

Users browsing this forum: No registered users and 12 guests