https://www.jetbrains.com/pycharm/
I'm a fan of jetbrains ide's, the python flavored brand is pretty nice. IDE's are totally personal preference though. The nice thing about jetbrains IDE's is that they've pretty much got a flavor for every language, so once you're familiar with one, the others are just as easy to use.
Download and install PyCharm Community edition. It'll install all the necessary components for you.
https://www.jetbrains.com/pycharm/download/#section=windows
It's really solid. Great debugging features. Python console available right in the app. I use it every day for professional development. (Well, I have the pro version at work, but using community edition at home is really good, too.)
> I'm just frustrated as hell. I've learned some of the basic programming concepts (functions, a little about algorithms, the basics of how object-oriented programming works), but it seems that in order to actually do anything in python, there is a TON I have to learn just to get started at all.
That's any language, man.
Only because I've got years and years of coding under my belt did I find Python relatively easy to pick up. There were still a lot of nuances to it that took me a while to get used to. That said, I was productive with it almost right away. Mostly because it's a good language.
Keep banging away at it. Python is a worthwhile language to learn.
Get some good tooling! I've no experience with python, but I've loads of experience using JetBrains tooling, and I can imagine PyCharm will help you be highly effective. It (probably) can:
You could use something like Ponicode that should help you auto-generate useful unit tests.
Edit: PyCharm is £6.90 a month when bought by an individual, or £69 for the first year. The big £150 on the front is for organisations to purchase it. And yeah, individuals can use the individual license when working for a company - honestly, it's one of the main reasons I stayed sane at my last job!
One thing I'd like to add to that is the indentation width -- OP seems to be using 2 spaces for indentation, while the recommended size is 4 spaces.
Actually, I recommend for OP to check out an IDE (Integrated Development Environment, example -- PyCharm) that does style checking, and then run this project in it. All style errors will be visible immediately.
OP was able to successfully communicate the program to his computer, now it's up to them to do the same for humans lol
PyCharm has a free community edition. You only have to pay if you want stuff like web development and database features.
Scroll to the bottom here to compare: https://www.jetbrains.com/pycharm/features/
I suggest PyCharm by JetBrains. ~~Can't remember if it comes with Python or if you need to install that separately.~~ You need to install Python separately first. You can download Python here.
Here is a quick start guide for PyCharm. Google should be able to help you out with most questions you have.
I recommend JetBrains PyCharm. It has great debugging features and is easy to use. They offer a free community version, which has most of the features you will need to start with and then there is a professional edition which has more features.
Type hinting allows the development of smarter tools such as type checkers, refactoring editors, optimization tools, IDEs, intelli-sense, fuzzers.
https://www.youtube.com/watch?v=eVChXmNjV7o#t=355
https://www.jetbrains.com/pycharm/webhelp/type-hinting-in-pycharm.html
PyCharm. They have a free community edition, or a licensed professional edition.
https://www.jetbrains.com/pycharm/features/editions_comparison_matrix.html
If you are using it for an open source project, you can apply to use it for free. I use it daily, and it is awesome.
It took about a month for me to learn Python where I was cranking out quality code. Start with https://www.codecademy.com/learn/python which is a good primer to familiarize oneself with basic syntax.
Unfortunately, you won't learn good Object Oriented Programming (OOP) with that tutorial, though.
In order to truly grasp "classes" and OOP, you'll need some good real-world examples to work with. Perhaps even a mentor with whom to consult on a regular basis any time you run into problems as well as someone to review your code and let you know when you're way off track.
Other things you should learn right off the bat is the Logging module. Instead of doing print (x)
everywhere to help you debug, you should do logging.info("some info")
or logging.error("some error")
-- Then when you're running your code, you can specify what depth of logging info you want to see as well as where to log the info to (eg. console, log file, etc.)
Learn how to try and handle exceptions as well as how to raise your own exceptions or when to re-throw exceptions. And understand that exceptions are for when things go wrong, as in show-stoppingly wrong. This requires more reading and practice than I can explain here. :)
As a language, I find Python very flexible, yet one which does not inherently encourage good programming practice. It's kind of sloppy, in fact. Naturally, some people find other languages which enforce good programming practice an annoyance, so maybe this freedom is a nice thing. Frankly, a beginning programmer usually benefits from stricter programming practices in the long run.
Only the most recent version of Python (3.5) allows for my most favorite of the disciplined programming techniques (proper Type Hinting.) -- https://www.python.org/dev/peps/pep-0484/
Also, download and use the Community version of PyCharm 5.x -- It's free and it is also really pretty good! It also supports Type Hinting! :)
Just start here and after a week if you find yourself enjoying coding, you'll likely find a decent opening after months of rigorously practicing, with countless free resources to practice and showcase your skill.
JetBrains' PyCharm - Community Edition is free and there are student packs available as well.
Automate the Boring Stuff with Python is an excellent starting point.
Eclipse with PyDev
PyCharm (My favorite)
The default IDLE that comes with Python installs.
Komodo IDE
Or you can use any text editor and the command line.
I'm going to give you the benefit of doubt and give the links, but I need to point out that it would have been quicker for you to Google it yourself than ask the question here on Reddit...
Python: https://www.python.org/downloads/
PyCharm: https://www.jetbrains.com/pycharm/
I would highly recommend PyCharm as an IDE. I'm trying to learn programming in general and that by far has been the best IDE for Python I've found. The same company also has products for other languages as well.
I'm not Bill Gates (shocking, I know), but don't focus on what language. Just kinda pick one and learn the basics. If you focus on the language and its differences with others then you're likely to get lost.
But if you really need a recommendation, I really like Python. It's easy, you don't have to worry about memory and data types, and there's a lot of resources out there for it. Perhaps look into getting PyCharm for an IDE if using the default IDE (IDLE) or text editors isn't helpful enough for you. It's a fun language and probably one of my favorites. And if you need help with getting Python up and running you can always PM me and I'll try to help you out.
I would use pycharm
Each time you make a new project it will ask you which python you want to use, if you want to create a virtualenvironment for it, it will help you with your code, show errors, warnings, you can execute part of your code, debugging, access terminal...
Very clean for beginners
The current year price for individuals is:
At the end of this year, I'll be finally paying 53€ for it.
I've found a couple other non-GIS software tools to be useful:
PyCharm Edu → PyCharm Community → PyCharm Professional
Also, there are Python Tools for Visual Studio, since you're experienced with it.
Then you can use PyCharm's integrated git support, or git via the command line or some other GUI.
Thank you so much for this, I'm teaching python on a government-sponsored program on a third world country, and this helps a lot.
You removed the ISIC card requirement, isn't?
EDIT: Can I make my own/edit the existing lessons? I would like to translate the lessons to Spanish
EDIT2: I'm just reading the "Getting Started for Educators" doc, this is great
> I want it first of all for C++ and Python!
That's absolutely no reason to switch to another OS. Both run perfectly fine on Windows.
For C++ you can use Visual Studio Community Edition which is free and somewhat "the standard" IDE.
For Python, there are many options, like PyCharm.
The OS should not really influence programming. Sure, several languages (like Ruby) work better in *nix (Linux, OSX, etc.) environments because their toolkit was originally built for those OSs, but, in general, the OS has very little influence on actual programming.
I second PyCharm. I've been using it for over 3 years. They recently came out with PyCharm Educational Edition which will help you learn Python. When I'm not using PyCharm, i use vim.
PyCharm is very popular and very powerful. There is a free and a paid version, but the free version is sufficient for most tasks. The main complaint you'll see about PyCharm is that it uses too many resources (CPU and memory), but if you have a relatively recent computer it should run fine.
Edit: PyCharm calls on Python when it needs to actually run your programs, so as long as you choose the correct Python interpreter within PyCharm, it will see all your libraries.
I really like PyCharm, and with it's PEP8 linter (not perfect) and some support for debugging, it can help you write better code after you've gotten some experience.
But you need to get that experience. A lot of the tooling built around Django feels like magic if you don't know Django. It's hard to debug what went wrong when your management command is run in, for example, the wrong virtual environment if you don't understand that Django is just calling manage.py
.
I'd recommend using the free PyCharm Community Edition to set up your first Django project following the official tutorial. (This edition doesn't have any built-in support for Django.) Then you can see if you like the editor (and Django) enough to shell out for the Pro edition.
Finally, not to be snarky, but this tutorial is the first thing that comes up when you google "Django PyCharm".
Love the edits, I can see the frustration, people always have to bring Vim up.
I love Pycharm for pretty much all the points you made, plus one more: Type hinting.
Plus it's easy to setup virtual envs.
and manage library/package versions.
and refactor.
and write unittests quickly.
PyCharm does a range of checks on your code while you are writing it (also known as code inspection), such as for use of undefined variables, PEP8 checks, type errors to some extent (more if you use python3 type annotations), spelling errors... some general overview you can find here https://www.jetbrains.com/pycharm/help/code-inspection.html
You can get the pro features for free through the early access program. You just need to reinstall each month. Links for intelligence and pycharm, but I think their other products also have it.
In my opinion the best way to shortcut all the confusion with python libraries/packages is to download the PyCharm Community editor and use that to manage any libraries you use. It will also probably make you into a better python coder by giving you continuous feedback as you code.
https://www.jetbrains.com/pycharm/download/#section=windows
Once you have it you can get pygame by starting a project, navigating to File->settings->Interpreter and, once you have an interpreter (i.e. a version of python) selected for your project, pressing the green plus on the right hand side and searching for pygame in the list of available libraries. With this method it is now easy to add any new libraries you like in exactly the same manner with no faffing about.
I can also tell you that so long as you have a version of python 3 and a recent version of pygame it will make no difference to a beginner course. The only significant difference when starting out is between pygame 2 and pygame 3.
> e.g. describing migration to Dotty as an impossible task - they are developing a tool for migrating which should cover majority of changes
However, an automated tool that covers a "majority of changes" isn't the same thing as an automated tool that can convert a "majority of projects".
Also, automated conversion tools can help library authors support both the old and the new language. It happened with python, with the jump from python 2 to python 3. Library authors could develop in python 2 and use 2to3 to generate the python 3 version for the people who made the jump. As of 2 years ago, python 2 still had a very significant market share.
This sort of thing has gone wrong before, with e.g. python 3 or perl 6. Why do you think it's going to go better this time? What specific mistakes did python make that Scala is avoiding?
TL;DR it's full of errors; the official Python docs are great and verified, and if you need a simpler way to check how things work try out IPython or PyCharm Community's great builtin Python skeletons (ctrl+click a function to see its signature and description).
You can also always run eg. help(list.extend)
to see the docstring, and dir(x)
will show you all the attributes x
has, if you need that.
PyCharm is generally considered the most comprehensive development environment. There's a free ("Community") version and a paid ("Professional") version. The paid version adds a lot and is generally considered worth it for more advanced development, but the free version does quite a bit on its own already. There's also an "Edu" version designed for learning Python - I don't know that much about it but it seems like a good product.
You might also want to look into Visual Studio Code (different than plain "Visual Studio"), which is branded as a Text Editor with development features. It's a little more lightweight and you likely wouldn't feel as overwhelmed.
You might also want to look at Jupyter Notebooks - they're a "notebook" development environment, where you have code snippets and the results of that code side-by-side.
I'm a fan of PyCharm as well. The Community Edition is free and has more than enough features for learning Python. Although I've never used it, PyCharm also has an education edition: PyCharm Edu
The best is your choice.
Myself I just use a plain text editor with highlight color plugins. To just make it easier to debug. And just run the python script through a python interpreter.
There is
PyCharm
PyDev
Wing IDE
Eric
Spyder Python
Pyzo
Thonny (Bonus for the Beginner)
http://www.linuxandubuntu.com/home/best-python-ides-for-linux
My favorite text editor for coding is Pluma with all it's plugins. Then I just run them though a interpreter.
For you I guess try out PyCharm
There are a handful of webinars posted here: https://blog.jetbrains.com/pycharm/category/video/
A more basic run through of core features can be found here: https://www.jetbrains.com/pycharm/documentation/
/u/pauleveritt may know of some other sources. And there is always youtube, just be wary of videos made with older versions. That has tripped me up a time or three.
My sympathies. Your professor must think wasting time with and cursing at Notepad builds character, or something. I'd say that's not true. PyCharm (Community Edition) is free and excellent.
> how to install multiple versions and allow both to be functional
Try google searching next time. This is a very common question asked about Python.
> Second is a good debugger
I'd recommend JetBrain's Python IDE PyCharm. The debugger is available even in the community edition. https://www.jetbrains.com/pycharm/
Congratulations on switching to PyCharm. First off, take a look at these two quick start guides.
My favourite features:
Python.
I graduated Civil then worked Aerospace for 3 years and Python was invaluable for the amount of data we used. I was lucky enough to have some time to learn it and apply it to my job. I've since moved back into Civil and I'm still able to apply Python to tasks here and there. I'd say any discipline can benefit from knowing a language like Python (fast development/deployment, easy to learn, scriptable).
To start I'd download:
PyCharm Community Edition (Free development environment)
Anoconda Scientific Python Distribution which is Python bundled with a ton of scientific modules. These will likely serve you through any project you would encounter.
I second PyCharm. In fact, there is a special edition of it called PyCharm Educational Edition that has tutorials and explanations on how to use the programming language right on the IDE.
I only started learning python last summer but I love it. Would recommend Pycharm community edition for anyone that's in need of a good IDE.
PyCharm from Jetbrains can handle types and warn and inform you if you're doing something weird.
Plus the free edition is very good so no need to splurge out just yet.
The one I found most useful so far is code profiling. It gives you a detailed statistic of what parts of your code take most processing time and how different methods are called. It came in very handy during one of my projects involving realtime functionality. See more about the differences here.
I only have access to the professional edition bc I'm a student. No way I'd pay the full commercial price.
I've been using pycharm for a little while now and I really like it. It's been pretty helpful for me, and its a lot better than a plain text editor. If you didn't already know there is a free community edition.
Thats good general advice, but I made this specific recommendation from personal experience. (Plus it seems that OP is already using Pycharm for work)
https://www.jetbrains.com/pycharm/
https://sales.jetbrains.com/hc/en-gb
You can read the licensing here, its not very complicated.
Obviously OP should review it first before proceeding, but AFAIK Jetbrains is very clear that personal licenses can be used at work. The licenses cannot be shared with other people though.
Pycharm Community edition is free and pretty good for the needs we usually have. Maybe you want to try in JavaScript subreddits or C where they are not so lucky.
I personnally like PyCharm. Free, pretty easy to install and runs like a charm. It has quite the ability to do what you want it to do and have always sticked to it. It never betrayed me so far, be it for simple or complicated apps. You can also customize the hell out of it. Their website gives you a good overview of it.
Well, since you are programming in Python, let me introduce you to an entirely new (for you) way of coding: an IDE (Integrated Development Environment)
Take a look at PyCharm Community which is free. It will completely change the way you code and (after some learning curve) boost your productivity.
I'm a big fan of PyCharm. It'll work under both Ubuntu and Windows, and will get you more functionality with less configuration than vim or emacs will.
They've recently come out with PyCharm Edu, which might also be interesting to you.
> Python doesn’t really do OOP
Your idea of what the definition of "OOP" is, is flawed. It doesn't do java style OOP, but notice how python is older than java :P
> No type-hints
Wrong: https://www.jetbrains.com/pycharm/help/type-hinting-in-pycharm.html
> There always doesn’t seem to be any support for tags like @return @param
There are. And the syntax is "@return description here" and "@param description here" in fact :P (or ":return ...")
> Named parameters are very useful, but they do feel like some syntactic sugar to abstract away the fact that your function has too many arguments
If by "too many" you mean "more than 1" then... yes? I guess?
> If I was going to be building anything that could conceivably be described as ‘monolithic’ or would benefit from the comfort of type-safety, I don’t think I would choose Python.
Your loss. I'm working on a quite big monolithic code base with python and it's quite pleasant. You DO have to use PyCharm though in my opinion.
PyCharm and Anaconda and (Pycharm and Conda)
Did you see the Conda integration also?
And... have you played with the concurrency visualization yet? Really fun.
PyCharm 4 has full editor/refactoring/completion/inspection/etc. for JS, debugger via browser plugin, and some support for Node.js as well. I suppose if your project is primarily JS based you might need WebStorm instead depending on what tools and frameworks you use, but if you're developing a Python based web app you shouldn't need to worry about that.
See this part of the docs for more details.
> The semantics of any "good enough" type hinting system will continue to show limitations for all but the most straightforward uses.
PyCharm, arguably the most powerful Python IDE on the market, already uses type annotation to provide warnings about potential type errors, autocompletion, refactoring, etc. (Basically everything you expect from an IDE when using a statically typed language).
Of course sometimes PyCharm gets confused when subjected to highly dynamic code. That's the price to pay (I sometimes have to "dumb down" my code to prevent false warnings by PyCharm, but most of the times it makes the code also more straightforward for human ready, so that's probably also a good thing).
BTW: here's the doc about how type hinting works in PyCharm: https://www.jetbrains.com/pycharm/webhelp/type-hinting-in-pycharm.html
My point being: it's OK to argue about the syntax, the cleanliness, etc. of the proposed approach (by Guido), but I believe the point that type hints are already useful for Python developers is already proven.
I remember back on release PyCharm was really slow, but right now I have no problems with the speed what so ever.
so yeah not sure what are you talking about here, check it out on https://www.jetbrains.com/pycharm/ maybe you got wrong version?
EDIT: misread your post
Python is awesome. DM me if you have any questions at all.
Head over to Pycharm and get the community edition. Also, you really should look into Project Euler. It's a great way to learn how to program if you like math.
​
I don't know notepad ++ these days, I remember it as being a good text editor when I was running Windows but that was a long time ago. I'd recommend using the PyCharm Community IDE. As you are starting out, you won't need 90% of what it can do but you'll grow into it as you learn and do more and more.
If you want to just use Notepad ++, you could simply use it to write the code and then run it on the command line (python filename.py
in the appropriate directory)
Starting from C++ sounds painful. Your early experiences would consist of obscure error and unhelpful IDEs. Java is way better in that regards. Breaking the thread format, I'd suggest trying Python instead.
A 2 month subscription does seem odd. But, for what it's worth:
If you are just buying it for yourself, PyCharm is not that expensive. I'm past my third year now and it's less than $5 a month.
> US $ 89.00 / 1st year > US $ 71.00 / 2nd year > US $ 53.00 / 3rd yr onwards
Pycharm is way better than any text editor out there for Python development. Virtualenv integration, docker integration all are first class and you don't need to fight your editor to do a basic thing like looking into the library code. With some configuration, it might be possible in editors like Code or Sublime but what's the point when everything just works with Pycharm. Also, navigating any medium to a big project is a task with editors as they don't have any contextual indices to give relevant information. The Python3 type annotations support is nicely integrated too. Just look at the feature set, I don't think any editor matches it https://www.jetbrains.com/pycharm/whatsnew/
P.S. Was coding in Vim all the time before for almost 5 years.
Nothing against the editors, just that coding productively is much easier with Pycharm.
> I have things split up into smaller parts. Is doing so good practice?
Yup yup yup. Breaking things into smaller, reusable, bits is almost always a good idea in any language.
> Should I create multiple .py files?
Sometimes. You should start by breaking your code into functions and classes - if there are a number of things that are all related, then it might be a good idea to move them into a separate module.
If you end up with several modules that have a compelling reason to be grouped together, you can move them into a package. You probably wouldn't need to do that, though; packages are more meant for distributing bits of code to other people.
> And is there a way to have a program call these other “sub” .py programs?
Yes. All .py
files are modules. When you run a .py
file, you're really just running the contents of that module. You can use the contents of one module in another via the import
keyword.
> Should I switch to a different editor? [...] What editor do you use and why?
So this is a rather big question - I personally love PyCharm. They have a free community version, or you can get their professional version free with an edu license. I've heard Atom getting a lot of attention. Some people swear by things like Jupyter, or just plain old text editors.
Honestly I'd recommend trying out PyCharm - it's certainly the most powerful and flexible of all the python editors. Since you talk about making large projects, PyCharm would certainly help you out the most - but it might also feel a bit bulky or slow.
You could set it up to work with Anaconda's interpreter if that's what you want. You can also work with IPython notebooks in it, but that can get clumsy if you start working with multiple files. Notebooks aren't really meant for large projects.
The "free trial" label disappears if you link it to a MS account, Visual Studio Community is actually 100% free if you have less than 5 people on your team.
But for Python I prefer Pycharm.
Code smells, type checking, etc. I don't have a complete list, but this should give you an idea.
Also, I thought I would mention too that they have an educational version which is also free.
> I don't need the Enterprise because I'm not using a fat framework.
Do you mean PyCharm Professional? It also supports Flask. There are a lot of great features built in to the Professional edition (not just Django support) that your comment seems to be glossing over.
https://www.jetbrains.com/pycharm/features/editions_comparison_matrix.html
Building ontop of /u/The_Droide's answer
Instead of Eclipse I'd personally suggest a JetBrains IDE for your language of choice
If you're starting to learn python I'd suggest (without having tried it myself) PyCharm Edu, which has integrated learning tools of some sort for a Python IDE
Other than that I can really suggest their Java and their JavaScript IDE's which are what I use.
Im assuming you know where to download the base python application, but I would suggest downloading an IDE. I'd recommend using PyCharm's community edition. Here's the download
I'm not sure how new this is but I saw it just today, JetBrains released Pycharm Edu. It is sorta like Google's python course but it's in a stripped down version of their IDE Pycharm.
Also when you start making your own projects don't ask yourself what could be useful to other people or you, but something that you could can do in a month or less by yourself. Quick return on development when learning is important (depending on you) to encourage you to do more. Good luck learning and don't be afraid to ask people things.
I haven't found the need for a full IDE for Django development, but I've heard good things about PyCharm.
I just use Sublime Text 3 with some Django-specific plugins and Anaconda.
You're fighting a very uphill battle using XCode for Python, especially in the way you are.
Definitely check out pycharm: https://www.jetbrains.com/pycharm/ if you really want something that will make it easy to launch python WHILE you are developing.
> In Django, a related model gets an attribute on the relatee model, so that a Question that has related Choices will magically have an object at question_object.choice_set that's used to access that question's set of choices. iPython completes question_object.cho[tab] just fine, and suggests it with question_object.[tab], and then further suggests methods for that object with question_object.choice_set.[tab]. Spacemacs and PyCharm CE neither recognize at all that there's an attribute named question_object.choice_set
class Question(models.Model): ... def choice_set(*args, **kwargs): """ :rtype: Choice """ return super(Question, self).choice_set(*args, **kwargs)
This hints to PyCharm that there IS a method called choice_set and that it returns a Choice instance. (Note: I don't think choice_set returns a Choice instance, it's been a while since I Django)
Here is a full article on PyCharm's type hinting support. It starts with Python 3, but the legacy methods are still supported in 2. https://www.jetbrains.com/pycharm/help/type-hinting-in-pycharm.html
What you are asking about is an IDE (Integrated Development Environment). The best one for Python is PyCharm - the Community Edition is free. However, you should still learn how to run Python (and other) programs from the command line.
SCSS compiling seems painless enough to get rolling: https://www.jetbrains.com/pycharm/help/transpiling-sass-less-and-scss-to-css.html
TS debugging also seems feasible, but slightly more of a pain in the ass: https://www.jetbrains.com/pycharm/help/debugging-typescript.html
Not sure if all those steps are required every time, or just an initial setup type thing.
I will agree that support for what you want is sketchy at best, but it does seem possible. Not sure how it compares to the support you get in whatever tools you are using now. Things like this make me glad my current work is almost entirely python focused. When I do have to use something else it is clearly separated and I can swap entirely to a different toolset rather than brow beating PyCharm (or VS, or Eclipse, etc etc) into doing what I need.
You wont know how to setup an ide until you get preferences based on experience. Which is why nobody recommends ide's to beginners, it only adds complexity that doesn't need to be there till it does.
A virtual environment is a python module, that sets up a folder with modules separate from the main interpreter anywhere else in your computer. It helps isolate modules so you don't have to worry about breaking anything because of updates or incompatibility's.
edit: i am going to guess you google searched for this all ready but if you din't: https://www.jetbrains.com/pycharm/help/creating-virtual-environment.html; https://www.jetbrains.com/pycharm/help/adding-existing-virtual-environment.html you'll need to tell us what's not clear to you about that and what you tried that din't work.
You can use type annotations in Python 2 with IntelliJ/PyCharms. It uses docstrings. I found it helpful, and it helps to have better completion and code navigation.
https://www.jetbrains.com/pycharm/help/type-hinting-in-pycharm.html
/r/learnprogramming and /r/Python are great. First place to start is installing python followed by someting to type in, pycharm community is my favourite. Feel free to pm me if you want.
From this page, it looks like PyCharm can auto-detect some interpreters.
That still doesn't save the step of specifying the interpreter for each project in the project settings.
Are you working on all of the projects all the time? I usually just hit the setup when I go back to work on the project if it's an old one.
Whatever language you're with, stay persistent, and try not to get discouraged when you're frustrated. It takes a long time to get a good feel for this stuff.
I'd also recommend using PyCharm when you're starting with python. https://www.jetbrains.com/pycharm/ Their debugger will probably help you a lot when you get stuck on certain complicated processes.
In addition, if you get stuck and google something, try to understand "why" the answer is correct and not necessarily that it works.
Lastly, when I learn a language the first thing I do is try to implement a binary tree. http://en.wikipedia.org/wiki/Binary_tree It will give you a good introduction to a broad number of paradigms in a new language and also introduce a widely used low-ish level datastructure.
Good luck!
That thing that you don't know the type of ultimately comes from a method somewhere, right? You can annotate method return types (as well as parameter types) via generic doc strings. As long as the method producing your thing has its return type annotated, the IDE knows its type. If the thing comes from a third party library, well you'd hope that that library would have doc strings on its API methods.
Of course if the code is really dynamic you will get stuck. If there are strings being passed around all over the place in lieu of real data types then you're going to have problems. But you can always wrap a string in a class to get type checking, which has obvious design benefits anyways.
Since this article is Python centric, here's how annotations work in PyCharm.
Visual Studio is an amazing IDE, but the myth that other languages do not have a good IDE is not true. Check out PyCharm for example. Jetbrains makes great IDEs for many languages.
It is my experience that many developers in languages like Python, JavaScript, and Ruby do not use an IDE though.
PyCharm supports pretty much everything. It can actually manage your virtualenvs for you. See their docs.
If you want to be as robust as possible, create a new virtualenv for every project (or perhaps group of projects, if they are closely related). You can choose which interpreter (i.e., which virtualenv) to associate with each project in Project Settings > Project Interpreter.
You can even install packages through the Project Interpreter window, so you shouldn't even need to open the Command Prompt at all if you prefer the GUI.
Assuming you're using Windows, just install python from python.org or (my favorite and personal recommendation) http://continuum.io/
Then just get pycharm free from https://www.jetbrains.com/pycharm/download/
Start up pycharm, when you set up your environment point it to the python.exe you want to use. You can install 3rd party libraries right in the options, start up a python terminal right in the IDE, use source control, set up remote ftp, whatever you need to do down the line.
The alternative is to either set up sublimetext with python interpreters and all that, or play around with the windows command line which is a pain in the ass.
Just use pycharm. It's easy.
I took this course last 'semester'. The teacher is good and it's a VERY entry level course. If you're more ambitious try codeacademy. I also recommend PyCharm as a desktop companion to learn with. Also this is the best tool to help you find bugs.
Good luck! If you want more feedback or have questions I'd love to help you guys for once.
They recently released Pycharm Educational* Edition. It is probably the best option out there for learning Python.
*educational as in for learning Python, not as in an academic license. It is specifically geared for learning the language, you can't go wrong.
Hi,
Thank you very much for your quick answers. This is great that Python can do the job. What a relief, I was concerned that I had to learn PHP. OK for PostgreSQL, I don't know it yet but I know very well relational & SQL.
For Q2 I meant the dev environment. i.e an IDE with which I can write code, in a project oriented way, syntax highlighting, intellisense, debugger, Unit testing integration, Git integration, configuration management (differentiate between dev/prod deployment), possibly building package for web deployment too.
In other words, I would prefer to avoid doing unconnected tasks manually: editing a bunch of separate scripts using a text editor, using console for debugging & testing, and FTP back and forth to the Web Server.
As I am familiar with IntelliJ Idea, I am attempted to go with PyCharm. I wonder if it's a good idea. I'll need to get the Pro version ($100) to support frameworks and SQL. It's OK if it is a good IDE. However I would prefer to check with you before committing to a final dev environment.
If you just want to get familiar with it, they offer a community edition for free. The paid features basically boil down to extended support if you're doing data science (numby, matplot lib, etc) or web development (django, flask, extensions for also doing JS).
There’s a lot of ways you can do it, including everything mentioned in this thread.
You could run Python in an IDE (Integrated Development Environment) like PyCharm, but sometimes they can be overwhelming as a starting point.
I’d keep it simple and just follow these instructions here: Python in Visual Studio Code
Start with the community version. When you outgrow it, meaning you have specific needs that require specific features that are available in a commercial version, upgrade. However, before you pay full price see if you can get it at a discount. Are you a student? Pycharm Pro is free for students. Do you know a student? Have them buy it for you. Do you know anyone who uses it at work and can hook you up? Are you involved with a Python user group or a non-profit? That gets you a copy for free.
If you hustle a little you might be able to get pycharm pro for a lot less than retail without having to go to the dark side. Pycharm isn’t expensive and there are a lot of loopholes that get you discounts
Pycharm retails for $89 per year. Worst case scenario, approach your elderly neighbors offering tech support for $10 an hour. Tell them you’re saving up to buy some software so you can learn programming. Odds are you’ll start a business by accident. You’ll be that nice boy from down the block who fixes their computer. You’ll get your money and a bag of cookies or a few beers. You spend a few hours teaching grandma how to use iPhoto and updating her antivirus and you’ll have enough for the license by September.
Personally, i use a ide(integreated development environment. Basically the place where you write code+ a bunch of other features such as debuggers/inspections, autofilling, some i know use terminal, and many other things), known as pycharm made by a company known as jetbrains.
https://www.jetbrains.com/pycharm/
Link to the actual ide download.^
And if you do decide to download it, i suggest you download the community edition of pycharm, unless if you want all the other frameworks that the ultimate edition has to offer.
Hey I know you already solved this, but hear me out.
This kind of issues (uppercase or misspell) is actually very very common even for advanced programmers.
In order to work, you need visual cues that will help you program faster and better. Take the time you need and set up a proper environment. Read about virtualenvs, python and IDEs (personal suggestion: Pycharm CE which is free and awesome, but you can use simpler stuff.
This will highlight your keywords, so for example you type
if
and it becomes red because it's a python keyword.
This makes it VERY easy to spot this kind of problems.
The IDE will also highlight common small issues, automatically import the functions that you want, alert you about common mistypes etc..
https://www.python.org/downloads/
https://www.jetbrains.com/pycharm/download/#section=windows
You'll want the 'Community' edition for PyCharm.
I presume you are in a Windows system, so download the files, then run them to install Python and PyCharm. Accept all the defaults if you sre unsure!
Just my opinion, but if you need help in installing Python and PyCharm to this extent, I'd suggestion using Python's IDLE as your IDE to begin with. PyCharm isn't beginner friendly. Trying to learn Python and PyCharm at the same time could quickly become to much for a complete beginner.
>First I want to learn Python and is Emacs suitable for me to learn?
Nope. Use PyCharm.
> I want to learn more languages in the future, and is Emacs suitable for that?
Yes.
Your Mac is fine to work on. That's all I use as a professional developer. You'll wanna download Python on your local machine to start working with it.
You can just create a .py
file and start editing it in any text editor that you'd like. Personally, i either use VIM in the terminal, or PyCharm which is an IDE that helps a lot. There are other IDEs too, everyone has their preference.
If you wanna make something that you can execute, you gotta add if __name__ == '__main__':
, and invoke the functions you wanna run there. This will signal to the computer that it should start executing the code here. If you're new to programming, don't worry too much about the syntax. Just know that every language has its own way to signal this, and this is how Python does it.
You can execute a script by either running it in the IDE, or through the terminal via python3 my_script.py
.
Here's an example of a hello world application:
python
if __name__ == '__main__':
print('hello world')
Here's an example of a hello world application that uses functions: ```python def say_hello(): print('hello world')
if name == 'main': say_hello() ```
I don't believe Pycharm can debug rust code. Pycharm only supports debugging python/Django and JavaScript.
CLion does support debugging Rust however. I can confirm debugging Rust works with CLion 2020.2.1
Have you tried teaching yourself? I'd recommend trying to learn Python first, since it's generally considered to be one of the easiest starting points. Try working through something like (this)[https://www.learnpython.org]. You'll need to install Python, which you can do (here)[https://www.python.org/downloads/release/python-385/], and you'll want an IDE (interactive development environment), which is basically a text editor with extra features like line numbers, automatic indentation, debugging tools, and better code readability. I like (PyCharm)[https://www.jetbrains.com/pycharm/download/#section=windows], which has a free community edition that's served me well.
Also, if you need help with anything, feel free to PM me about it.
Good job!
A bit of advice: IDLE is functional, but very basic. Install a good IDE - it will point out your mistakes, show available functions and their required arguments, autocomplete your variables and generally make the coding process a lot easier. I prefer PyCharm, another popular choice is VSCode. Professional IDEs might seem intimidating at first with all their bells and whistles, but you can start writing code straight away and familiarize yourself with the more advanced features at your own pace.