Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Python (http://www.chiefdelphi.com/forums/forumdisplay.php?f=187)
-   -   NEW TO PYTHON (http://www.chiefdelphi.com/forums/showthread.php?t=135998)

FrankenmuthK 22-03-2015 13:29

NEW TO PYTHON
 
New programmer to python... Looking for tips, instructions on how to program for FRC, and anything else I need! Thanks

Steagles 5215

TimTheGreat 22-03-2015 17:44

Re: NEW TO PYTHON
 
Welcome. You have made a great choice in switching to python.

http://robotpy.readthedocs.org/en/la...ide/index.html

This is documentation for wpilib, python style. Most of what you are looking for is in here. For choosing a 'method' of robot programming, iterative is pretty straightforward, and if you are up to it go with sample robot. Stay away from command though.

If you have any more questions, just ask. Robotpy (the libraries for FRC python) has a freenode channel, http://webchat.freenode.net/ #robotpy and 1418 programmers are generally on, and we're always glad to help.

techplex 23-03-2015 19:20

Re: NEW TO PYTHON
 
Quote:

Originally Posted by TimTheGreat (Post 1460685)
Stay away from command though.

Why do you recommend that to stay away from command based?

TimTheGreat 23-03-2015 20:02

Re: NEW TO PYTHON
 
Quote:

Originally Posted by Techwiz (Post 1461263)
Why do you recommend that to stay away from command based?

Even though FIRST recommends using Iterative or Command Based, command based is generally found to be harder, but more so that Iterative/Sample are just so easy in python. There's also more support for them (forum wise).

FrankenmuthK 23-03-2015 21:59

Re: NEW TO PYTHON
 
Quote:

Originally Posted by Techwiz (Post 1461263)
Why do you recommend that to stay away from command based?

What would you suggest for a new python programmer?

x86_4819 23-03-2015 22:53

Re: NEW TO PYTHON
 
Now i'm curious, did you see my team's display about python at the Great Lakes Bay Reigon Competition?

If you have never programmed in python before, you might want to start by learning the basics of the language before diving into programming FRC robots. I have found that codeacademy.com has a pretty good primer for learning basic python.

TimTheGreat 23-03-2015 22:57

Re: NEW TO PYTHON
 
Dustin Spicuzza (virtualD) has also created a python learning package called pybasictraining. You can find it in Team 1418's github, https://github.com/frc1418/pybasictraining.

TimTheGreat 23-03-2015 23:02

Re: NEW TO PYTHON
 
Quote:

Originally Posted by FrankenmuthK (Post 1461346)
What would you suggest for a new python programmer?

Well... that's tough. Because python is so versatile, the only real difference between iterative and sample is that in sample you create your own loops. This can, however, be hard. So I think your safest route would be iterative. It is very easy to understand and you get the same capabilities as sample robot.

virtuald 24-03-2015 00:00

Re: NEW TO PYTHON
 
Quote:

Originally Posted by FrankenmuthK (Post 1461346)
What would you suggest for a new python programmer?

As said previously, learning the python language in general is a good place to start.

Python in FRC has a simulator that you can use to test the programs out that you create, and there's a number of examples available to look at:

Fauge7 24-03-2015 00:15

Re: NEW TO PYTHON
 
Command based is made for more object orientedness. If you really want to do those the simplest way would be to use java/c++. Stick to iterative though because you seem many teams trying to do their own stuff in simple and it ends up not being simple. Python is still a great language for frc and i hope to see it more developed.

techplex 24-03-2015 09:31

Re: NEW TO PYTHON
 
This year we used Java and command based. For the most part we love how command based allows us to have the appearance of doing multiple things at the same time. A couple of the student members have got a pretty good handle on how to write command based code.

As the programming mentor I find java to be very verbose. We find eclipse to be very cumbersome and heavy. I severely miss the days of netbeans. We were thinking about trying python with JetBrains pyCharm.

@x86_4819
Quote:

Now i'm curious, did you see my team's display about python at the Great Lakes Bay Reigon Competition?
I did not see you display. Is there photos of it anywhere? My team is from Maine so we haven't quite traveled that far.

TimTheGreat 24-03-2015 10:58

Re: NEW TO PYTHON
 
Quote:

Originally Posted by Techwiz (Post 1461498)
We find eclipse to be very...heavy.

Why do you find it heavy? Is there something wrong with earth's gravitational pull where you live?

x86_4819 24-03-2015 11:01

Re: NEW TO PYTHON
 
Quote:

Originally Posted by Techwiz (Post 1461498)

I did not see you display. Is there photos of it anywhere? My team is from Maine so we haven't quite traveled that far.

Sorry, I was trying to ask FrankenmuthK.

FrankenmuthK 24-03-2015 14:03

Re: NEW TO PYTHON
 
Quote:

Originally Posted by x86_4819 (Post 1461380)
Now i'm curious, did you see my team's display about python at the Great Lakes Bay Reigon Competition?

If you have never programmed in python before, you might want to start by learning the basics of the language before diving into programming FRC robots. I have found that codeacademy.com has a pretty good primer for learning basic python.

I did not see it

FrankenmuthK 24-03-2015 14:04

Re: NEW TO PYTHON
 
Quote:

Originally Posted by virtuald (Post 1461421)
As said previously, learning the python language in general is a good place to start.

Python in FRC has a simulator that you can use to test the programs out that you create, and there's a number of examples available to look at:

Where would I find the simulator

TimTheGreat 24-03-2015 17:25

Re: NEW TO PYTHON
 
Quote:

Originally Posted by FrankenmuthK (Post 1461638)
Where would I find the simulator

Once you code, in eclipse you can create a runtime environment with 'sim' as the argument, or in terminal, type
Code:

python robot.py --sim

virtuald 24-03-2015 22:05

Re: NEW TO PYTHON
 
Quote:

Originally Posted by FrankenmuthK (Post 1461638)
Where would I find the simulator

What Tim said. Plus, to actually install it, you should install pyfrc. See the website for installation instructions, and you can read about simulator usage there too.

tcjinaz 25-03-2015 22:14

Re: NEW TO PYTHON
 
Quote:

Originally Posted by TimTheGreat (Post 1461558)
Why do you find it heavy? Is there something wrong with earth's gravitational pull where you live?

:)

It's a resource hog, therefore it places a heavy load on its host, so it makes the world seem like gravity is exceeding 1G

At work, we can pile more Emacs users on a VNC server than Eclipse users.

Fauge7 26-03-2015 10:29

Re: NEW TO PYTHON
 
For python you should not use eclipse and probably use some other ide. It is a resource hog but if you have a computer made in the last 3-4 years your should be able to use it. Don't use a classmate to run eclipse and you should be fine.

Aero 27-03-2015 10:57

Re: NEW TO PYTHON
 
Quote:

Originally Posted by Fauge7 (Post 1462367)
For python you should not use eclipse...

I disagree. If you're familiar with Eclipse, it's not a terrible Python IDE, and familiarity will make your development much easier. If you've never used Eclipse or any other Python-supporting IDE, I'd recommend JetBrains' PyCharm. They'll also give you full educational licenses of all their software if you email em and ask!

mistersands 04-05-2015 08:21

Re: NEW TO PYTHON
 
Is the free community version of PyCharm sufficient for FRC purposes?

TimTheGreat 04-05-2015 08:34

Re: NEW TO PYTHON
 
Yes but you should definitely use eclipse so you can make use of the pyfrc plugins

x86_4819 04-05-2015 09:25

Re: NEW TO PYTHON
 
Correct me if I'm wrong, but the only thing that the plugins do for you is give you nice pre-configured buttons to launch your code with the various runtime options (run, deploy, sim, etc) -- which you can easily setup run configurations to do this in PyCharm. I have found PyCharm Community edition to work very well, and have used it exclusively over the past FRC season.

virtuald 04-05-2015 10:20

Re: NEW TO PYTHON
 
Quote:

Originally Posted by x86_4819 (Post 1479813)
Correct me if I'm wrong, but the only thing that the plugins do for you is give you nice pre-configured buttons to launch your code with the various runtime options (run, deploy, sim, etc) -- which you can easily setup run configurations to do this in PyCharm. I have found PyCharm Community edition to work very well, and have used it exclusively over the past FRC season.

This is correct. If you're not used to configuring things for yourself, Eclipse is the way to go. However, I've heard good things about PyCharm too.


All times are GMT -5. The time now is 00:03.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi