Go to advanced search

by drifterf
Tue Feb 12, 2019 7:10 pm
Forum: Python
Topic: Read from CSV to part of my code (attached)
Replies: 32
Views: 1711

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: 1711

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: 1711

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: 1711

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: 1711

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: 1711

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: 1711

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: 1711

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: 1711

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: 1711

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: 1711

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: 1711

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: 1711

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: 817

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: 323

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: 817

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: 817

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: 8941

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: 817

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: 817

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: 817

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...
by drifterf
Thu Jan 03, 2019 7:54 pm
Forum: Python
Topic: RFID to read from CSV File
Replies: 1
Views: 212

RFID to read from CSV File

Hi guys, i have a script running which is fine for what i need, currently if i want to change accepted rfid tags i go into the script with nano and edit or add as needed. i would like it so the script will read the file (csv etc) and authorize as needed. this would mean i could just edit that file w...
by drifterf
Wed Jan 02, 2019 6:43 pm
Forum: Python
Topic: use a webpage to edit areas of a script
Replies: 4
Views: 360

Re: use a webpage to edit areas of a script

anyone help with this ?
by drifterf
Fri Dec 28, 2018 1:01 pm
Forum: Python
Topic: use a webpage to edit areas of a script
Replies: 4
Views: 360

Re: use a webpage to edit areas of a script

Sounds like a really bad idea. Complex too. Just have your web page save the "5" parameter some place and have the Python script read the value from there and behave accordingly. hi this sounds good, didnt think of it backwards. any idea where to look for learning how to do this ? any webpage etc w...
by drifterf
Fri Dec 28, 2018 11:38 am
Forum: Python
Topic: use a webpage to edit areas of a script
Replies: 4
Views: 360

use a webpage to edit areas of a script

Hi, what i am after is to have a local webpage which can be used to edit parts of a python script easily so its more user friendly. say for instance for making a led stay on for whatever the user wants. so they could just type in "5" and save or something and it would edit part of the script to modi...

Go to advanced search