Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: SQLAlchemy with type hints
Post: RE: SQLAlchemy with type hings

Just for future reference, what I decided to do was this: models.py from typing import Type, Union TableTypes = Union[Type['M1'], Type['M2'], ..., Type['M20']] class M1(db.Model): ... class M2...
gontajones General Coding Help 1 6,764 Jun-17-2020, 06:52 PM
    Thread: SQLAlchemy with type hints
Post: SQLAlchemy with type hints

Hey guys, I'm having hard time to make a clean type hint of an SQLAlchemy project that I'm working on. The issue is that I need type hint for some methods that accept only a bunch of models from a fi...
gontajones General Coding Help 1 6,764 Jun-17-2020, 11:39 AM
    Thread: termocouple and raspberry pi
Post: RE: termocouple and raspberry pi

You should start by playing with these python modules: https://pypi.org/project/RPi.GPIO/#description https://pypi.org/project/gpiozero/#description
gontajones General Coding Help 4 32,606 Mar-14-2020, 11:07 PM
    Thread: why my function doesn't work
Post: RE: why my function doesn't work

Maybe this way will be more easy to understand: def get_tax(year, value): if year > 2004: tax = value * 22 / 100 else: tax = value * 11 / 100 return tax tax = get_tax(2...
gontajones General Coding Help 4 2,886 Nov-19-2019, 07:09 PM
    Thread: How to control frequency sampling rate my dial_tone through AJAX to flask server?
Post: RE: How to control frequency sampling rate my dial...

Try this: $("#slider").roundSlider({ radius: 215, min: 0, max: 40000, change: function (args) { console.log(args.value); $.getJSON('/valueofslider', { samp_rate_val: args.value ...
gontajones General Coding Help 4 3,242 Jul-24-2019, 08:41 PM
    Thread: picamera not working on premade script
Post: RE: picamera not working on premade script

Could you please share the link to this robot kit? I think your best choice will be using a official Raspbian image and try to access the picamera. Maybe this is a hardware issue.
gontajones General Coding Help 1 2,530 Jul-24-2019, 10:11 AM
    Thread: I can't uninstall chatterbot?
Post: RE: I can't uninstall chatterbot?

If you have really installed chatterbot with pip3 install chatterbot, this command will list it and all other packages: pip3 list How do you know it is still installed?
gontajones General Coding Help 9 6,782 Jul-17-2019, 05:38 PM
    Thread: I can't uninstall chatterbot?
Post: RE: I can't uninstall chatterbot?

But how did you installed it?
gontajones General Coding Help 9 6,782 Jul-16-2019, 05:02 PM
    Thread: Score each word from list variable
Post: RE: Score each word from list variable

This time I'll let you try... **razz** You can use something like: if word not in not_allowed_words: ...
gontajones General Coding Help 6 3,376 Jun-13-2019, 05:44 PM
    Thread: Score each word from list variable
Post: RE: Score each word from list variable

def word_sentiment(tuple_list): list_words = [] # Loop through each tuple (tp) for tp in tuple_list: for word in tp[0].split(" "): list_words.append((word, tp[1])) ...
gontajones General Coding Help 6 3,376 Jun-12-2019, 12:07 PM
    Thread: Outputting results into other program
Post: RE: Outputting results into other program

With PyAutoGUI you can control keyboard and/or mouse cursor. This way you can automate the task.
gontajones General Coding Help 1 1,861 Jun-11-2019, 02:49 PM
    Thread: RPi GPIO Flashing LED
Post: RE: RPi GPIO Flashing LED

I think you'll have to start a Thread in swLed() that could trigger a while loop to blink the LED (if button is pressed [ON]). If the press button is OFF you'll have to set a "global stop variable" (k...
gontajones General Coding Help 1 3,118 Jun-07-2019, 01:32 PM
    Thread: Boto 3 and Mongo DB
Post: RE: Boto 3 and Mongo DB

What specifically do you want to do? Maybe this can help DatabaseMigrationService.
gontajones General Coding Help 2 2,958 May-23-2019, 06:53 PM
    Thread: need some help with loops
Post: RE: need some help with loops

Check this: import random T = 10 H = 10 while H > 0 and T > 0: p2 = input("[Tylers] use punch? ") if p2 == "yes": H -= random.randint(1, 5) print("THE PUNCH LANDS! Hay...
gontajones General Coding Help 2 1,978 May-07-2019, 03:54 PM
    Thread: Install Python on Raspberry Pi 3 B+
Post: RE: Install Python on Raspberry Pi 3 B+

My suggestion is using an IDE in your PC and share files with the Raspi.
gontajones General Coding Help 4 4,458 May-01-2019, 12:14 PM
    Thread: Read re.split expression
Post: RE: Read re.split expression

re.split(r'\n\n\n', html) -> Split the string html in elements everytime \n\n\n sequence is found. It returns a list of all these elements. Note that it doesn't split \n nor \n\n... As an example ...
gontajones General Coding Help 2 2,114 Apr-25-2019, 11:41 AM
    Thread: creating an image
Post: RE: creating an image

import numpy as np from matplotlib import pyplot as plt # Generates an 50x50 array with random values between 0-1 # You must load your CSV into data data = np.random.random((50, 50)) # Create the im...
gontajones General Coding Help 1 1,766 Apr-24-2019, 07:17 PM
    Thread: Read Nested JSON with pandas.io.json
Post: RE: Read Nested JSON with pandas.io.json

This is not the best way but it is a start... import pandas as pd import pandas.io.json as pd_json import json with open("data.json", "r") as fd: json_content = json.load(fd) my_df_list = []...
gontajones Data Science 4 9,601 Apr-24-2019, 03:56 PM
    Thread: Read Nested JSON with pandas.io.json
Post: RE: Read Nested JSON with pandas.io.json

You can access only some columns of df using: new_df = df[['Data.Code', 'Data.DateFrom', 'Data.Address']]
gontajones Data Science 4 9,601 Apr-23-2019, 03:24 PM
    Thread: A hidden library?
Post: RE: A hidden library?

He has to check if pip is really installing modules for the python interpreter that he is running his scripts. He can investigate it with: 1 - Check pip version and its bond python interpreter. $ pip...
gontajones General Coding Help 3 3,163 Apr-01-2019, 09:52 PM

User Panel Messages

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