Author Topic: Seeking Python 3 mentor/tutor for project  (Read 9961 times)

Offline 4Doose

  • Prepper
  • **
  • Posts: 76
  • Karma: 7
  • At the trailhead to freedom, finally.
Seeking Python 3 mentor/tutor for project
« on: March 31, 2016, 08:34:00 PM »
Hello

I hope this is the right place for this topic.

I have been using codecademy.com and askpython.com for the baby steps in teaching myself python 3.

I have a very simple project I am trying to write a program for an was wondering if there is anyone that would be willing to tutor me as I try and figure this out.

Thank you,
David

Offline theBINKYhunter

  • Does not fall well with plastic guns...
  • Moderator On Leave
  • Survival Veteran
  • *
  • Posts: 5847
  • Karma: 181
  • Not a tactical baddass
Re: Seeking Python 3 mentor/tutor for project
« Reply #1 on: March 31, 2016, 10:48:46 PM »
Hey 4doose, I don't have any Python experience (yet) but one place I would suggest you check out is the LearnPython sub over at reddit.com: https://www.reddit.com/r/learnpython

I've used reddit for a lot of stuff and have had good results (I'm typing on a $100 keyboard because of a niche mechanical keyboard sub, it can be dangerous!). I don't know much about that sub but it has just over 50k subscribers and seems to be fairly active so you may have good luck there.

Offline 4Doose

  • Prepper
  • **
  • Posts: 76
  • Karma: 7
  • At the trailhead to freedom, finally.
Re: Seeking Python 3 mentor/tutor for project
« Reply #2 on: March 31, 2016, 10:55:21 PM »
@theBINKYhunter

Thank you for the info. I am buying a Arduino UNO also but as I understand it that uses C for its language. Bummer you cant use 1 language for both boards. Oh well. I may be switching over to C if the Arduino turns out to be better suited for my project. If that happens just change the title to C mentor ha!.

I cant wait to learn this because I am itching to post a working project here for others to try out and build upon. A project coop would be awesome here.

Thanks again,
David

Offline kckndrgn

  • Survivalist Mentor
  • *****
  • Posts: 615
  • Karma: 23
    • Ryans Turnings
Re: Seeking Python 3 mentor/tutor for project
« Reply #3 on: April 01, 2016, 10:58:20 AM »
4Doose,
What is the other board you are buying?

Whether the arduino or the other board (whatever it is) is better for your project depends on lots of variables.

I've played around with Arduino and Rasberry Pi a little bit.  I haven't done anything fancy with them, other than impress my kids :)

If your other board is a Pi, you can using C there as well, along with incorporating a Pi/Arduino combination.

Offline surfivor

  • Survival Veteran
  • ********
  • Posts: 7034
  • Karma: 100
Re: Seeking Python 3 mentor/tutor for project
« Reply #4 on: April 01, 2016, 11:30:06 AM »
 I know Ruby better than Python but have played with Python a good deal which is very similar to Ruby .. I have lots of coding experience .. I have also done years of C and C++ coding, though it has been quite awhile.

 Post any questions you have on here whether they are specific or general and I will see what I can do to help you. Are you familiar with Object Oriented programming ? C is less object oriented, C++ and Python have Object Oriented features

 I am a professional developer with 25+ years experience in Unix, Linux, Web Development, Windows, JavaScript, Ruby, Java, C++, HTML, CSS .. Software development is the only real career I have ever had. I also have a BS degree in computer Science from 1990 ..

 For me to go from software to something like small scale farming would be quite a change .. though I have always been an outdoorsman, nature lover and bit of a woodsman ..

 I always liked the book Camping and Woodcraft by Horace Kephardt
« Last Edit: April 01, 2016, 12:02:07 PM by surfivor »

Offline theBINKYhunter

  • Does not fall well with plastic guns...
  • Moderator On Leave
  • Survival Veteran
  • *
  • Posts: 5847
  • Karma: 181
  • Not a tactical baddass
Re: Seeking Python 3 mentor/tutor for project
« Reply #5 on: April 01, 2016, 11:32:16 AM »
Oh yeah, also forgot to mention stackoverflow.com. Lots of good resources over there for just about any language you can use.

Offline 4Doose

  • Prepper
  • **
  • Posts: 76
  • Karma: 7
  • At the trailhead to freedom, finally.
Re: Seeking Python 3 mentor/tutor for project
« Reply #6 on: April 01, 2016, 12:59:20 PM »
@kckndrgn
I already purchased a RPi3 modelB, power supply and case (to keep the cats off the board). If and when I get another board I think it will be the Arduino UNO.
researching further I did also notice I can use C on both but from what I can tell going from zero to C or C++ is not the way to go.
I am going to learn Python first as by most accounts its one of the best paths to take for a total non programmer to learn.
There has to be a way to either convert or run Python on Ard and RPi both. Someone has to have done it.

@surfivor
Hey thanks for the offer! Thats very generous of you.

Currently I am going through 3 different tutorials at once. Having the different approaches at the same time is actually making it a lot easier for me to grasp the lessons.

www.codecademy.com
www.askpython.com
www.learnpythonthehardway.org (which I actually like best so far)

The Project

The project is actually a Coolbot and ColdSnap clone.

$300 for a $40 diy project is a bit much. Plus I want features that neither have.
The Coldbot doesn't give as much info as I would like. I would also like to be able to monitor, control or get alerts via text or online if needed.
The ColdSnap is all open source but its ultra bare bones. Any changes you want require a code rewrite, compile and upload via a laptop or PC. Way too cumbersome for me. Plus it has no display.

So what I want is this:

Easy button press settings. (doable)
LED display of the settings. (doable)
Wireless notification of status and or alerts. (difficult but doable)
Wireless control of device. (Maybe. This sounds rather complicated at the moment)
All in for under $100 (doable)

Once its done, its done. I will make it open source and offer a complete detailed how-to. If people can improve on it so much the better.

Cheers !

Offline surfivor

  • Survival Veteran
  • ********
  • Posts: 7034
  • Karma: 100
Re: Seeking Python 3 mentor/tutor for project
« Reply #7 on: April 01, 2016, 01:05:48 PM »

This is something that runs on a hardware device ? I didn't quite figure out exactly all of what it is.
I can take a look more later ..

This is a good forum for python questions and information:
http://www.python-forum.org/

Offline 4Doose

  • Prepper
  • **
  • Posts: 76
  • Karma: 7
  • At the trailhead to freedom, finally.
Re: Seeking Python 3 mentor/tutor for project
« Reply #8 on: April 01, 2016, 01:26:49 PM »

@surfivor

You have a little credit card sized developer board. My project will use the board plus 2 temperature sensors and 1 heat producing resistor.

1) The resistor heats the AC units built in temperature sensor and tricks the unit into thinking its too hot and to keep running. Most AC units bottom out at 60 degrees. The resistor is wrapped up with the AC units temp sensor so it can warm it as needed to trick the unit into cooling down to 32 degrees if needed.

2) Temp sensor A reads ambient air temp. If its not cold enough the board heats the resistor. When it is cold enough the board stops heating the resistor.

3) Temp sensor B is wedged between the cooling fins of a window AC unit. If the fins are above 32 degrees the board heats the resistor (as long as Temp A says its too warm). If the fins reach 32 degrees (ice up) the board stops heating the resistor regardless of what Temp A says.

4) Bells and whistles at some point.

Its a stupid simple idea but requires some know how to pull off. Know how I dont currently have but am working on.

Arduino UNO
https://www.arduino.cc/en/Main/ArduinoBoardUno

Raspberry Pi 3 Model B
https://www.raspberrypi.org/products/raspberry-pi-3-model-b/

CoolBot
http://storeitcold.com/

ColdSnap Project
Seems to be gone. It was there last week. Hmm...

« Last Edit: April 01, 2016, 01:42:09 PM by 4Doose »

Offline surfivor

  • Survival Veteran
  • ********
  • Posts: 7034
  • Karma: 100
Re: Seeking Python 3 mentor/tutor for project
« Reply #9 on: April 01, 2016, 03:46:35 PM »
 You don't have a device yet ?

Offline 4Doose

  • Prepper
  • **
  • Posts: 76
  • Karma: 7
  • At the trailhead to freedom, finally.
Re: Seeking Python 3 mentor/tutor for project
« Reply #10 on: April 01, 2016, 03:49:40 PM »
@surfivor

Yes, I have the Raspberry Pi 3 Model B.

Once I can scribble simple code with a stick in the dirt I will also buy the Arduino. Until then, though, I see no point in buying another temporary paper weight.

Offline I.L.W.

  • Dedicated Contributor
  • ******
  • Posts: 1004
  • Karma: 203
Re: Seeking Python 3 mentor/tutor for project
« Reply #11 on: April 01, 2016, 04:41:47 PM »
Nice project. I like the CoolBot, but they are overpriced.

Never worked much with Python, was always a C++/# guy, but I can muddle through it (once you know any language, the rest flow pretty easily, it's 99% syntax differences). I can help troubleshoot the code logic if the need arises.

For the base logic, just have a look at their patent application.
https://www.google.com/patents/US20100269519

You could go with old tech to do this on the cheap (no programming needed). Get a livestock water thermostat fo $8. They turn on when the temperature approaches freezing. Run that through a relay that's open when powered, and the relay powers the AC. Then just bypass the controls on the AC so it's always on. Temp drops to 32-36°F, the thermostat clicks on, powers the relay which shuts off the AC. When the temp rises, the thermostat is unpowered, closing the relay and turning the AC back on. This way you're into it for maybe $20.

As for the notifications, something like the NetAtmo Weather station would work. It's a bit pricey, but there are knock-offs from China hitting the market now at a fraction of the price. It will give you the temperature, humidity, and often overlooked CO2 levels (if this if for a root cellar, cheese cave, meat locker etc, you really want to know that). Broadcasts to a smartphone or tablet. The NetAtmo also integrates with IFTTT, so you can do a lot more with it. Dump values to a spreadsheet to evaluate performance over time for example.

The only thing this method would not get you is remote control (though it's doable, but the Raspberry Pi method is much better if that's the goal).
This may also interest you: http://www.monnit.com/Product/MNS-9-W2-TS-ST

Offline 4Doose

  • Prepper
  • **
  • Posts: 76
  • Karma: 7
  • At the trailhead to freedom, finally.
Re: Seeking Python 3 mentor/tutor for project
« Reply #12 on: April 01, 2016, 04:50:31 PM »
I keep running into Python 2 vs 3.

I am jumping to Python 2 for the following reasons.

~While I still have no clue what I need a library for it seems that there are a TON of libraries for P2.
~I have NO intention of becoming a professional coder. Tried and true is good enough.
~If I end up needing the features of P3 I can learn what I need to then.
~P2 documentation and tutorials are near endless.
~Im not interested in the debate, I just want to automate my air conditioner!

That being said...

It does sound like P3 is far more than a fresh paint job. Its a total rewrite from what I can tell. It is cleaned up and streamlined a bit. It has new features and libraries that are very appealing. What seems to be a huge bone of contention is that P2 is dead and wont be added to ever again and P3 is the FUTURE of the language! (insert horn blowing, confetti and merriment)

I dont care. I just want to tinker with my air conditioner!

The only reason I mentioned it is because I know at some point someone will bring it up. Do it someplace else.

For the purposes of THIS project consider Python 2.7 spoken here, please.

Thank you :)

Offline fritz_monroe

  • The Defenestrator
  • Administrator
  • Survival Veteran
  • *******
  • Posts: 8321
  • Karma: 148
    • The Homestead Fritz
Re: Seeking Python 3 mentor/tutor for project
« Reply #13 on: April 01, 2016, 08:14:12 PM »
I've been trying to teach myself Python.  I bought a couple e-books on learning python.  I read through them while waiting for my daughter to come out of dance.  After reading through them, I went on to some practice exercise sites.  I ended up on this site.  http://www.ling.gu.se/~lager/python_exercises.html.

Since my daughter's dance studio doesn't have wifi available, I copied the various exercises into Notepad++ and worked through them.  It helps to be able to work through the exercises without being able to look up how complete the exercise.

Doesn't help with the mentor part, but that's how I started learning Python

Offline 4Doose

  • Prepper
  • **
  • Posts: 76
  • Karma: 7
  • At the trailhead to freedom, finally.
Re: Seeking Python 3 mentor/tutor for project
« Reply #14 on: April 01, 2016, 08:29:40 PM »
@fritz_monroe

Kinda sorta. I normally go through the same lessons on a several sites back to back to get different views on the same material. After I get through the exercises I always look at the hints, solutions or explanations. This lets me double check what I did and its like having several people explain the same thing to you. Chances are one of them will offer up a perspective that clicks with you.

For example one site had a totally confusing explanation of how math is solved while a different site made it crystal clear for me.

There is so much to learn...
  :banghead:

Offline jerseyboy

  • Survivalist Mentor
  • *****
  • Posts: 539
  • Karma: 28
  • Garden State Prepper
Re: Seeking Python 3 mentor/tutor for project
« Reply #15 on: April 01, 2016, 09:09:35 PM »
@fritz_monroe

Kinda sorta. I normally go through the same lessons on a several sites back to back to get different views on the same material. After I get through the exercises I always look at the hints, solutions or explanations. This lets me double check what I did and its like having several people explain the same thing to you. Chances are one of them will offer up a perspective that clicks with you.

For example one site had a totally confusing explanation of how math is solved while a different site made it crystal clear for me.

There is so much to learn...
  :banghead:

Just do it like you eat an elephant. One bite at a time.

First, you want python 2.7. There is so much written about 2.7 it is a sin to use 3.x.

Next you need the GPIO library
http://makezine.com/projects/tutorial-raspberry-pi-gpio-pins-and-python/

Next you are going to need a relay for that resistor. I am skeptical that the GPIO pins can push enough current to heat that resistor to 60 degrees in a 40 degree environment.
http://www.amazon.com/Household-Appliance-Compatible-Atomic-Market/dp/B00TMJ0KOG/ref=sr_1_8?ie=UTF8&qid=1459566103&sr=8-8&keywords=Raspberry+pi+relay

According to this page, the current limit is around 16 mA at 3.3 volts which is around 0.05 Watts.
http://raspberrypi.stackexchange.com/questions/9298/what-is-the-maximum-current-the-gpio-pins-can-output

What you may want to use as your base jumping off point is the raspberry weather project which includes code for the temperature sensor.
http://www.raspberryweather.com/python-script/

Here is the temperature sensor
http://www.amazon.com/DHT11-Digital-Temperature-Humidity-3V-5-5V/dp/B00QEVM7G4/ref=sr_1_9?ie=UTF8&qid=1459566388&sr=8-9&keywords=dht+temp+sensor

See how far you get with this and let us know.

Jerseyboy



Offline 4Doose

  • Prepper
  • **
  • Posts: 76
  • Karma: 7
  • At the trailhead to freedom, finally.
Re: Seeking Python 3 mentor/tutor for project
« Reply #16 on: April 01, 2016, 09:17:14 PM »
@jerseyboy

 :clap: :excited: :happydance:

Offline theBINKYhunter

  • Does not fall well with plastic guns...
  • Moderator On Leave
  • Survival Veteran
  • *
  • Posts: 5847
  • Karma: 181
  • Not a tactical baddass
Re: Seeking Python 3 mentor/tutor for project
« Reply #17 on: April 01, 2016, 09:32:40 PM »
~I have NO intention of becoming a professional coder. Tried and true is good enough.

Just like a library has a bunch of different books programming language libraries have routines 'pre loaded' that you can use. Different libraries offer different functions in some situations. I'm still a programmer noob but that's the general idea.

Offline surfivor

  • Survival Veteran
  • ********
  • Posts: 7034
  • Karma: 100
Re: Seeking Python 3 mentor/tutor for project
« Reply #18 on: April 02, 2016, 08:26:20 AM »

Python 2.7 cheat sheet:
http://www.astro.up.pt/~sousasag/Python_For_Astronomers/Python_qr.pdf

 A good place to inspire curiosity and gauge some of what you might know, reminders etc

Offline surfivor

  • Survival Veteran
  • ********
  • Posts: 7034
  • Karma: 100
Re: Seeking Python 3 mentor/tutor for project
« Reply #19 on: April 07, 2016, 06:51:08 AM »

You can learn or play with python online without installing it:

http://www.tutorialspoint.com/execute_python_online.php

An interesting project might be to be able to mass download youtube videos from a list of urls, convert them to audio etc .. That list could be from bookmarks etc .. downloading videos is time consuming and requires several clicks etc for each one

 This post seems to indicate there would be a way to do it with Ruby, I'm sure python as well you could:

http://stackoverflow.com/questions/1950963/download-youtube-with-ruby-sourcecode

https://rubygems.org/gems/youtube-downloader/versions/1.2

Offline artephius

  • Survivor
  • ***
  • Posts: 149
  • Karma: 6
  • Recovering forum lurker..
Re: Seeking Python 3 mentor/tutor for project
« Reply #20 on: April 09, 2016, 08:28:57 AM »

Next you are going to need a relay for that resistor. I am skeptical that the GPIO pins can push enough current to heat that resistor to 60 degrees in a 40 degree environment.
http://www.amazon.com/Household-Appliance-Compatible-Atomic-Market/dp/B00TMJ0KOG/ref=sr_1_8?ie=UTF8&qid=1459566103&sr=8-8&keywords=Raspberry+pi+relay

And while you're at it, grab a diode and a transistor... driving inductive loads like relays directly off the gpio pins is really not a good idea... I'm no electronics expert but my understanding is inductive loads like electromagnets (in relays) blast some current/noise back at whatever is controlling them sometimes and can cause damage, using a circuit such as this: http://www.electroschematics.com/8975/arduino-control-relay/ is the way to go!