Go to advanced search

by drifterf
Thu Feb 14, 2019 8:29 am
Forum: Python
Topic: Read from CSV to part of my code (attached)
Replies: 32
Views: 2057

Re: Read from CSV to part of my code (attached)

i will try this out later today, thank you :)
by drifterf
Wed Feb 13, 2019 6:07 am
Forum: Python
Topic: Read from CSV to part of my code (attached)
Replies: 32
Views: 2057

Re: Read from CSV to part of my code (attached)

brilliant thanks once again !! defiantly learnt alot on this :) appreciate it to everyone who helped, thank you
by drifterf
Tue Feb 12, 2019 8:02 pm
Forum: Python
Topic: Read from CSV to part of my code (attached)
Replies: 32
Views: 2057

Re: Read from CSV to part of my code (attached)

if i wanted to add another data line on the following how would i do it ? file.write("Access Granted 1\n") print (" Number: ",data[count][0]) print (" Name: ",data[count][1]) print (" Tel No: ",data[count][2]) just add print ("another", data[count][3]) and add another , to the source ? like this pri...
by drifterf
Tue Feb 12, 2019 7:32 pm
Forum: Python
Topic: Read from CSV to part of my code (attached)
Replies: 32
Views: 2057

Re: Read from CSV to part of my code (attached)

gordon77 wrote:
Tue Feb 12, 2019 7:19 pm
Remove the line GPIO.setmode (GPIO.BCM) near the beginning.
thank you so much, i have been constantly looking at this and you guys helping has got me fault finding myself now as i do understand alot better. really appreciate it !!
by drifterf
Tue Feb 12, 2019 7:10 pm
Forum: Python
Topic: Read from CSV to part of my code (attached)
Replies: 32
Views: 2057

Re: Read from CSV to part of my code (attached)

hi thanks i have a working model but like the idea above with the names etc but i get the following issue: Traceback (most recent call last): File "another.py", line 27, in <module> MIFAREReader = MFRC522.MFRC522() File "/home/pi/Access/MFRC522.py", line 132, in __init__ GPIO.setmode(GPIO.BOARD) Val...
by drifterf
Sun Feb 10, 2019 6:42 pm
Forum: Python
Topic: Read from CSV to part of my code (attached)
Replies: 32
Views: 2057

Re: Read from CSV to part of my code (attached)

honesty guys no worry, i will check what i have done and see the differences. really appreciate you guys helping !! will post once i have done a bit more :) thank you
by drifterf
Sun Feb 10, 2019 9:13 am
Forum: Python
Topic: Read from CSV to part of my code (attached)
Replies: 32
Views: 2057

Re: Read from CSV to part of my code (attached)

im obviously being stupid again, any ideas #---------# EVENT LOG \_________/ Card detected Card read UID: 77,106,39,242,242 Size: 8 Traceback (most recent call last): File "j.py", line 69, in <module> my_uid = json.load(file) File "/usr/lib/python2.7/json/__init__.py", line 291, in load **kw) File "...
by drifterf
Sun Feb 10, 2019 8:24 am
Forum: Python
Topic: Read from CSV to part of my code (attached)
Replies: 32
Views: 2057

Re: Read from CSV to part of my code (attached)

hi, once again thank you very much for your help with this. i will have a go later and see how i get on :)

many thanks
by drifterf
Sat Feb 09, 2019 7:17 am
Forum: Python
Topic: Read from CSV to part of my code (attached)
Replies: 32
Views: 2057

Re: Read from CSV to part of my code (attached)

hi i am not stuck with that format, i can use any really as its a new project. please advise what you think would be best, really appreciate your help !!
by drifterf
Fri Feb 08, 2019 9:07 pm
Forum: Python
Topic: Read from CSV to part of my code (attached)
Replies: 32
Views: 2057

Re: Read from CSV to part of my code (attached)

when i do my csv as needed the text output is the following

"77,106,39,242,242",Access Number 1,Second Name Access Number 1,Number 1 Phone Number
"237,30,40,160,123",Access Number 2,Second Name Access Number 2,Number 2 Phone Number
by drifterf
Fri Feb 08, 2019 7:46 pm
Forum: Python
Topic: Read from CSV to part of my code (attached)
Replies: 32
Views: 2057

Re: Read from CSV to part of my code (attached)

hi, ideally all uid in column A would be accepted. then i could use the other columns to add names etc (just admin data for me to keep a track on who has that card) so would like all the data in column A to be accepted and granted as a UID and A/B/C etc to be ignored as it would just be for admin i ...
by drifterf
Fri Feb 08, 2019 6:09 pm
Forum: Python
Topic: Read from CSV to part of my code (attached)
Replies: 32
Views: 2057

Re: Read from CSV to part of my code (attached)

thank you so much this has proved to work :) how can i get it to read the next line etc so i can put in multiple numbers Try this, as it's reading strings back not integers csv = [] with open("csv.txt", "r") as file: line = file.readline().strip() csv = line.split(',',5) my_uid= list(map(int, csv))
by drifterf
Fri Feb 08, 2019 5:47 pm
Forum: Python
Topic: Read from CSV to part of my code (attached)
Replies: 32
Views: 2057

Re: Read from CSV to part of my code (attached)

Thanks im obviously being stupid, am i getting any closer ? with open("csv.txt", "r") as file: line = file.readline().strip() csv = line.split(',',5) my_uid = (csv) To quote my fellow volunteer @paddyg: you (obviously) need to set your variable not just paste the example gordon77 gave!
by drifterf
Fri Feb 08, 2019 5:32 pm
Forum: Python
Topic: Read from CSV to part of my code (attached)
Replies: 32
Views: 2057

Re: Read from CSV to part of my code (attached)

ok you guys have been awesome help for something so simple !! i have the script reading my file and printing it but i need the file to be read in place of where i type the card numbers current in (my_uid =) my_uid = [61,84,4,114,31] my_uid = [205,27,13,164,127] csv = [] with open("csv.txt", "r") as ...
by drifterf
Fri Feb 08, 2019 5:01 pm
Forum: Python
Topic: Read from CSV to part of my code (attached)
Replies: 32
Views: 2057

Re: Read from CSV to part of my code (attached)

have i done something wrong ? #!/usr/bin/env python # -*- coding: utf8 -*- import RPi.GPIO as GPIO import MFRC522 import signal import datetime import time continue_reading = True GPIO.setwarnings(False) # Capture SIGINT for cleanup when the script is aborted def end_read(signal,frame): global conti...
by drifterf
Fri Feb 08, 2019 5:00 pm
Forum: Python
Topic: Read from CSV to part of my code (attached)
Replies: 32
Views: 2057

Re: Read from CSV to part of my code (attached)

Thanks i tried this and get the following File "readfromtxt.py", line 69 csv = [] ^ IndentationError: unindent does not match any outer indentation level write a file called csv.txt containing your values eg 77,106,39,242,242 csvline = "34,56,78,90,120" with open("csv.txt", "w") as file: file.write(...
by drifterf
Fri Feb 08, 2019 4:26 pm
Forum: Python
Topic: Read from CSV to part of my code (attached)
Replies: 32
Views: 2057

Read from CSV to part of my code (attached)

Hi guys, have been reading up on importing a csv file for a project i am working on. It is a access control system so when the correct data has been read it allows access otherwise it denies access. i have attached the code below: the part i want to replace with a csv file is #ENTER Your Card UID he...
by drifterf
Thu Jan 24, 2019 4:16 pm
Forum: Python
Topic: Output Print To a file - webpage info
Replies: 9
Views: 1037

Re: Output Print To a file - webpage info

many thanks guys !
by drifterf
Tue Jan 22, 2019 6:17 pm
Forum: Graphics, sound and multimedia
Topic: Audio Input Adaptor ?
Replies: 2
Views: 384

Audio Input Adaptor ?

Hi, i would like suggestions of what i can use to capture a audio input ( analogue microphone ) the idea is the following: this will be used as a PA system. 1 x PI at the main desk with a microphone for announcements . connected to the existing network (was going to use VLC or something for audio st...
by drifterf
Wed Jan 16, 2019 5:15 pm
Forum: Python
Topic: Output Print To a file - webpage info
Replies: 9
Views: 1037

Re: Output Print To a file - webpage info

many thanks will look into both !! appreciated
by drifterf
Tue Jan 15, 2019 4:35 pm
Forum: Python
Topic: Output Print To a file - webpage info
Replies: 9
Views: 1037

Re: Output Print To a file - webpage info

anyone help please im stuck with this ?
by drifterf
Thu Jan 10, 2019 6:54 pm
Forum: Beginners
Topic: Copy files to /var/www
Replies: 17
Views: 10444

Re: Copy files to /var/www

yvonnezoe wrote:
Sun Mar 16, 2014 3:49 pm
sudo chown -R pi /var/www
solved my problem, thanks !!
by drifterf
Thu Jan 10, 2019 6:40 pm
Forum: Python
Topic: Output Print To a file - webpage info
Replies: 9
Views: 1037

Re: Output Print To a file - webpage info

thank you for that, will look into it :) im close to what but isit possible for the output to keep adding to the file (at the moment i press the button, my script runs as needed and prints the output etc, after its complete and i press the button again the txt file only shows the last time it was la...
by drifterf
Thu Jan 10, 2019 6:15 pm
Forum: Python
Topic: Output Print To a file - webpage info
Replies: 9
Views: 1037

Re: Output Print To a file - webpage info

ok i just wrote this which seems to work ok, am i going about this the right way ? many thanks while True: button.wait_for_press() now = datetime.datetime.now() led.on() print "Exit button Pressed, Relay 1, Door Released" print (now.strftime("%Y-%m-%d %H:%M:%S")) file = open("stream.txt", "w") file....
by drifterf
Thu Jan 10, 2019 5:46 pm
Forum: Python
Topic: Output Print To a file - webpage info
Replies: 9
Views: 1037

Output Print To a file - webpage info

Hi guys, sorry this may seem a simple question for some but im struggling. i have been reading through stuff and trying for a few days to output the "print" data from my script to a webpage. all i am after is to find out if its possible to add another command under my print command which will output...

Go to advanced search