Go to advanced search

by tom.slick
Wed May 25, 2016 9:22 am
Forum: Python
Topic: led matrix and python
Replies: 2
Views: 1162

Re: led matrix and python

Hi everyone, Question 1 : spidev does not exist on /dev. My OS is Noobs. I cant repair. Question 2 : How can i connect SPI on my raspberry to HUB12 led matrix ? I need connection schema. I cant found on internet :( Question 3 : I am only know python language. How can i use SPI on python. I can star...
by tom.slick
Tue May 24, 2016 7:04 am
Forum: Python
Topic: Variables problems
Replies: 3
Views: 741

Re: Variables problems

I would suggest you take a step back and find a Python tutorial and spend some time learning the Python fundamentals. It looks like you are trying to do something too complicated for your current level of knowledge. A bit of study up front will save you lots of time later. PeterO Well said. And wha...
by tom.slick
Tue May 24, 2016 2:58 am
Forum: Python
Topic: Variables problems
Replies: 3
Views: 741

Re: Variables problems

Read this
http://www.pitt.edu/~naraehan/python2/d ... rsion.html

Then have a look at the rest of the pages there
by tom.slick
Tue May 24, 2016 12:37 am
Forum: Python
Topic: Command line shortcut to run Python script.
Replies: 15
Views: 8176

Re: Command line shortcut to run Python script.

cscuilla wrote:I don't need to run as root. I guess it's a habit I should break..

Also, when I type..

nano ~/.bash_aliases

I get a blank page. Is this correct?
Yes, it we be blank until you put your aliases in it.
by tom.slick
Mon May 23, 2016 9:23 pm
Forum: Python
Topic: Command line shortcut to run Python script.
Replies: 15
Views: 8176

Re: Command line shortcut to run Python script.

Or you can just do it the linux way 2 choices 1) Create a bash script with 2 lines in it and place it in /usr/local/bin you could call it myscript #!/bin/bash python /home/pi/scripts/myscript.py Then make it executable chmod +x ~/bin/myscript To run it just type sudo myscript 2) Make your script exe...
by tom.slick
Mon May 23, 2016 9:00 am
Forum: Python
Topic: controling a 4 digit display
Replies: 7
Views: 1441

Re: controling a 4 digit display

I found some time to go through the links and information tom.slick provided! After testing, trying an retrying :) I've finally got this code pieced together. It shows a 4digit number on a common cathode 4 digit display. From 10.000 and heigher, the display shows 'HIGH'. Thanks for the support! #ht...
by tom.slick
Sun May 22, 2016 6:56 am
Forum: Python
Topic: Beginner Question - invalid syntax running from Idle
Replies: 6
Views: 4504

Re: Beginner Question - invalid syntax running from Idle

I removed Python2 from the Programming menu. Python 3 is now the only choice for students from the Programming menu. However, if you double-click on a Python 3 program, it brings up Python 2.7 and prints error messages or runs in a different format than it should. The basic question is: how do you ...
by tom.slick
Sat May 21, 2016 8:14 pm
Forum: Python
Topic: Change the windows title
Replies: 6
Views: 1059

Re: Change the windows title

If I did not understand it is because you did not explain yourself very well.

The styles of the title bar are controlled by the window manager not tkinter. The only thing you can change is the text of the title.
by tom.slick
Sat May 21, 2016 8:46 am
Forum: Python
Topic: Change the windows title
Replies: 6
Views: 1059

Re: Change the windows title

self.parent.title("Buttons")

Change "Buttons" to what you want the new title to be.

NOTE: The title is the title of the window not the caption of the button
closeButton = Button(self, text="Close")
text="Close"
by tom.slick
Thu May 19, 2016 11:33 pm
Forum: Python
Topic: Place holders in my code
Replies: 4
Views: 1010

Re: Place holders in my code

You could use that line of code you posted and then just have the user click on the folder they want to save in.
by tom.slick
Thu May 19, 2016 11:29 pm
Forum: Python
Topic: Cannot post http when running from crontab
Replies: 4
Views: 1361

Re: Cannot post http when running from crontab

It's not working because your network is not up and running when cron launches your scripts. Have cron launch them in the background, then put a pause in each script to wait for the network to come up.
by tom.slick
Mon May 16, 2016 8:56 am
Forum: Python
Topic: Struggling a bit with Python
Replies: 20
Views: 3341

Re: Struggling a bit with Python

Morning I did do it in the end, the first 2 functions were pretty easy, but I have to say I really did seek help with the second, because I just couldn't figure out how to slap all the steps together =/ Going to plod along though - and also getting quite through the codecademy course now as well, r...
by tom.slick
Mon May 16, 2016 8:51 am
Forum: Python
Topic: Displaying Sensor Readings in a Web Page
Replies: 12
Views: 11897

Re: Displaying Sensor Readings in a Web Page

Thank you for your response! I was thinking about this as well, but won't this cause some performance issues as Python will be writing to the database while the app is running and with AJAX will be querying all the time as well. I've shared my problem with a friend of mine and he mentioned somethin...
by tom.slick
Sun May 15, 2016 10:08 am
Forum: Python
Topic: Struggling a bit with Python
Replies: 20
Views: 3341

Re: Struggling a bit with Python

I remember the Coursera course, I took it a few years ago. I learned a lot from it. Like you said "each component works on it's own", so do one thing at a time. That is what this assignment is about. The helper functions will work independent of the main function. If the parameter is valid they will...
by tom.slick
Sun May 15, 2016 8:24 am
Forum: Automation, sensing and robotics
Topic: Control Relay Switches via Android using a Raspberry Pi
Replies: 157
Views: 80162

Re: Control Relay Switches via Android using a Raspberry Pi

jepe63 wrote:Thanx , that's working fine, alltough it's var/www/html/gpio.php but that's a detail ;)
Most of the time the error is with copy and past, this time it's because I didn't copy and past :lol:
by tom.slick
Sun May 15, 2016 4:58 am
Forum: Python
Topic: FTP upload
Replies: 1
Views: 699

Re: FTP upload

I'm trying to upload a file to mt server and i keep getting the following error: File "/usr/lib/python2.7/ftplib.py", line 224, in getresp raise error_perm, resp error_perm: 550 /home/pi/Photo_Box/Media/Captures/Pictures_Banner/05_14_2016_23_17_44.jpg: No such file or directory the snippet of code ...
by tom.slick
Sat May 14, 2016 6:54 pm
Forum: Python
Topic: i2c multiplexer help? - TCA9548A
Replies: 11
Views: 11398

Re: i2c multiplexer help? - TCA9548A

Hey Tom, this looks promising, thanks! I'm going to give it a shot and play around with it later today One quick question that maybe you can answer is pertaining to the si4703's fixed address (0x10). In your example it's being calling it at that address, which initiates it. So if i'm wanting to use...
by tom.slick
Sat May 14, 2016 6:35 am
Forum: Python
Topic: i2c multiplexer help? - TCA9548A
Replies: 11
Views: 11398

Re: i2c multiplexer help? - TCA9548A

This is only a guess, but....... You pick a channel, setup your radio, change to the next one and set that one up and so on. Then to listen to one you pick a different channel. This is only an example. #!/usr/bin/python import RPi.GPIO as GPIO import smbus import time i2c = smbus.SMBus(1) #use 0 for...
by tom.slick
Fri May 13, 2016 6:04 pm
Forum: Python
Topic: controling a 4 digit display
Replies: 7
Views: 1441

Re: controling a 4 digit display

Like I said I don't have one of these so I can't test it but in doing a little research I found this http://raspi.tv/2015/how-to-drive-a-7-segment-display-directly-on-raspberry-pi-in-python it looks almost the same except for one little thing def digdisp(display_digit): # clear and blank display for...
by tom.slick
Fri May 13, 2016 5:04 pm
Forum: Automation, sensing and robotics
Topic: Control Relay Switches via Android using a Raspberry Pi
Replies: 157
Views: 80162

Re: Control Relay Switches via Android using a Raspberry Pi

Hi Jason , where can i change the pins used ? , I've ordered a touchscreen for my Pi B and i am wondering if the pin layout is going to interfere with the relais used. Also is there a possibility for the android app to build rotate in it ? i've been using it for years now on my tablet and getting t...
by tom.slick
Fri May 13, 2016 2:10 pm
Forum: Python
Topic: controling a 4 digit display
Replies: 7
Views: 1441

Re: controling a 4 digit display

The keys need to be strings now. Something I overlooked. :oops: digits = {"0":[1,1,1,1,1,1,0], "1":[0,1,1,0,0,0,0], "2":[1,1,0,1,1,0,1], "3":[1,1,1,1,0,0,1], "4":[0,1,1,0,0,1,1], "5":[1,0,1,1,0,1,1], "6":[1,0,1,1,1,1,1], "7":[1,1,1,0,0,0,0], "8":[1,1,1,1,1,1,1], "9":[1,1,1,0,0,1,1], "H":[0,1,1,0,1,1...
by tom.slick
Fri May 13, 2016 3:20 am
Forum: Python
Topic: Count lines
Replies: 5
Views: 792

Re: Count lines

Find out what characters make a paragraph split. >>> with open('news', 'r') as infile: ... data = infile.read() ... >>> data 'Years After Git, \nBitKeeper Is \nOpen-Sourced\n\nLatest Update to ES \nFile Explorer \nAndroid App Brings \nAdware To Your \nLockscreen' >>> Do you see the character that se...

Go to advanced search