Go to advanced search

by MrYsLab
Tue Oct 17, 2017 2:17 pm
Forum: Python
Topic: Sending by mail image files from a folder
Replies: 10
Views: 1135

Re: Sending by mail image files from a folder

My pleasure.
by MrYsLab
Mon Oct 16, 2017 2:07 pm
Forum: Python
Topic: python3 tkinter make a button look the same
Replies: 13
Views: 2893

Re: python3 tkinter make a button look the same

Try changing

Code: Select all

self.slogan.config(relief=SUNKEN)
to

Code: Select all

self.slogan.config(relief=FLAT)
by MrYsLab
Sun Oct 15, 2017 7:17 pm
Forum: Python
Topic: Sending by mail image files from a folder
Replies: 10
Views: 1135

Re: Sending by mail image files from a folder

Step 1. Sort the files in your directory so that the oldest shows first import os search_dir = "PUT YOUR FULL DIRECTORY PATH HERE" os.chdir(search_dir) files = filter(os.path.isfile, os.listdir(search_dir)) files = [os.path.join(search_dir, f) for f in files] # add path to each file files.sort(key=l...
by MrYsLab
Sun Oct 15, 2017 6:57 pm
Forum: Python
Topic: python3 tkinter make a button look the same
Replies: 13
Views: 2893

Re: python3 tkinter make a button look the same

I am not sure if this is what you want, but the "Hello" button listens to presses, but never changes its look. from tkinter import * class App: def __init__(self, master): frame = Frame(master) frame.pack() self.button = Button(frame, text="QUIT", fg="red", command=quit) self.button.pack(side=LEFT) ...
by MrYsLab
Sat Oct 14, 2017 10:34 pm
Forum: Automation, sensing and robotics
Topic: Adafruit_PWM_Servo_Driver on Raspian Stretch
Replies: 3
Views: 926

Re: Adafruit_PWM_Servo_Driver on Raspian Stretch

Have you enabled i2c with raspi-config after installing stretch?
by MrYsLab
Sat Oct 14, 2017 12:32 am
Forum: Python
Topic: Tkinter adding an imag
Replies: 4
Views: 2716

Re: Tkinter adding an imag

I think this Python 3 version may help: import tkinter as Tk # image for background was sized 600x400 # image for canvas was sized 100x100 root = Tk.Tk() background_image=Tk.PhotoImage(file="/home/pi/tkstuff/mry.gif") background_label = Tk.Label(root, image=background_image) background_label.place(x...
by MrYsLab
Fri Oct 06, 2017 5:35 pm
Forum: Python
Topic: Integrated Python GUI builder and IDE
Replies: 10
Views: 28944

Re: Integrated Python GUI builder and IDE

I have used remi https://github.com/dddomodossola/remi and its WYSIWYG editor. It generates much of the code (which is very readable and easily modifiable) and support has been great. You can take a look at one of my projects using remi here: https://github.com/MrYsLab/razmq . This project also has ...
by MrYsLab
Fri Sep 22, 2017 3:01 pm
Forum: Python
Topic: tkinter canvas graph
Replies: 3
Views: 1127

Re: tkinter canvas graph

I just tried the program on https://pythonprogramming.net/how-to-embed-matplotlib-graph-tkinter-gui/ . You will first have to do a: sudo pip install matplotlib Be patient, it takes a little while to build. Also, I had to comment out line 22: # tk.Tk.iconbitmap(self, default="clienticon.ico") If you ...
by MrYsLab
Mon Sep 18, 2017 2:25 pm
Forum: Python
Topic: Time between button presses
Replies: 2
Views: 727

Re: Time between button presses

Take a look at apscheduler http://apscheduler.readthedocs.io/en/latest/userguide.html#choosing-the-right-scheduler-job-store-s-executor-s-and-trigger-s , specifically the background scheduler. You can create a background scheduler, and if one of your limit switches fires, you can then reschedule the...
by MrYsLab
Wed Sep 06, 2017 3:19 pm
Forum: Python
Topic: insert python in kivy code
Replies: 2
Views: 958

Re: insert python in kivy code

To integrate your own event loop with that of kivy, you will need to use the kivy Clock.schedule_interval method I have an example of doing just that for a Raspberry Pi based robot I built. You can see a screen shot of the GUI here: https://github.com/MrYsLab/razmq The code for the GUI is located he...
by MrYsLab
Mon Sep 04, 2017 9:59 pm
Forum: Python
Topic: Sharing data between python scripts through a LAN
Replies: 40
Views: 8453

Re: Sharing data between python scripts through a LAN

I rebuilt for pypi installation and now installs on both Jessie and Stretch without having to jump through hoops. Never had to use wheels before, but things have changed in that direction. On Jessie, for python 2, first do a sudo apt-get install python-dev Followed by: sudo pip2 install python-banya...
by MrYsLab
Sun Sep 03, 2017 2:06 am
Forum: Python
Topic: Sharing data between python scripts through a LAN
Replies: 40
Views: 8453

Re: Sharing data between python scripts through a LAN

I just did installs for both python 2 and 3 on a clean jessie image. 1. I installed jessie 2017-07-05 on an sd card. 2. I am running headless and ssh'ed into the PI. 3. I ran raspi-config and expanded memory and set the boot options for Desktop/CLI to desktop gui requiring login. 4. I rebooted the R...
by MrYsLab
Sat Sep 02, 2017 3:30 am
Forum: Python
Topic: Help with browser problem
Replies: 3
Views: 955

Re: Help with browser problem

That's curious - it works in python 2 and python 3 for me - weird. To answer your question, using the "working" method, I don't think you can, but perhaps someone else can suggest a solution.
by MrYsLab
Sat Sep 02, 2017 3:09 am
Forum: Python
Topic: Sharing data between python scripts through a LAN
Replies: 40
Views: 8453

Re: Sharing data between python scripts through a LAN

Ok, I think I have it working now. Here are the steps to get things installed and working. 1. Type: sudo apt-get install python-dev This will install python.h 2. Update numpy to latest version: sudo pip install numpy --upgrade This is very slow. It will probably take about a half hour to update 3. T...
by MrYsLab
Sat Sep 02, 2017 1:43 am
Forum: Python
Topic: Sharing data between python scripts through a LAN
Replies: 40
Views: 8453

Re: Sharing data between python scripts through a LAN

It looks like pyzmq is requiring a newer version of zeromq. I will download and build that version and get back to you on status. The build instructions I provided are for an older version zeromq.
by MrYsLab
Sat Sep 02, 2017 1:18 am
Forum: Python
Topic: Sharing data between python scripts through a LAN
Replies: 40
Views: 8453

Re: Sharing data between python scripts through a LAN

I am seeing an issue on Jessie as well. I am going to try the whole zeromq build process and let you know if that works.
by MrYsLab
Sat Sep 02, 2017 12:37 am
Forum: Python
Topic: Sharing data between python scripts through a LAN
Replies: 40
Views: 8453

Re: Sharing data between python scripts through a LAN

I will create a Jessie image and test, but in the meantime, if you to want to try building zeromq I am including a link to the instructions. Just substitute pip for pip3 in that last line of the instructions. Here is the link: https://github.com/MrYsLab/razmq/wiki/ZeroMQ-Installation-Instructions Th...
by MrYsLab
Sat Sep 02, 2017 12:24 am
Forum: Python
Topic: Sharing data between python scripts through a LAN
Replies: 40
Views: 8453

Re: Sharing data between python scripts through a LAN

I just loaded this on the stretch distribution and here is my output: [email protected]:~ $ sudo pip install python-banyan Collecting python-banyan Using cached python-banyan-2.0.tar.gz Collecting msgpack-numpy (from python-banyan) Using cached msgpack_numpy-0.4.1-py2.py3-none-any.whl Collecting ms...
by MrYsLab
Fri Sep 01, 2017 3:42 pm
Forum: Python
Topic: Help with browser problem
Replies: 3
Views: 955

Re: Help with browser problem

I am not sure what is going on with the webbrowser call, but it looks like you are stuck in some sort of multithreaded purgatory.

Try the following instead:

Code: Select all

import time
import subprocess

p = subprocess.Popen(["chromium-browser", "http://www.bom.gov.au"])
time.sleep(10)
p.kill()
by MrYsLab
Fri Sep 01, 2017 12:37 pm
Forum: Python
Topic: Sharing data between python scripts through a LAN
Replies: 40
Views: 8453

Re: Sharing data between python scripts through a LAN

Python banyan is now python2 and 3 compatible :D :D :D . It also allows for numpy matrix transfers as a single payload. And streaming messages on a single Rpi 3 is twice as fast as Mosquitto MQTT (test code is available in github).
by MrYsLab
Thu Aug 31, 2017 2:13 am
Forum: Python
Topic: Beginner Python Help - Sound from list
Replies: 6
Views: 994

Re: Beginner Python Help - Sound from list

In your call to os.system, you have the variable name play_sound inside of the quotes. It needs to be out side.

Here is a very simple example of what I mean:

Code: Select all

import os

path = "c:\\users"
os.system('dir ' + path)
by MrYsLab
Thu Aug 31, 2017 1:43 am
Forum: Python
Topic: Sharing data between python scripts through a LAN
Replies: 40
Views: 8453

Re: Sharing data between python scripts through a LAN

Take a look at python banyan https://github.com/MrYsLab/python_banyan. It is simple to use and has much better performance than MQTT.
by MrYsLab
Wed Aug 30, 2017 11:41 pm
Forum: Python
Topic: Solar System Model
Replies: 4
Views: 1206

Re: Solar System Model

Either QT or tkinter should meet your needs. I have very limited experience with QT, but have played a little with the tkinter canvas widget. There is a short tutorial here: http://www.python-course.eu/tkinter_canvas.php I have also used kivy in a limited way and it has the best overall "look" IMHO....
by MrYsLab
Sun Aug 27, 2017 4:15 pm
Forum: Python
Topic: Using command line code in a Python program, ie i2cset... or moreutils function ifne
Replies: 5
Views: 1035

Re: Using command line code in a Python program, ie i2cset... or moreutils function ifne

I am not sure if this helps or not, but perhaps subprocess.check_output might help solve your problem.

Go to advanced search