Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Undestanding asyncio (Solved)
Post: RE: Undestanding asyncio

(Mar-16-2024, 02:09 PM)deanhystad Wrote: First strip out all the goop to focus on the asyncio [python] 2. loop_start() is non-blocking. It starts the client loop and returns immediately. Do you w...
ebolisa General Coding Help 2 264 Mar-16-2024, 03:40 PM
    Thread: Undestanding asyncio (Solved)
Post: Undestanding asyncio (Solved)

Hi, I've a test code below which connects to a AWS server but it doesn't loop every 10s. What do I've to do so it loops? Also, I get a warning for line 31 "Coroutine 'create_task' is not awaited". App...
ebolisa General Coding Help 2 264 Mar-16-2024, 05:09 AM
    Thread: Understanding a function
Post: Understanding a function

Hi, I'd appreciate if someone can explain me the first function and what's used for since both yield the same results. TIA. @lambda _: _() def func1() -> str: print('func1 was called') return ...
ebolisa General Coding Help 3 795 Jul-12-2023, 05:54 PM
    Thread: Q on classes
Post: RE: Q on classes

(Mar-06-2023, 03:21 PM)deanhystad Wrote: Clock.set_time() is an instance method. You need to call it using an instance of Clock. I would rename this method __str__: def get_time(self): ...
ebolisa General Coding Help 4 881 Mar-06-2023, 03:24 PM
    Thread: Q on classes
Post: RE: Q on classes

(Mar-06-2023, 03:20 PM)deanhystad Wrote: Clock.set_time() is an instance method. You need to call it using an instance of Clock. Thanks for the quick response but then how do I recall a function wi...
ebolisa General Coding Help 4 881 Mar-06-2023, 03:21 PM
    Thread: Q on classes
Post: Q on classes

Hi, I appreciate some help on this micropython code as I'm learning classes. When I execute it, I get the error: Error:Error in sysc: function takes 4 positional arguments but 3 were given from line...
ebolisa General Coding Help 4 881 Mar-06-2023, 03:17 PM
    Thread: Use of pygame
Post: RE: Use of pygame

(Sep-30-2022, 06:27 PM)deanhystad Wrote: Post pygame questions in the pygame forum. Pygame programs have an event loop that keeps the program running. When the loop exists, the program ends. You ...
ebolisa General Coding Help 2 1,236 Sep-30-2022, 06:28 PM
    Thread: Use of pygame
Post: Use of pygame

Hi, The following code plays only the beginning of a file: pygame.mixer.init() pygame.mixer.music.load('my_music.mp3') pygame.mixer.music.play() pygame.mixer.music.set_volume(0.5)If I add some delay...
ebolisa General Coding Help 2 1,236 Sep-30-2022, 06:22 PM
    Thread: dnload/upload with FTP
Post: RE: dnload/upload with FTP SOLVED

Solved! Here's my new code (which I'm sure it can be improved): # open ftp connection ftp = FTP(ftp_server) # login ftp.login(url_username, url_pass) # 230 User user-7092639 logged in # change di...
ebolisa General Coding Help 4 1,809 Sep-07-2022, 11:17 AM
    Thread: dnload/upload with FTP
Post: RE: dnload/upload with FTP

Thank you much! I'm progressing. This code downloads a file in my directory but, because I'm working with a microprocessor I'd like to download the file into the memories, make changes and upload it ...
ebolisa General Coding Help 4 1,809 Sep-07-2022, 09:40 AM
    Thread: dnload/upload with FTP
Post: dnload/upload with FTP

Hi, What's the right syntax to connect to a ftp server and download a file? The following code cannot find the file however, I can with a ftp client app. TIA ftp_server = "192.168.1.10" url_userna...
ebolisa General Coding Help 4 1,809 Sep-06-2022, 11:01 PM
    Thread: Stripping numbers from text
Post: RE: Stripping numbers from text

(Jul-18-2022, 02:43 PM)snippsat Wrote: Can use regex. >>> import re >>> >>> para_array = ['s1=2.67', 's2=34', 'p1=1', 'p2=1'] >>> for item in para_array: ... ...
ebolisa General Coding Help 4 1,454 Jul-18-2022, 03:18 PM
    Thread: Stripping numbers from text
Post: Stripping numbers from text

Hi, The response from a web form fills an array. Its content may average from empty to several strings. I need to extract data from said strings so I can work with it. I came out with the following c...
ebolisa General Coding Help 4 1,454 Jul-18-2022, 01:26 PM
    Thread: Writing to json file
Post: Writing to json file

Hi At times, the below function writes an extra "}" in the json file and I cannot see where the problem may lie. I appreciate some guidance. Micropython running on Raspberry Pico W TIA # write to fil...
ebolisa General Coding Help 1 1,012 Jul-17-2022, 04:13 PM
    Thread: Simple encoding code
Post: RE: Simple encoding code

(Jun-18-2022, 12:45 AM)deanhystad Wrote: Limit your alphabet to only visible characters. This example limits the alphabet to upper and lowercase letters, Thank you. It works even with a little modi...
ebolisa General Coding Help 3 1,461 Jun-18-2022, 07:14 AM
    Thread: Simple encoding code
Post: Simple encoding code

Hi, This simple encoding code converts text to ASCII and adds a one digit number to it. It seems to work ok, but while testing it, I noticed that if a 'v' is used, it's converted to ' ' when a 9 is a...
ebolisa General Coding Help 3 1,461 Jun-17-2022, 09:44 PM
    Thread: Q on formatting
Post: RE: Q on formatting

(Dec-24-2021, 10:38 PM)Gribouillis Wrote: Personally I don't like these records with anonymous members. **biggrin** that reminds me of an Italian movie. An American tourist just arrived at the airpo...
ebolisa General Coding Help 4 1,546 Dec-24-2021, 10:53 PM
    Thread: Q on formatting
Post: RE: Q on formatting

(Dec-24-2021, 08:16 PM)BashBedlam Wrote: What ever works best for you **wink**I agree, however, one line coding is challenging.
ebolisa General Coding Help 4 1,546 Dec-24-2021, 09:53 PM
    Thread: Q on formatting
Post: Q on formatting

Hi, The variable ss retains a scanned list of local routers. I don't know why mine is shown twice but, that's a question for a different forum. The variable a retains the rssi of my first encountere...
ebolisa General Coding Help 4 1,546 Dec-24-2021, 07:33 PM
    Thread: Simple arithmetic question
Post: RE: Simple arithmetic question

(Dec-15-2021, 02:22 PM)deanhystad Wrote: What is the logic of your rounding? 12.45 should round to 12.Because 12.45 should be 12.5 and therefore, 13. 12.13 should be 12.1 and therefore, 12. More i...
ebolisa General Coding Help 5 2,073 Dec-15-2021, 02:39 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020