Go to advanced search

by billintad
Fri Jan 17, 2020 8:28 pm
Forum: Official Foundation Display
Topic: Screen has moved behind the touch plate
Replies: 3
Views: 802

Re: Screen has moved behind the touch plate

Thanks for the advice. The movement on my display is slanted, so might be a little more complicated. I wonder if applying warmth might speed up the process.
by billintad
Fri Jan 10, 2020 2:29 pm
Forum: Official Foundation Display
Topic: Screen has moved behind the touch plate
Replies: 3
Views: 802

Screen has moved behind the touch plate

On my official display the screen has moved to be at an angle to the touch plate (it may have been the hot weather last year). I cannot move it back again. I remember this was a problem when the official screen was first available but it did not affect my screen However it has now. Can some one poin...
by billintad
Fri Dec 20, 2019 11:46 pm
Forum: Python
Topic: Unable to install pip
Replies: 7
Views: 368

Re: Unable to install pip

Just for information, pip is already installed in python2.7 and python3.4 and later. Also, there is encouragement to run pip as a python module as this allows control over where a new package is placed : pythonX -m pip install package where X is the python version where the module will be installed,...
by billintad
Wed Dec 18, 2019 8:01 am
Forum: Python
Topic: Outputting text to centre of screen?
Replies: 4
Views: 307

Re: Outputting text to centre of screen?

Python has a string function to centre text : >>> # string.center(width,fillCharacter) >>> print('asdfghjk'.center(80,"-")) ------------------------------------asdfghjk------------------------------------ A space is the default if the fill character is not defined. Here is a useful list of String fu...
by billintad
Fri Jun 21, 2019 8:23 am
Forum: Python
Topic: How to send data from remotely hosted HTML form to Pi
Replies: 3
Views: 598

Re: How to send data from remotely hosted HTML form to Pi

If for some reason you cannot run a web server on your Pi, this is an alternative. Does your web page shows the current status of each switch ?. If it does just, the Pi can be aware of the changes it needs to make by regularly accessing that web page, examining the content and then making the requir...
by billintad
Wed Jan 17, 2018 12:48 pm
Forum: Raspberry Pi Desktop for PC and Mac
Topic: Apt-get dist-upgrade problem
Replies: 10
Views: 3125

Re: Apt-get dist-upgrade problem

Thanks for sorting this problem out. Funnily enough, the day before I had a similar problem with Perl when updating Ubuntu.
by billintad
Mon Jan 15, 2018 2:46 pm
Forum: Raspberry Pi Desktop for PC and Mac
Topic: Apt-get dist-upgrade problem
Replies: 10
Views: 3125

Apt-get dist-upgrade problem

This morning I tried to upgrade the OS using the standard using sudo apt-get update sudo apt-get dist-upgrade This failed with the following error : Do you want to continue? [Y/n] Y Reading changelogs... Done (Reading database ... 150586 files and directories currently installed.) Preparing to unpac...
by billintad
Fri Sep 15, 2017 3:23 pm
Forum: Python
Topic: Python speed, benchmarks, 2v3
Replies: 18
Views: 6702

Re: Python speed, benchmarks, 2v3

.... I think that's the real problem. If someone said, 'yes, integers are slower, strings are slower', 'you're doing it wrong for 3.x', I would know why, would accept that, could take steps to improve things. As it is I can only say, for me, 3.x is much slower than 2.7, and I have no idea why that ...
by billintad
Thu Sep 14, 2017 9:39 am
Forum: Python
Topic: Python speed, benchmarks, 2v3
Replies: 18
Views: 6702

Re: Python speed, benchmarks, 2v3

See the Python Speed centre for a comparison using a variety of benchmarks : https://speed.python.org/comparison/

These benchmarks are for CPython only.
by billintad
Tue Sep 12, 2017 8:57 am
Forum: Python
Topic: Exiting a while loop with a button press
Replies: 2
Views: 1659

Re: Exiting a while loop with a button press

If you forget about Qt for a moment, re-write your code snippet as follows : import time def Send(x): while x !=0: Send(0) time.sleep(0.8) Send(x) time.sleep(0.8) # QtGui.qApp.processEvents() x = x-1 if x == 0: break print(x) time.sleep(3) return None Send(0) Send(3) Run this in Idle. What are you e...
by billintad
Tue Sep 12, 2017 7:33 am
Forum: Python
Topic: Duplicate name with different value in a dict
Replies: 3
Views: 671

Re: Duplicate name with different value in a dict

Python dictionaries cannot have duplicate keys. See this discussion : https://stackoverflow.com/questions/10664856/make-dictionary-with-duplicate-keys-in-python If you want duplicate data items for a single key place the data items in a list or a tuple or a dictionary. yourdict[key] = [data1, data2]
by billintad
Tue Sep 05, 2017 5:02 pm
Forum: General discussion
Topic: Solar power for the PI Zero W & availablity
Replies: 7
Views: 4695

Re: Solar power for the PI Zero W & availablity

I am designing a set of devices that will be based on the PI Zero W and be in continuous operation. Some of them will not have access to the power mains so I'm looking to keep them going with a battery and solar power. I've seen various options (Adafruit and others). Would be interested in what fol...
by billintad
Wed Apr 26, 2017 6:58 am
Forum: Staffroom, classroom and projects
Topic: Python 3 and Twython
Replies: 2
Views: 2484

Re: Python 3 and Twython

Please can you print all the lines of the error message ?.
by billintad
Sun Jan 29, 2017 2:10 pm
Forum: Python
Topic: How to get this script working
Replies: 2
Views: 864

Re: How to get this script working

In terms of print_situation, what are you expecting to be in self ?.
by billintad
Tue Jan 24, 2017 9:09 pm
Forum: Python
Topic: pulling an Integer from a string
Replies: 1
Views: 576

Re: pulling an Integer from a string

I suppose this a problem with Python's error messages. Python is telling you that firstField does not have an attribute or function end(). You, or rather your code, thinks it should have. The reason is that the re.match didn't work and firstField doesn't contain a match object as there was no match,...
by billintad
Tue Jan 24, 2017 11:51 am
Forum: Python
Topic: Non-blocking keyboard input in Python 3
Replies: 1
Views: 1757

Re: Non-blocking keyboard input in Python 3

I get the same error when running your code from Idle3.

However, if you run your code from a terminal it does not produce this error but the test for x>0 generates an error as x is not an integer. To convert to an integer use ord(x).
by billintad
Tue Jan 24, 2017 11:05 am
Forum: Python
Topic: how do add curly braces to URL structure?
Replies: 2
Views: 1035

Re: how do add curly braces to URL structure?

https://emoncms.org/input/post.json=%7BBed1:?24.6%7D&apikey=429xxxxxxxxxxxxxxxxxxx1c52cd609 I would have thought you problem arises from the location of "?" in your data. Anything befor the "?" is treated as part of the URL path. The URL query string starts with "?" so the URL should commence with :...
by billintad
Thu May 19, 2016 8:37 pm
Forum: Python
Topic: Place holders in my code
Replies: 4
Views: 1070

Re: Place holders in my code

You could use os.listdir("/media/pi") to list the content of this directory.

See a tutorial at : http://www.diveintopython.net/file_hand ... odule.html
by billintad
Thu May 12, 2016 8:53 pm
Forum: Python
Topic: Display returned value from Python function on HTML webpage
Replies: 11
Views: 7602

Re: Display returned value from Python function on HTML webp

Taking your description at face value I suggest the following : Use the inbuilt Python http server. Build a simple http server incorporating your GPIO code as a function. This will let you serve either the entire web-page containing your distance information or just the distance information for inco...
by billintad
Fri Mar 11, 2016 11:32 am
Forum: Python
Topic: python code
Replies: 4
Views: 952

Re: python code

There is an Android app called Raspberry Control. You connect via WiFi.

I installed this app but I have not used it except to see if it worked, which it did.

There are probably other apps you can use, just search with Google etc..
by billintad
Sat Jan 02, 2016 5:36 pm
Forum: General discussion
Topic: Pi Zero Availability
Replies: 83
Views: 17032

Re: Pi Zero Availability

Heater wrote:Did you know, there is only one official language in the United Kingdom?

Can you guess what it is?
Well not exactly true, as in Pi Land (Wales) you can also be official and talk Welsh :-).
by billintad
Tue Dec 01, 2015 11:23 pm
Forum: General discussion
Topic: raspberrypi zero + wifi and Bluetooth
Replies: 67
Views: 13398

Re: raspberrypi zero + wifi and Bluetooth

Bearing in mind that Microsft Windows 10 for IoT and Snappy Ubuntu Core will only run on the newer Broadcom BCM2836 chip (based on ARMv7), and that remarks have been made about the Zero being suitable for IoT, then at some time I would expect another version of the Zero using this newer Broadcom chi...
by billintad
Sat Oct 17, 2015 9:11 pm
Forum: Raspbian
Topic: Jessie - Edimax rtl8192cu - wifi network disconnects itself
Replies: 2
Views: 1621

Re: Jessie - Edimax rtl8192cu - wifi network disconnects its

Thanks for the idea, I tried it but it doesn't work. The network is still dropped and Wicd cannot connect back to the network.
by billintad
Sat Oct 17, 2015 9:21 am
Forum: Raspbian
Topic: Jessie - Edimax rtl8192cu - wifi network disconnects itself
Replies: 2
Views: 1621

Jessie - Edimax rtl8192cu - wifi network disconnects itself

Using a RPi 2 I followed the instructions in the "sticky" to upgrade to Jessie. Everything seems to have gone fine except for this problem. On boot the RPi connects to make wifi network. I can use the web browser etc. OK. Then at some point afterwards the wifi connection is dropped. If I try to reco...
by billintad
Sun Oct 11, 2015 11:37 pm
Forum: Astro Pi
Topic: Animating The Sense Hat
Replies: 7
Views: 2652

Re: Animating The Sense Hat

Well you could start by printing out the value of n as it increments in the loop and seeing what happens, that would give you an idea of what is happening in your while loop.

Go to advanced search