Go to advanced search

by ankith26
Mon Jul 20, 2020 3:16 pm
Forum: Python
Topic: Pi setup.
Replies: 11
Views: 794

Re: Pi setup.

OP is referring to ‘setup.py’ - which is a standard way of naming a file in python that packages a module. See this helpful link https://packaging.python.org/tutorials/packaging-projects/ . I appologise for my confusion but that wasn't exactly clear. Basically in python, when we install a package o...
by ankith26
Mon Jul 20, 2020 11:11 am
Forum: Python
Topic: Pi setup.
Replies: 11
Views: 794

Re: Pi setup.

For more examples, just check the github repo of any popular python module, all of them will have a setup.py at root. Pygame https://github.com/pygame/pygame Requests https://github.com/psf/requests Django https://github.com/django/django Urllib3 https://github.com/urllib3/urllib3 And many, many oth...
by ankith26
Mon Jul 20, 2020 11:02 am
Forum: Python
Topic: Pi setup.
Replies: 11
Views: 794

Re: Pi setup.

OP is referring to ‘setup.py’ - which is a standard way of naming a file in python that packages a module. See this helpful link https://packaging.python.org/tutorials ... -projects/.
by ankith26
Sat Jun 20, 2020 10:02 am
Forum: Python
Topic: Python Code wont run and send to Firebase
Replies: 2
Views: 607

Re: Python Code wont run and send to Firebase

First things first, in shell you are typing python fireTest.py . This will mean that your code will run with python2. To call python3 use python3 fireTest.py . And, the error it’s giving - I can say that instead of KeyboardInterrupt you have written Keyboardinterup- although I cannot see that in the...
by ankith26
Thu Jun 18, 2020 3:12 am
Forum: Python
Topic: converting chat program from PC to RPI
Replies: 7
Views: 896

Re: converting chat program from PC to RPI

here is the server code import socket import threading import queue import sys import random import os # #Server Code def RecvData(sock,recvPackets): while True: data,addr = sock.recvfrom(1024) recvPackets.put((data,addr)) def RunServer(): # host = socket.gethostbyname(socket.gethostname()) host = ...
by ankith26
Thu Jun 18, 2020 3:04 am
Forum: Python
Topic: converting chat program from PC to RPI
Replies: 7
Views: 896

Re: converting chat program from PC to RPI

The program works wonderfully between two PCs running windows 10. However I want the clients to be RPIs. The end version of the software would have the PC (server) have two way comms with multiple RPI controlled robots(client). Here is the client software: import socket import threading import queu...
by ankith26
Wed Jun 17, 2020 5:40 am
Forum: Python
Topic: recursive function
Replies: 6
Views: 726

Re: recursive function

Returns a value for all x<=9.22*10^19: >>> def c(x): ... if x==1: ... return 0 ... if x%2==1: ... return 1+c(3*x+1) ... else: ... return 1+c(x/2) ... >>> c(8) 3 >>> c(17) 12 >>> I am not able to figure out how this is related to the topic. Anyways, the multiplication algorithm is good, the next ste...
by ankith26
Sat May 09, 2020 3:49 am
Forum: Python
Topic: Installing MicroPython - How To Guide
Replies: 27
Views: 29706

Re: Installing MicroPython - How To Guide

I always had the impression that python 3.7 is the fastest among all cpython implementation. How are your results showing python 2 to be faster. Maybe try a different variety of tests? https://hackernoon.com/which-is-the-fastest-version-of-python-2ae7c61a6b2b Anyways, python 3.8 has been a bit optim...
by ankith26
Mon Mar 30, 2020 4:58 am
Forum: General discussion
Topic: Please just ignore (some) 1st posts
Replies: 59
Views: 3726

Re: Please just ignore (some) 1st posts

I have a different viewpoint here. It could be the case that the person who just doesn’t know how to put forward his question just browsed the Internet for similar questions and saw a similar question and decided to post it here to have it answered. They may also use google translate to get their qu...
by ankith26
Mon Feb 24, 2020 10:53 am
Forum: Python
Topic: Detecting Key Press No Window or Wait
Replies: 4
Views: 1265

Re: Detecting Key Press No Window or Wait

Just check https://pypi.org/project/pynput/, I have not tested it but I guess it should work
by ankith26
Mon Feb 24, 2020 10:37 am
Forum: Python
Topic: Run the python interpreter nicer...
Replies: 3
Views: 448

Re: Run the python interpreter nicer...

jahboater wrote:
Sun Feb 23, 2020 7:10 pm
If you have a quad core Pi then it should not be needed - there are three spare cores to run other programs.

That’s true, python can only use one core so you have three more for other processes.
by ankith26
Thu Feb 20, 2020 12:10 pm
Forum: Beginners
Topic: Best method to power Pi Zero W from 24V psu?
Replies: 19
Views: 2032

Re: Best method to power Pi Zero W from 24V psu?

LTolledo wrote:
Thu Feb 20, 2020 12:05 pm
how about this one?
OMRON S82S-7705
I don’t know about op, but it looks affordable to me :D

PS: Yes, I am sarcastic
by ankith26
Thu Feb 20, 2020 12:07 pm
Forum: General discussion
Topic: Serial port issues when running python script using terminal
Replies: 11
Views: 959

Re: Serial port issues when running python script using terminal

B.Goode wrote:
Thu Feb 20, 2020 8:50 am
ankith26 wrote:
Thu Feb 20, 2020 5:12 am

Python 2 is depracated and is almost reaching eol.

Python 2 has now passed its End of Life date: https://www.python.org/doc/sunset-python-2/
Hmm, I always thought that they will EOL python 2 in 2021.
Anyways thanks for the info.
by ankith26
Thu Feb 20, 2020 8:44 am
Forum: Beginners
Topic: Best method to power Pi Zero W from 24V psu?
Replies: 19
Views: 2032

Re: Best method to power Pi Zero W from 24V psu?

I guess you must try a buck converter that has a good rating and quality.
Something like this https://www.amazon.com/Ailavi-Converter ... B00XPZ7I4I.
But I guess it is a bit costly for what it is actually worth, shouldn’t be more than 6 dollars.
by ankith26
Thu Feb 20, 2020 5:12 am
Forum: General discussion
Topic: Serial port issues when running python script using terminal
Replies: 11
Views: 959

Re: Serial port issues when running python script using terminal

Just a small suggestion, try to port the code to python 3.
Python 2 is depracated and is almost reaching eol.
Maybe porting the code can fix the unseen issue.
by ankith26
Wed Feb 19, 2020 6:46 am
Forum: Beginners
Topic: Internet shortcuts on the desktop ...
Replies: 11
Views: 24766

Re: Internet shortcuts on the desktop ...

Not sure why people will do that.
They will not get any medal anyway
by ankith26
Wed Feb 19, 2020 6:32 am
Forum: Python
Topic: ZipFile in python
Replies: 6
Views: 678

Re: ZipFile in python

I got an idea to achieve what I want, so wrote out a small script for it. I haven’t tested it yet but will do soon. This solution is not the most elegant one, therefore if you all can get a better solution, you can post it here. Thanks for the help so far. from zipfile import ZipFile with ZipFile('t...
by ankith26
Wed Feb 19, 2020 6:15 am
Forum: Beginners
Topic: Internet shortcuts on the desktop ...
Replies: 11
Views: 24766

Re: Internet shortcuts on the desktop ...

Not anymore.
BTW why is this not locked.
by ankith26
Wed Feb 19, 2020 6:10 am
Forum: Beginners
Topic: Where to buy genuine Raspberry Pi 4B?
Replies: 17
Views: 1099

Re: Where to buy genuine Raspberry Pi 4B?

Oh, didn’t know that.
Anyways, they will be charging a lot of money and people are quite happy with the official one so they will not throw away their money.
by ankith26
Wed Feb 19, 2020 6:00 am
Forum: Beginners
Topic: Where to buy genuine Raspberry Pi 4B?
Replies: 17
Views: 1099

Re: Where to buy genuine Raspberry Pi 4B?

In the arduino world it is very easy to make your own clone of the original. But in the world of pi, it is very very difficult to build a clone. Do not assume anyone sells the pi’s hardware components (like soc) in your local hardware store. But there exist various resellers of the pi, all of them s...
by ankith26
Wed Feb 19, 2020 3:40 am
Forum: Python
Topic: Function Repeats itself 10 Times Instead of Once!
Replies: 4
Views: 526

Re: Function Repeats itself 10 Times Instead of Once!

In your draw() function, there is no need to define the variables as global, this is because the function can read for variable outside to function.
But you cannot change the variable inside to function (doing this will not raise error but will create a new local variable for the function)
by ankith26
Wed Feb 19, 2020 3:34 am
Forum: Python
Topic: ZipFile in python
Replies: 6
Views: 678

Re: ZipFile in python

Using extractall is not the solution to my problem. I aldready tested it. Imagine I have a zipfile called test.zip. I keep another directory inside it called pyTest. I want the CONTENTS of PYTEST to be in the directory of my python project. When I use extractall method, it makes a new directory call...
by ankith26
Tue Feb 18, 2020 3:18 pm
Forum: General discussion
Topic: Which Google Chrome?
Replies: 6
Views: 8709

Re: Which Google Chrome?

Please tell which pi and which os you run, as chromium comes pre installed with Raspbian and not chrome.

Either case, the link you gave tells it is trying to install the package for an amd cpu
by ankith26
Tue Feb 18, 2020 7:56 am
Forum: General discussion
Topic: GPIO programing
Replies: 9
Views: 966

Re: GPIO programing

Use more “for” loops. For example, the following code for i in range(2): zx.output(4, zx.HIGH) sleep(.1) zx.output(5, zx.HIGH) sleep(.1) zx.output(6, zx.HIGH) sleep(.1) zx.output(12, zx.HIGH) sleep(.1) zx.output(13, zx.HIGH) sleep(.1) zx.output(16, zx.HIGH) sleep(.1) zx.output(17, zx.HIGH) sleep(.1)...

Go to advanced search