Learning Python: Getting Started from Java and C++

In summary, Google searches have not been very helpful in finding resources about Python. The O'Reilly books are a good place to start, and once you learn the basics you will be able to start using VPython.
  • #1
Entropy
478
0
I want to start learning python. Lots of people I know say it's a very good language. Right now I know Java and a little bit of C++, but I'd like to experiment with some other languages, specifically Python. Right now I've got Python 2.4 installed on my PC, now I need to know what to do from here. I've run some google searches to see if there are some sites that can provide an introduction to Python, but I haven't found any good ones. So if anyone can recommend a compiler and text editor for Python I'd really be grateful.
 
Technology news on Phys.org
  • #2
go to python.org. the tutorial is really great.

other than that, O'Reily books are awesome.
 
  • #3
Python is an interpreted language, meaning you don't actually compile anything, therefore there is no such thing as a python compiler.

You have two options in terms of running code:

1) Write your code in a text editor and then execute the code:

Example: helloworld.py

Code:
#!/usr/bin/python

print 'Hello World'

./helloworld.py
or
python helloworld.py

2) You can enter into the command-line interpreter and just start entering commands like you do in Matlab or other programs like that.

------------

Python is a very nice language. There are no semicolons and braces to remember.

Just look at the tutorial and you should pick it up rather quickly since you are already famaliar with programming:

http://www.python.org/doc/2.4.1/tut/tut.html
 
Last edited by a moderator:
  • #4
Last edited by a moderator:
  • #5
Thanks, guys. VPython looks pretty cool. Can't wait to start programming!
 

1. What are the main differences between Python, Java, and C++?

Python is a high-level, interpreted programming language that is known for its ease of use and readability. Java is also a high-level language, but it is compiled rather than interpreted. C++ is a low-level language that is compiled and often used for system programming. One of the main differences between these languages is their syntax and the way they handle memory management.

2. How does Python compare to Java and C++ in terms of performance?

Python is generally considered slower than Java and C++ because it is interpreted rather than compiled. However, its simplicity and high-level abstractions can make it more efficient for certain tasks. Java and C++ are both compiled languages, which can lead to faster performance, but they also require more complicated code.

3. What are the main advantages of learning Python as a Java or C++ programmer?

One of the main advantages of learning Python as a Java or C++ programmer is its simplicity and readability. Python's syntax is much simpler and more intuitive compared to Java and C++, making it easier to learn and code in. Additionally, Python has a vast library of built-in functions and third-party modules that can make programming tasks more efficient.

4. Are there any challenges that Java or C++ programmers may face when learning Python?

One challenge that Java or C++ programmers may face when learning Python is adjusting to its dynamic typing system. Java and C++ both use static typing, meaning that variable types are declared and cannot be changed. Python, on the other hand, uses dynamic typing, allowing variables to be reassigned with different data types. This can be confusing for programmers used to static typing.

5. What resources are available for learning Python as a Java or C++ programmer?

There are many resources available for learning Python as a Java or C++ programmer, including online tutorials, books, and courses. Some resources specifically cater to programmers transitioning from Java or C++, while others provide a general introduction to Python. It can also be helpful to join online communities or forums where experienced Python programmers can offer guidance and support.

Similar threads

  • Programming and Computer Science
Replies
9
Views
1K
  • Programming and Computer Science
Replies
10
Views
2K
  • Programming and Computer Science
Replies
8
Views
875
  • Programming and Computer Science
Replies
15
Views
5K
  • Programming and Computer Science
Replies
8
Views
1K
  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
1
Views
726
Replies
6
Views
1K
  • Programming and Computer Science
Replies
8
Views
873
  • Programming and Computer Science
2
Replies
56
Views
8K
Back
Top