Go to advanced search

by depauw
Wed Jul 26, 2017 9:12 pm
Forum: Other projects
Topic: 'reading' text in pdf to store the file in the right folder
Replies: 11
Views: 1816

Re: 'reading' text in pdf to store the file in the right folder

Hey, Thanks for the input! I'll give the pdftotext a go, but I'm not familiar with the the poppler-utils package. I'll have to sort this one out first :) I've added an example pdf. Unfortunately, I can't change the software that is creating the invoice-pdf's. Otherwise I would add the clientnumber i...
by depauw
Tue Jul 25, 2017 6:47 pm
Forum: Other projects
Topic: 'reading' text in pdf to store the file in the right folder
Replies: 11
Views: 1816

'reading' text in pdf to store the file in the right folder

Hello, I have a project in mind..... My invoicing program generates pdf's with the invoicenumber as name. (2017001.pdf). I'd like to store (for archiving reasons) each pdf in a folder, where the foldername is the name of the client. Now, I have to do this manually. And I'm not a fan of repetitive ma...
by depauw
Thu Jun 22, 2017 2:49 pm
Forum: Python
Topic: placing a list of variables in one line of html - newbie!
Replies: 6
Views: 955

Re: placing a list of variables in one line of html - newbie

Yes, coding at night in this warm weather makes curly brackets, indentations, etc dance before my eyes :) Made the change and I also forgot the lin to declare the variable email_body. So fixed that to! Made a last adjustment to the line msgText = MIMEText(email_body) I changed it to this: [codemsgTe...
by depauw
Wed Jun 21, 2017 10:08 pm
Forum: Python
Topic: placing a list of variables in one line of html - newbie!
Replies: 6
Views: 955

Re: placing a list of variables in one line of html - newbie

I've been working with the suggestions given by scotty101 and incorporated it in my code. # Send an HTML email with an embedded image and a plain text message for # email clients that don't want to display the HTML. import os from email.mime.multipart import MIMEMultipart from email.mime.text import...
by depauw
Mon Jun 19, 2017 3:41 pm
Forum: General discussion
Topic: For want of a nail...
Replies: 7
Views: 1228

Re: For want of a nail...

I would try hammering it on :)

May be a rubber band can help keeping things into place?
by depauw
Mon Jun 19, 2017 3:08 pm
Forum: Python
Topic: placing a list of variables in one line of html - newbie!
Replies: 6
Views: 955

placing a list of variables in one line of html - newbie!

Hello, I'm struggling with this: I'm writing a script that looks at the image (jpg) files in a directory. Then it should add those images to an email.... so far, I have some code (see below) for 2 images, or 3 or 5 or 10 if you want, but it's manually done and I don't always know how many files ther...
by depauw
Wed Jun 14, 2017 8:40 pm
Forum: Python
Topic: email images from a directory inline
Replies: 0
Views: 393

email images from a directory inline

Hey all, I'm trying to write a script that emails the image-files from a certain directory. I'd like the images to be placed inline the email, not as an attachment. I found a peice of code which emails 1 image inline. I'd like to change the code so the images in a directory are mailed inline. But I'...
by depauw
Mon Jun 12, 2017 7:12 pm
Forum: Python
Topic: can only concatenate list (not "str") to list
Replies: 2
Views: 749

Re: can only concatenate list (not "str") to list

Yes, That's it!!!
Back on the right track again.

Many thanks!!!
by depauw
Mon Jun 12, 2017 3:07 pm
Forum: Python
Topic: can only concatenate list (not "str") to list
Replies: 2
Views: 749

can only concatenate list (not "str") to list

Hello, i'm looking for a way to read imagefiles who are not located in the current directory. path = "I:/raspberry/scripts python/email templates/images" dirs = os.listdir( path ) for image in dirs: picture = (dirs + image) fp = open(picture, 'rb') msgImage = MIMEImage(fp.read()) fp.close() This cod...
by depauw
Mon Feb 06, 2017 10:06 am
Forum: Other programming languages
Topic: network status script: synthax error
Replies: 11
Views: 2973

Re: network status script: synthax error

I used 7.8.8.8 for testing purposes so I could simulate the situation of no connection. In the final script (below) I'm using 8.8.8.8 So here is my result: - first check: is there connection with internet - second check: what kind of connection: wifi or ethernet - depending on the type of connection...
by depauw
Sun Feb 05, 2017 7:44 pm
Forum: Other programming languages
Topic: network status script: synthax error
Replies: 11
Views: 2973

Re: network status script: synthax error

@ shuckle: thanks for that! :oops:
really embarressed I didn't found this on my own.....

Back on track now!
I'll publish the finished code within the next few days, if the dayjob doesn't have to many surprises :o

Christophe
by depauw
Sun Jan 29, 2017 6:52 pm
Forum: Other programming languages
Topic: network status script: synthax error
Replies: 11
Views: 2973

Re: network status script: synthax error

ok!
Now, I want to write the result of the ping test (0 or 1) into a variable.
I've tried this: png=$(ping -c4 7.8.8.8 > /dev/null)
but when I do 'echo $png' the output is nothing, of blank.

any idea's on this?

kind regards,
Christophe
by depauw
Thu Jan 26, 2017 10:32 am
Forum: Other programming languages
Topic: network status script: synthax error
Replies: 11
Views: 2973

Re: network status script: synthax error

Did some editing to the posted code, it was a wrong version. These are the results I get: 1 1 test 1 1 connection ok test 2 1 connection ok test 3 1 connection ok last check before reboot 1 I was not expecting to get a connection ok. It should be a no connection, first on wlan with restart and then ...
by depauw
Wed Jan 25, 2017 2:47 pm
Forum: Other programming languages
Topic: network status script: synthax error
Replies: 11
Views: 2973

Re: network status script: synthax error

Hey, sorry for the delay. Dayjob got a bit in the way Thanks for the pointers and the links. I started this script out as a python script, but then made a bash script of it. This explains a bit why there's a lot of python in it. I've done some reading an googling and took another approach to my scri...
by depauw
Wed Jan 11, 2017 4:34 pm
Forum: Other programming languages
Topic: network status script: synthax error
Replies: 11
Views: 2973

network status script: synthax error

Hello there, I've written a script to check if my pi has an internetconnection by pinging Google. If not, it checks what type of connection I have (wifi and/or ethernet). It restarts them 5 times. If there is still no connection, the a reboot is executed. When I run the code, I get a synthax error: ...
by depauw
Mon Oct 31, 2016 8:10 am
Forum: General discussion
Topic: PI as wakeUP server, alternative way-without router access
Replies: 6
Views: 1366

Re: PI as wakeUP server, alternative way-without router acce

Very clever workaround!!!!
Well done!
by depauw
Mon Oct 17, 2016 9:21 am
Forum: Python
Topic: controlling 4-digit display with gpiozero
Replies: 20
Views: 3065

Re: controlling 4-digit display with gpiozero

I think I've got the hang of it, but I wouldn't have found it myself.
I took out a piece of paper, so I could write down the values of digit, loop, segments,.... so I could really understand what's going on, when the code is executed.

This certainly has been a good learning experience!!
by depauw
Thu Oct 13, 2016 7:19 am
Forum: Python
Topic: controlling 4-digit display with gpiozero
Replies: 20
Views: 3065

Re: controlling 4-digit display with gpiozero

Wow! All respect for tom.slick !!! When I first ran the code, the digits were displayed in an inverted way. What was on had to be off, and vice versa. So I've changed the on and off's in the code and..... It works!!!!! This is the working code for my 4-digit display of the 'common cathode' type. Tha...
by depauw
Tue Oct 11, 2016 4:46 pm
Forum: Python
Topic: controlling 4-digit display with gpiozero
Replies: 20
Views: 3065

Re: controlling 4-digit display with gpiozero

Hello, Iim back again. I took on the advice of tom.slick and took a long look at the code... I decided to try out one solution and stopped mixing 2 types of code. Now, I understand a bit more what is happening, but I haven't reached a working code yet.... This is what I've got so far. The segmentpat...
by depauw
Fri Sep 30, 2016 6:39 am
Forum: Python
Topic: controlling 4-digit display with gpiozero
Replies: 20
Views: 3065

Re: controlling 4-digit display with gpiozero

I'm using this type of display (I attached a datasheet)
SH5461AS.gif
by depauw
Thu Sep 29, 2016 4:32 pm
Forum: Python
Topic: controlling 4-digit display with gpiozero
Replies: 20
Views: 3065

Re: controlling 4-digit display with gpiozero

Ok! Did some code-cleaning an introduced the proposed code. We're already one step futher! The number is printed on the screen, in an array, then followed by this error: Traceback (most recent call last): File "zero4.py", line 49, in <module> for i in range(0,len(segmentPattern[number])): TypeError:...
by depauw
Thu Sep 29, 2016 3:39 pm
Forum: Python
Topic: controlling 4-digit display with gpiozero
Replies: 20
Views: 3065

Re: controlling 4-digit display with gpiozero

No problem!
It's just a bit frustrating :(
I think it all comes down to about 5 lines of code, that I can't write myself because I don't have the knowledge.
by depauw
Thu Sep 29, 2016 3:11 pm
Forum: Python
Topic: controlling 4-digit display with gpiozero
Replies: 20
Views: 3065

Re: controlling 4-digit display with gpiozero

Indeed! and I have this one working. But it is for a 1digit display. I'd like to use a 4digit display and I don't know how to do that.....
by depauw
Thu Sep 29, 2016 2:28 pm
Forum: Automation, sensing and robotics
Topic: Controlling a 7 segment 4 digit display with a Raspberry Pi
Replies: 26
Views: 30043

Re: Controlling a 7 segment 4 digit display with a Raspberry

Hey guys,
does anyone of you how to get this working, using zerogpio istead of the 'normal' gpio.
Been looking around for an example, but haven't found anything yet...... :(

Kind regards,
Christophe
by depauw
Thu Sep 29, 2016 2:27 pm
Forum: Python
Topic: controlling 4-digit display with gpiozero
Replies: 20
Views: 3065

Re: controlling 4-digit display with gpiozero

That is indeed my inspirational source of the code using gpio.
But now, i want to get it working using zerogpio!

Go to advanced search