Go to advanced search

by klintkrossa
Thu Apr 27, 2017 6:25 pm
Forum: Python
Topic: Ugg timezone :<
Replies: 6
Views: 813

Re: Ugg timezone :<

Found a fix
the down side is that the RPi has to be rebooted. :)
forced a copy for the proper time zone.
by klintkrossa
Mon Apr 24, 2017 9:23 pm
Forum: Python
Topic: Ugg timezone :<
Replies: 6
Views: 813

Ugg timezone :<

Hello, I would like a python3 program to set the timezone according to the web ip. I am able to get the time zone location and change the time zone in python3 when I leave it returns to UTC. import requests from urllib.request import urlopen import re import os os.system('date') #Mon 24 Apr 11:18:03...
by klintkrossa
Mon Apr 24, 2017 2:06 pm
Forum: Python
Topic: scheduled functions
Replies: 7
Views: 1722

Re: scheduled functions

Thanks that should cut some of the fat. Yes I do know that "pass " is not needed, I use it to make the editor check my indents. You can actually use the time module on its own with struct_time in a more compact way by extracting and feeding in tuples, like this import time AddDay = False ChangeTime ...
by klintkrossa
Sun Apr 23, 2017 6:37 pm
Forum: Python
Topic: scheduled functions
Replies: 7
Views: 1722

Re: scheduled functions

Hello, The others will be smaller. I like python3 I find that it will not return until the out side job is done I did have a cple problems with bash doing that. here is my program modified for you. import time import datetime AddDay = False ChangeTime = False try: while True: ts = time.time() date_t...
by klintkrossa
Fri Apr 21, 2017 4:22 pm
Forum: Python
Topic: Python and C++
Replies: 9
Views: 1295

Re: Python and C++

Hello,
I have two thoughts that may help, I just did a little with it and found that I now nothing about C.

Code: Select all

import ctypes
https://docs.python.org/3/extending/extending.html

I hope that helps.
by klintkrossa
Fri Apr 21, 2017 4:08 pm
Forum: Python
Topic: Openning Serial Ports
Replies: 9
Views: 36793

Re: Openning Serial Ports

Hello,

I have noticed that raspi-config the serial port is not enabled. ???? :|
by klintkrossa
Thu Apr 13, 2017 7:03 pm
Forum: Python
Topic: python3 modules
Replies: 2
Views: 517

Re: python3 modules

Hello

Some times

Code: Select all

help(PiCamera)
helps.
by klintkrossa
Thu Apr 13, 2017 5:10 pm
Forum: Python
Topic: else and elif syntax error [solved]
Replies: 21
Views: 6558

Re: else and elif syntax error

Hello, This is my two-bits. RLG = input(" Welcome RLG Gamers is there a admin with you? Y or N") RLG = RLG.upper() if RLG == "Y": print("cool \n Admin(s) let the players answer the questions") elif RLG== "N": print("ok.. \n that is fine but here are the rules") else: print("Sorry did not recognise a...
by klintkrossa
Thu Apr 13, 2017 4:30 pm
Forum: Python
Topic: More ssh questions
Replies: 1
Views: 335

More ssh questions

Hello, I have two reason for this question. Can python{3} force my ssh connection to close? From the Raspberry pi side. ie. If there is a intruder I call a python command and it closes all but my connection. ie2. I have python shell running when I log in. if I type exit() the raspberry pi just reset...
by klintkrossa
Thu Apr 13, 2017 4:18 pm
Forum: Python
Topic: code python launch at startup...i need a suggestion
Replies: 2
Views: 1003

Re: code python launch at startup...i need a suggestion

Hello
The one that I like is:
sudo nano /etc/profile.d/startup.sh

Code: Select all

#!/bin/sh

sudo /usr/bin/python3 /complete/path/to/your/program.py 
Down side is that some time it will not show if there are errors loading the python.
by klintkrossa
Wed Mar 29, 2017 7:47 pm
Forum: Python
Topic: serial_utils
Replies: 4
Views: 553

Re: serial_utils

hey, i am trying to run this code on my raspberry pi 3 on python 3 when i do this i get importerror: no module named 'serial_utils' any solution for that? hope someone will post a response and any solution will be appreciated. :) :) :) :) :) the link for my file is https://github.com/ryanGT/zumo_se...
by klintkrossa
Sun Mar 19, 2017 6:21 pm
Forum: Python
Topic: How to get how loud microphone input is.
Replies: 2
Views: 539

Re: How to get how loud microphone input is.

Hello,
I found this,
https://pypi.python.org/pypi/webrtcvad
The ham radio would use VOX, form that I found VAD. Voice Activated Detector.
by klintkrossa
Sun Mar 19, 2017 5:56 pm
Forum: Python
Topic: More-exclusive OR test
Replies: 8
Views: 1100

Re: More-exclusive OR test

Hello,
Now I'm interested. My thought was how do the first ring in game work, like Jeopardy.
I have no nee just now I like using the xor gates. and not-xor.
Would a not-xor work?
by klintkrossa
Fri Mar 17, 2017 3:11 pm
Forum: Python
Topic: last part of a batch loader
Replies: 1
Views: 346

last part of a batch loader

Hello, I am trying to make an auto python3 import loader. It is getting biger by the moment. I am batch loading them. I have it running through a system(“sudo apt-get install %s” % X) if it did not find “X” then it look for it in system(‘pip3 install %s’ % X). The next step is to manually install it...
by klintkrossa
Fri Mar 17, 2017 2:29 pm
Forum: Python
Topic: Raspberry GPIO3 switching between HIGH and LOW alone (bug?)
Replies: 4
Views: 650

Re: Raspberry GPIO3 switching between HIGH and LOW alone (bu

Hello, This is a problem in a lot of logic inputs. This page might be a good read, https://www.ibiblio.org/kuphaldt/electricCircuits/Digital/DIGI_3.html 04137.png In the image replace the CMOS with gpio. WARNING Make sure that the resister Ohms is big enough!!!!! If the ohms is to small it will burn...
by klintkrossa
Fri Mar 17, 2017 2:06 pm
Forum: Python
Topic: Download folders(of images) from remote locations py script
Replies: 6
Views: 1133

Re: Download folders(of images) from remote locations py scr

Hello,
Just a add, move the file to /var/www/html.
In "py" I like to use os.system().
by klintkrossa
Wed Mar 15, 2017 2:05 pm
Forum: Python
Topic: Find out if there is broken or missed matched imports
Replies: 5
Views: 688

Re: Find out if there is broken or missed matched imports

Hello, The import is to see what is missing, broken or needs some more research. For this application and the amount of imports it works fine. I will keep that in mind for when I have to batch load a lot of files. I know it coming. :D :D Hello all, Just got back to the Forum. I guess that asking the...
by klintkrossa
Tue Mar 14, 2017 11:48 pm
Forum: Python
Topic: Find out if there is broken or missed matched imports
Replies: 5
Views: 688

Re: Find out if there is broken or missed matched imports

Hello all, Just got back to the Forum. I guess that asking the question some time triggers a better search. I looked for a couple hours and found nothing. Ask the question in the Forum then back to google and found this. __import__() PIPS = [] try: for X in PIP_adds: print("\n") XL = X.lower() XT = ...
by klintkrossa
Tue Mar 14, 2017 8:42 pm
Forum: Python
Topic: Find out if there is broken or missed matched imports
Replies: 5
Views: 688

Find out if there is broken or missed matched imports

Hello I would like to batch check my imports to find out if there is broken or missed matched imports. the "import ("%s" % X)" did not work. PIP_adds is a list of 25 imports that I would like to know if they are there and if not run my def. What is the magic code for the 4th line down? try: for X in...
by klintkrossa
Tue Mar 14, 2017 8:31 pm
Forum: Python
Topic: Count button push
Replies: 2
Views: 910

Re: Count button push

I think that a "for" statement would work also.
by klintkrossa
Mon Mar 13, 2017 5:22 pm
Forum: Python
Topic: hold "input" for only so long
Replies: 4
Views: 644

Re: hold "input" for only so long

Threading worked. thanks #!/usr/bin/python3 from os import system from threading import Timer def hello(): print("hello, world") system('sud reboot') t = Timer(30.0, hello) try: t.start() except: print('did not work') RB = input('Reboot (Y) or N') if RB == "": RB = 'Y' RB = RB.upper() RB = RB[0] if ...
by klintkrossa
Mon Mar 13, 2017 1:06 am
Forum: Python
Topic: hold "input" for only so long
Replies: 4
Views: 644

hold "input" for only so long

Hello, I would like to run a python3 program at the end I want to ask to reboot or not. If I am not around I would like it to reboot. RB = input('Reboot (Y) or N') RB = RB.upper() RB = RB[0] if RB == "N": exit() pass else: system('sudo reboot') exit() pass It stops at RB = input('-->'). is there som...
by klintkrossa
Mon Mar 13, 2017 12:59 am
Forum: Python
Topic: python 3 cgi fails when file read
Replies: 3
Views: 629

Re: python 3 cgi fails when file read

I like to use

Code: Select all

with open(FileName, 'rt') as file_obj:
    FileData = file_obj.read()
    file_obj.close()
The other question is it the second time you tried to enter the file?
by klintkrossa
Fri Feb 24, 2017 6:45 pm
Forum: Python
Topic: More os questions
Replies: 2
Views: 406

Re: More os questions

paddyg wrote:can you not just do something like this?

Code: Select all

...
      res = system("sudo apt-get -y install {}".format(X))
      if res == 25600:
...
      elif res == 32512:
Thanks yes that will do it
by klintkrossa
Fri Feb 24, 2017 6:02 pm
Forum: Python
Topic: Python inside of html
Replies: 8
Views: 1596

Re: Python inside of html

mahjongg wrote:
klintkrossa wrote:We should all be like the Hessian artilleryman of Sleepy Hollow.
In what way? Should we all have our head blown off by cannonballs :?: :mrgreen: :mrgreen: :mrgreen:

That's not nice :!: Remember the primary rule here?
:lol: :lol:

We should all go headless.

Go to advanced search