Go to advanced search

by robbes
Wed Jun 26, 2013 11:41 pm
Forum: Automation, sensing and robotics
Topic: Water Tank Level Monitor
Replies: 17
Views: 48062

Re: Water Tank Level Monitor

Nicely done.
I have a question for you: I want to measure the depth of water in my well pipe, which is 6" diam. Do you think the sensor you used, with beer can modification, could provide a reasonably accurate measurement inside the pipe?
by robbes
Wed Jun 26, 2013 7:19 am
Forum: Python
Topic: urllib2
Replies: 26
Views: 7952

Re: urllib2

You will only learn python by researching and writing code yourself. I'll get you started on a display and leave it to you to finish off. There is often more than one way to solve a problem in python, and there may be better ways than the one I will show you. So you have a long STRING of data in wea...
by robbes
Tue Jun 25, 2013 10:45 pm
Forum: Python
Topic: urllib2
Replies: 26
Views: 7952

Re: urllib2

You should really spend a bit of time choosing what bits of the file are worth displaying, rather than just dumping the whole thing on the screen. It is not in a user-friendly format. It looks like the temperatures are given in degrees Kelvin, which you could change to fahrenheit, etc. Anyway, if yo...
by robbes
Tue Jun 25, 2013 9:18 pm
Forum: Python
Topic: urllib2
Replies: 26
Views: 7952

Re: urllib2

I just meant you can put in any path and filename you want and .urlretrieve will put the data from the website there. For instance, in this code the data will be placed in your home directory in a file named weatherfile.txt: from urllib.request import urlretrieve urlretrieve('http://openweathermap.o...
by robbes
Tue Jun 25, 2013 4:58 pm
Forum: Python
Topic: urllib2
Replies: 26
Views: 7952

Re: urllib2

If this is python3, print is a function and your code should be print(forecast). I'm interested in knowing what ['forecast'][txt_forecast] is doing following the print function. Going back a bit, you might consider using the urllib.request.urlretrieve function rather than urllib.request.urlopen This...
by robbes
Tue Jun 25, 2013 2:24 am
Forum: Python
Topic: urllib2
Replies: 26
Views: 7952

Re: urllib2

I think you just need to check the syntax of your print statement.
by robbes
Mon Jun 24, 2013 9:43 pm
Forum: Python
Topic: urllib2
Replies: 26
Views: 7952

Re: urllib2

pip is a tool to install or uninstall packages from pypi You can install pip itself with sudo apt-get install python-pip See https://pypi.python.org/pypi/pip/ for usage details. yolk is a program which allows you find which packages (and versions) you have installed. You can install yolk itself with...
by robbes
Mon Jun 24, 2013 8:49 pm
Forum: Python
Topic: urllib2
Replies: 26
Views: 7952

Re: urllib2

I think part of your problem is that you have imported some modules into Python2 and some into Python3. You would probably be better off just having one of the two installed at this point.
by robbes
Mon Jun 24, 2013 7:39 pm
Forum: Python
Topic: urllib2
Replies: 26
Views: 7952

Re: urllib2

Looking a little deeper into this, see
http://stackoverflow.com/questions/2792 ... ame-urllib
Apparently you should use
from urllib.request import urlopen
as your import statement
by robbes
Mon Jun 24, 2013 7:22 pm
Forum: Python
Topic: urllib2
Replies: 26
Views: 7952

Re: urllib2

I think it depends on how you imported the urllib module.
Try something like data = urllib.urlopen('....')
by robbes
Mon Jun 24, 2013 6:12 pm
Forum: Python
Topic: urllib2
Replies: 26
Views: 7952

Re: urllib2

urllib2 is merged into urllib in python3
by robbes
Sun Jun 23, 2013 5:21 pm
Forum: Python
Topic: MySQL and python question
Replies: 8
Views: 32534

Re: MySQL and python question

Sorry about that, hobbit. I had been ssh-ing into another machine; I get the same message as you on the pi. But the only dependency I see for mysqldb is libmysqlclient18, so I doubt that my initial concern was correct. I have no problem installing, as mcgerard did, with sudo aptitude install python-...
by robbes
Fri Jun 21, 2013 8:22 pm
Forum: Python
Topic: MySQL and python question
Replies: 8
Views: 32534

Re: MySQL and python question

Looking back through my installation of the MySQLdb module, I notice that I used the command

Code: Select all

sudo aptitude build-dep python-mysqldb
I wonder if you have some unmet dependencies.
by robbes
Sat Mar 30, 2013 4:52 pm
Forum: Python
Topic: 'function' object does not support...
Replies: 5
Views: 1462

Re: 'function' object does not support...

graph_points is the name of a list and the name of a function?
by robbes
Sun Feb 24, 2013 6:45 pm
Forum: Automation, sensing and robotics
Topic: Water Well Depth Monitor
Replies: 4
Views: 1815

Water Well Depth Monitor

I want to have an indicator of the depth of water in my domestic supply, which is a surface pump fed from a 6 inch in diameter well casing, about 40 feet deep. My first thought is to drop a line down the casing with a sequence of sensors at perhaps 2 foot intervals, with those below the water level ...
by robbes
Tue Feb 05, 2013 3:09 am
Forum: HATs and other add-ons
Topic: Assembled gertboard & header cable
Replies: 12
Views: 5878

Re: Assembled gertboard & header cable

blanchanc,
Hello from the other end of the country.
You can get a cable from newark.com for $2.98 (part 44W3466).

Go to advanced search