Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Convert hex value into string
Post: RE: Convert hex value into string

Resolved: 'hex value is: ' + '{:04X}'.format(hex_value)
Sancho_Pansa General Coding Help 8 5,386 Dec-23-2020, 08:54 AM
    Thread: Convert hex value into string
Post: RE: Convert hex value into string

I rushed a little bit saying it's Ok. Actually, the problem is not completely resolved: format suppress leading zeros For example 0x00FF is foramtted as FF, but it should be 00FF. Any suggestions ?
Sancho_Pansa General Coding Help 8 5,386 Dec-23-2020, 08:32 AM
    Thread: Convert hex value into string
Post: RE: Convert hex value into string

(Dec-22-2020, 05:31 PM)bowlofred Wrote: Some options: >>> format(255, "x") 'ff' >>> format(255, "X") 'FF' >>> f"{255:x}" 'ff' >>> f"{255:X}" 'FF' >>> f"{...
Sancho_Pansa General Coding Help 8 5,386 Dec-23-2020, 08:10 AM
    Thread: Convert hex value into string
Post: RE: Convert hex value into string

Well ... probably I have to clarify the problem The hexadecimal value is fixed in the form 0xSS (e.g. 0xFF, 0x42, 0xBA, etc.) It cannot be entered in decimal form, it's part of design feautres This h...
Sancho_Pansa General Coding Help 8 5,386 Dec-23-2020, 07:51 AM
    Thread: Convert hex value into string
Post: Convert hex value into string

Hello, >>> hex_value = 0xFF >>> string_value = 'hex value is: ' + str(hex_value) >>> string_value 'hex value is: 255'How to get hex value is: FF ? Thanks Sancho
Sancho_Pansa General Coding Help 8 5,386 Dec-22-2020, 04:03 PM
    Thread: Change property of custom Object
Post: Change property of custom Object

Hello, In my application I use a customized Widget, developed previously by someone. Here is the code of this customized widget: from tkinter import * from tkinter.font import Font from datetime imp...
Sancho_Pansa GUI 0 1,443 Dec-17-2020, 10:53 AM
    Thread: Find two extremum in data series
Post: Find two extremum in data series

Hello, Does exist a method that allows to find two x-coordiantes of two extremums in data series like this: [Image: https://i.postimg.cc/j2vNMsCC/absorbation-spectre.jpg] Thanks, Sancho
Sancho_Pansa Data Science 0 1,701 Dec-04-2020, 02:06 PM
    Thread: How to disable custom button
Post: RE: How to disable custom button

Thanks. I didn't notice this disable()
Sancho_Pansa GUI 7 3,524 Dec-04-2020, 01:45 PM
    Thread: How to disable custom button
Post: RE: How to disable custom button

(Dec-04-2020, 09:33 AM)buran Wrote: can you post minimal reproducible example and the full traceback you get?Here is custom Button: from tkinter import * from tkinter.font import Font import Utils.C...
Sancho_Pansa GUI 7 3,524 Dec-04-2020, 09:48 AM
    Thread: How to disable custom button
Post: RE: How to disable custom button

(Dec-04-2020, 09:15 AM)buran Wrote: what GUI framework?tkinter
Sancho_Pansa GUI 7 3,524 Dec-04-2020, 09:22 AM
    Thread: How to disable custom button
Post: How to disable custom button

Hello, In my project I use custom widgets. When I try to disable a button self.myCustomButton.config(state='disabled')error occurs: Error:unknown option "-state"Any ideas ? Thanks
Sancho_Pansa GUI 7 3,524 Dec-04-2020, 08:57 AM
    Thread: Tuning PID controller
Post: RE: Tuning PID controller

(Nov-06-2020, 06:56 PM)Larz60+ Wrote: There are several PID controller tuning packages in this group. Since I haven't used any of them, I cannot reccommend one over another. https://pypi.org/search/...
Sancho_Pansa General Coding Help 4 4,404 Nov-09-2020, 07:51 AM
    Thread: Tuning PID controller
Post: RE: Tuning PID controller

(Nov-06-2020, 04:35 PM)deanhystad Wrote: In Python or are you open to using Matlab/Simulink or C/C++?Matlab/Simulink probably not. Python or C/C++.
Sancho_Pansa General Coding Help 4 4,404 Nov-09-2020, 07:50 AM
    Thread: Tuning PID controller
Post: Tuning PID controller

Hello, Does exist a particular PID library that facilitate PID controller tuning. Let's say realize following scenario: specify some guess values for Kp, Ki, Kd apply some kind of perturbation (e.g...
Sancho_Pansa General Coding Help 4 4,404 Nov-06-2020, 04:00 PM
    Thread: Solve system of equations
Post: RE: Solve system of equations

(Oct-26-2020, 05:28 PM)Askic Wrote: Hello Sancho, please double check your equations. I'm looking your last code. Is it Ar = 1 - omega**2*Cs*Cl or Ar = 1 - omega**2*Cl*L??? Hello Askic. Here is th...
Sancho_Pansa General Coding Help 19 8,967 Oct-27-2020, 08:15 AM
    Thread: Parameters aren't seen inside function
Post: RE: Parameters aren't seen inside function

Finally here is the solution: use subs function, that creates new circuit and substitute the parameters: from lcapy import network, Circuit, j, omega, symbol import numpy as np from math import pi c...
Sancho_Pansa General Coding Help 8 2,955 Oct-27-2020, 07:52 AM
    Thread: Parameters aren't seen inside function
Post: RE: Parameters aren't seen inside function

Vin is no longer relevant. What is interests me: how to pass Rin, Cs, L, Rs, Rl as values, defined outside of Circuit, into Circuit.
Sancho_Pansa General Coding Help 8 2,955 Oct-26-2020, 03:48 PM
    Thread: Parameters aren't seen inside function
Post: RE: Parameters aren't seen inside function

From the link it isn't clear how to use symbols. For example, if I create symbol for Rin: Rin = symbol('Rin') Then, how to associate this symbol with a real value (eg 50.0) so that Rin is perceived as...
Sancho_Pansa General Coding Help 8 2,955 Oct-26-2020, 03:34 PM
    Thread: Parameters aren't seen inside function
Post: RE: Parameters aren't seen inside function

Hello, If I properly understood your suggestion, I have to define parameters as expression. Doesn't work. In the example below when I build a ircuit, using numeric values, it works. Once I try to use...
Sancho_Pansa General Coding Help 8 2,955 Oct-26-2020, 02:47 PM
    Thread: Solve system of equations
Post: RE: Solve system of equations

Thanks. 1st value (i.e. L) is Ok. 2nd value (i.e. C) is lower than expected of 30% The last one (i.e. R) is 40% of expected. Here is code, that generates expected values: import math Pi = math.pi fo...
Sancho_Pansa General Coding Help 19 8,967 Oct-26-2020, 10:55 AM

User Panel Messages

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