Click here to Skip to main content
15,886,793 members
Home / Discussions / Python
   

Python

 
AnswerRe: Python learning Pin
Kevin McFarlane10-Jan-23 0:05
Kevin McFarlane10-Jan-23 0:05 
QuestionTennis racket Pin
Member 1586879618-Dec-22 10:04
Member 1586879618-Dec-22 10:04 
QuestionRe: Tennis racket Pin
Richard MacCutchan18-Dec-22 21:46
mveRichard MacCutchan18-Dec-22 21:46 
QuestionMessage Closed Pin
6-Dec-22 21:28
Tangent Technologies6-Dec-22 21:28 
AnswerRe: Variables Pin
trønderen6-Dec-22 22:29
trønderen6-Dec-22 22:29 
QuestionDSA DOUBT Pin
Krishang Gupta1-Dec-22 11:03
Krishang Gupta1-Dec-22 11:03 
AnswerRe: DSA DOUBT Pin
Richard Deeming1-Dec-22 22:08
mveRichard Deeming1-Dec-22 22:08 
QuestionHow to iterate within a list in python? Pin
ryandaniel1724-Nov-22 18:48
ryandaniel1724-Nov-22 18:48 
Currently I am receiving some JSON packets from my sensor and I am having some difficulties to extract some information from the JSON packet. I have extracted the device name/eui and data details using the method below but could not do the same to extract the rssi and loRaSNR values from the packet. Are there any better ways to achieve this? Thanks.

Python
payload = json.loads(message.payload.decode())

deviceNAME = payload["deviceName"]
deviceEUI = payload["devEUI"]
info = payload["rxInfo"]
print (len(payload))
print (len(info))
print (payload)
print(info)


OUTPUT:

10
1
{'applicationID': '13', 'applicationName': '16_CH_CM_SYSTEM', 'deviceName': '16_CH_CM_SYSTEM_LORA', 'devEUI': 'ff00058011000004', 'rxInfo': [{'gatewayID': '54d0b4fffe0c89b2', 'name': 'F8L10GW-915-L-SR5G', 'time': '2022-11-25T05:39:41.352315Z', 'rssi': -107, 'loRaSNR': 6.3, 'location': {'latitude': na, 'longitude': na, 'altitude': na}}], 'txInfo': {'frequency': 923400000, 'dr': 4}, 'adr': False, 'fCnt': 5527, 'fPort': 21, 'data': 'VDI1NTI1NjI1OTI1ODI1OTI1NzI1NjI2MDI2Mjo='}
[{'gatewayID': '54d0b4fffe0c89b2', 'name': 'F8L10GW-915-L-SR5G', 'time': '2022-11-25T05:39:41.352315Z', 'rssi': -107, 'loRaSNR': 6.3, 'location': {'latitude': na, 'longitude': na, 'altitude': na}}]


modified 25-Nov-22 4:14am.

AnswerRe: How to iterate within a list in python? Pin
Richard MacCutchan24-Nov-22 22:13
mveRichard MacCutchan24-Nov-22 22:13 
AnswerRe: How to iterate within a list in python? Pin
Gulshan Negi15-Mar-23 23:28
professionalGulshan Negi15-Mar-23 23:28 
QuestionPlz Help Trying to make driving game more realistic and fun (pygame) Pin
s897422-Nov-22 20:41
s897422-Nov-22 20:41 
AnswerRe: Plz Help Trying to make driving game more realistic and fun (pygame) Pin
Gulshan Negi14-Feb-23 21:34
professionalGulshan Negi14-Feb-23 21:34 
QuestionPython Code Related Pin
Mr.Zeenore18-Nov-22 12:28
Mr.Zeenore18-Nov-22 12:28 
AnswerRe: Python Code Related Pin
Dave Kreskowiak18-Nov-22 17:55
mveDave Kreskowiak18-Nov-22 17:55 
GeneralRe: Python Project Question Pin
Mr.Zeenore18-Nov-22 21:36
Mr.Zeenore18-Nov-22 21:36 
AnswerRe: Python Project Question Pin
OriginalGriff18-Nov-22 21:36
mveOriginalGriff18-Nov-22 21:36 
GeneralRe: Python Project Question Pin
Craig Robbins7-Dec-22 1:06
Craig Robbins7-Dec-22 1:06 
GeneralRe: Python Project Question Pin
trønderen7-Dec-22 3:04
trønderen7-Dec-22 3:04 
GeneralRe: Python Code Related Pin
Mr.Zeenore18-Nov-22 20:09
Mr.Zeenore18-Nov-22 20:09 
GeneralRe: Python Code Related Pin
Dave Kreskowiak19-Nov-22 4:07
mveDave Kreskowiak19-Nov-22 4:07 
AnswerRe: Python Code Related Pin
Richard MacCutchan18-Nov-22 22:35
mveRichard MacCutchan18-Nov-22 22:35 
QuestionPython vs. PHP - Web Application Development Pin
vitaassure15-Nov-22 10:30
professionalvitaassure15-Nov-22 10:30 
AnswerRe: Python vs. PHP - Web Application Development Pin
Gerry Schmitz15-Nov-22 12:11
mveGerry Schmitz15-Nov-22 12:11 
AnswerRe: Python vs. PHP - Web Application Development Pin
Richard MacCutchan15-Nov-22 21:34
mveRichard MacCutchan15-Nov-22 21:34 
QuestionPython code Pin
Masande Nogemane3-Nov-22 6:34
Masande Nogemane3-Nov-22 6:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.