Go to advanced search

by joelostinspace
Sun Oct 18, 2020 12:23 am
Forum: Python
Topic: Using Tkinter Spinbox and set a default value
Replies: 2
Views: 112

Re: Using Tkinter Spinbox and set a default value

The way I set the first choice was to use textvariable set() here's an example: import tkinter as tk import time class SpinBox_Strings(tk.Frame): def __init__(self, parent= None): self.parent= parent tk.Frame.__init__(self, self.parent) self.canvas= tk.Canvas(self.parent) self.canvas.config(width=50...
by joelostinspace
Sat Oct 17, 2020 11:42 am
Forum: Python
Topic: Scroll text with PIL ?
Replies: 7
Views: 225

Re: Scroll text with PIL ?

If you can get text with PIL draw you may be overwriting the text and need to slow it down. Try out something like: from time import sleep .... x=0 y=0 for number in range(0,128): draw.text((x, y), “Test” font=font, fill=255) # Draw the text sleep(0.25) draw.text((x, y), “Test” font=font, fill=0) # ...
by joelostinspace
Tue Oct 13, 2020 7:04 pm
Forum: Python
Topic: Python: secureconfig compiles ok with pyinstaller?
Replies: 1
Views: 118

Re: Python: secureconfig compiles ok with pyinstaller?

try when things go wrong: https://pyinstaller.readthedocs.io/en/s ... wrong.html
specifically Build-Time Python Errors.
How did you install secure config.?
by joelostinspace
Thu Oct 08, 2020 11:50 pm
Forum: Python
Topic: tcp clent receive in loop
Replies: 4
Views: 207

Re: tcp clent receive in loop

I thought I explained it in your other thread viewtopic.php?f=32&t=287267
by joelostinspace
Sun Oct 04, 2020 3:38 pm
Forum: Python
Topic: do loop
Replies: 5
Views: 384

Re: do loop

In your code you have two forever loops more isn't better: while True: Orario = time.strftime('%d-%m-%Y %H:%M:%S') .... while True: data = s.recv(1024) if data: print (data) The second loop takes over and the first one never gets accessed. try this out in an interactive prompt: >>> while True: print...
by joelostinspace
Sat Oct 03, 2020 1:58 am
Forum: Python
Topic: Stopwatch help
Replies: 2
Views: 189

Re: Stopwatch help

hey check out the gpiozero library it's easy to use: https://gpiozero.readthedocs.io/en/stable/ you already have the functions you just need to wire the buttons and use : from gpiozero import Button button = Button(3) button.when_pressed = start read the documents and check out the basic recipes, pa...
by joelostinspace
Tue Sep 29, 2020 4:12 am
Forum: Python
Topic: Doubts using PiCamera with Python 3 and tkinter
Replies: 2
Views: 144

Re: Doubts using PiCamera with Python 3 and tkinter

take a look at bluedot and skip the wires. https://bluedot.readthedocs.io/en/latest/
by joelostinspace
Sun Sep 27, 2020 5:37 pm
Forum: Python
Topic: AWB_gains always after 12 shots
Replies: 4
Views: 186

Re: AWB_gains always after 12 shots

def update_RG(value): AWB_Var.set(choices[0]) camera.awb_mode = 'off' RG = float(value) BG = scaleBG.get() camera.awb_gains =(RG, BG) print(camera.awb_gains) def update_BG(value): AWB_Var.set(choices[0]) camera.awb_mode = 'off' BG = float(value) RG = scaleRG.get() camera.awb_gains =(RG, BG) print(c...
by joelostinspace
Fri Sep 25, 2020 3:26 pm
Forum: Python
Topic: AWB_gains always after 12 shots
Replies: 4
Views: 186

Re: AWB_gains always after 12 shots

how long is your start_preview?
by joelostinspace
Tue Sep 22, 2020 3:38 pm
Forum: Python
Topic: Calling a program from within your program
Replies: 3
Views: 237

Re: Calling a program from within your program

the best way is set up your program to restart by calling a function, but the way it's created should be by a function. You can use a button with command= your_function, To take you programming to the next level create your tkinter project as a class. Use the the power of oop and self. Then it's a s...
by joelostinspace
Tue Sep 08, 2020 8:00 pm
Forum: Python
Topic: [SOLVED] Night / Low Light image with Picamera
Replies: 6
Views: 289

Re: Night / Low Light image with Picamera

from the camera docs- basic recipes: from picamera import PiCamera from time import sleep from fractions import Fraction # Force sensor mode 3 (the long exposure mode), set # the framerate to 1/6fps, the shutter speed to 6s, # and ISO to 800 (for maximum gain) camera = PiCamera( resolution=(1280, 72...
by joelostinspace
Sat Sep 05, 2020 12:55 am
Forum: Python
Topic: LED Bar Graph (tkinter Display on Screen)
Replies: 12
Views: 526

Re: LED Bar Graph (tkinter Display on Screen)

def displayLEDbargraph(): for x in range (0,1): GPIO.output (LEDred1,1) HourlyChartCanvas.itemconfig('LEDsegment1', fill = 'red') print('red1') sleep(0.1) MeterCanvas.update() GPIO.output (LEDred2,1) ......... what is HourlyChartCanvas? answer- and canvas line object. if you use sleep you are halti...
by joelostinspace
Sat Aug 29, 2020 2:58 pm
Forum: Python
Topic: Why my Adafruit_DHT module not imported?
Replies: 11
Views: 10810

Re: Why my Adafruit_DHT module not imported?

this module has been depreciated check out this thread viewtopic.php?f=32&t=283491 for a link to a module that works from adafruit or do a search for dhtxx python
by joelostinspace
Fri Aug 28, 2020 2:13 pm
Forum: Python
Topic: pyuserinput not working after op sys upgrade
Replies: 5
Views: 223

Re: pyuserinput not working after op sys upgrade

it looks like pyrogram has changed it's file structure now the inline_keyboard is in filters from pyrogram.filters import inline_keyboard https://docs.pyrogram.org/api/filters?highlight=keyboard#pyrogram.filters.inline_keyboard I am assuming that pyuserinput makes the import internally so bring it t...
by joelostinspace
Fri Aug 28, 2020 1:16 am
Forum: Python
Topic: pyuserinput not working after op sys upgrade
Replies: 5
Views: 223

Re: pyuserinput not working after op sys upgrade

maybe install the missing module https://docs.pyrogram.org/intro/install

Code: Select all

$ pip3 install -U pyrogram
by joelostinspace
Thu Aug 27, 2020 5:04 pm
Forum: Python
Topic: GUI user input Picamera effects
Replies: 1
Views: 129

Re: GUI user input Picamera effects

try something like:

Code: Select all

def check():
    if negativeEFF.value == 1:
        camera.image_effect= 'negative'
    if sketchEFF.value == 1:
        camera.image_effect= 'sketch'
by joelostinspace
Wed Aug 26, 2020 1:31 pm
Forum: Python
Topic: Trying to find out which python modules I have installed
Replies: 5
Views: 1263

Re: Trying to find out which python modules I have installed

type in your interactive prompt: help() Welcome to Python 3.7's help utility! at the end it will say help> . type in modules without quotes Please wait a moment while I gather a list of all available modules... in python 3 it gave differing results depending on the script I just ran in python 2.7 it...
by joelostinspace
Sun Aug 23, 2020 8:22 pm
Forum: Python
Topic: ImportError: cannot import name 'Raspberry_Pi_2_Driver' from 'Adafruit_DHT'
Replies: 2
Views: 1127

Re: ImportError: cannot import name 'Raspberry_Pi_2_Driver' from 'Adafruit_DHT'

from your link- DEPRECATED LIBRARY Adafruit Python DHT Sensor Library then it says: We are now only supporting the use of our CircuitPython libraries for use with Python. try out this link https://github.com/adafruit/Adafruit_CircuitPython_DHT there's a lot of other options just search for DHTXX pyt...
by joelostinspace
Thu Aug 20, 2020 3:48 am
Forum: Python
Topic: Help installing/using pyqt5, python, qt designer on my raspberry pi 3b+
Replies: 2
Views: 231

Re: Help installing/using pyqt5, python, qt designer on my raspberry pi 3b+

to convert I use: pyuic5 -x file.ui -o file.py and it outputs a python script- Then you need to create another script, import the one created and add functionality. To get better help post what you have tried the errors or output It's been a while since my last time I used the Qtdesigner so I made a...
by joelostinspace
Thu Aug 13, 2020 9:37 pm
Forum: Python
Topic: Problem with tkinter & screen locking
Replies: 5
Views: 184

Re: Problem with tkinter & screen locking

The only thing I can see is in your function show_time you create a label and place it- 60 time a minute for ten minutes that's 600 times- I used # to remove modules and code related I don't have installed and moved font_colour="White" lbl = ttk.Label(root, textvariable=txt, font=fnt, foreground=fon...
by joelostinspace
Thu Aug 13, 2020 12:38 am
Forum: Python
Topic: Problem with tkinter & screen locking
Replies: 5
Views: 184

Re: Problem with tkinter & screen locking

andy, root = Tk() root.attributes("-fullscreen", True) root.configure(background='black') root.bind("<Escape>", quit) root.bind("x", quit) root.after(1000, show_time) in your short snip it, the code is incomplete- I can't recreate your exact problem. But I can see some mistakes. instead of using TK(...
by joelostinspace
Sun Aug 09, 2020 5:39 pm
Forum: Python
Topic: pythonscript for translation into Tkinter
Replies: 1
Views: 155

Re: pythonscript for translation into Tkinter

hey your script has bugs, it doesn't detect or find the last word in a sentence or first word in quote or capitalized words, here's a sentence from my text file. “Never tell the truth to people who are not worthy of it.”Mark Twain doesn't detect Never, it or Mark to clean it up try: maybe add a rstr...
by joelostinspace
Sun Aug 09, 2020 5:13 pm
Forum: Python
Topic: 1 pic per day, upload to Dropbox folder
Replies: 2
Views: 146

Re: 1 pic per day, upload to Dropbox folder

have you read the documentation for pi camera? https://picamera.readthedocs.io/en/release-1.13/
in the basic recipes there's an example of a time-lapsed photo, you can change the sleep to a day.
by joelostinspace
Wed Aug 05, 2020 10:34 pm
Forum: Python
Topic: Help with led.
Replies: 48
Views: 1654

Re: Help with led.

you could just use gpiozero https://gpiozero.readthedocs.io/en/stable/
there's a builtin class that handles LED's and have a function that blinks-> time on,time off and number of times, background https://gpiozero.readthedocs.io/en/stab ... utput.html
by joelostinspace
Mon Aug 03, 2020 2:55 am
Forum: Python
Topic: VLC play and exit
Replies: 2
Views: 337

Re: VLC play and exit

vlc python wrapper here https://wiki.videolan.org/python_bindings
all python classes and functions here http://www.olivieraubert.net/vlc/python-ctypes/doc/
basic usage:

Code: Select all

>>> import vlc
>>> player= vlc.MediaPlayer('/home/pi/Videos/my_video_path.mp4')
>>> player.play()
0
>>> player.stop()
>>> 

Go to advanced search