gagebenne/pydexcom

integer error

Closed this issue · 10 comments

got this error

SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers

Could you please provide more context for this error? The code specifically being ran.

Heya, did not expect an answer this fast.

I just copied your complete code into Visual Studio and was trying to run it inside of it. I’ve added the correct credentials of my girlfriend but nothing seems to work.

Seems like the integer error comes from the date which has “08” and “07”. When I delete it I come back to my main problem which is only giving me “invalid Syntax”

Is this code even usable fully on desktop ? I was hoping for creating her a app for pc.

Sharing is enabled on dexcom clarity, she also has 2 followers (me and her mother)

Could you clarify when you are using a date?

from pydexcom import Dexcom
dexcom = Dexcom("username", "password")
glucose_reading = dexcom.get_current_glucose_reading()
print(glucose_reading)
>>> print(bg.datetime)
2023-08-07 20:40:58

I just fully copied your code from GitHub

So, I've been testing a pre-release of pydexcom for a little while now (0.3.0a0). I just released it fully now (0.3.0) a few moments ago. Go ahead and install the latest, and let me know if the error persists.

Here's what I have:

>>> glucose_reading = dexcom.get_current_glucose_reading()
>>> glucose_reading.value
101
>>> glucose_reading.datetime
datetime.datetime(2023, 9, 6, 17, 1, 46)
>>> print(glucose_reading.datetime)
2023-09-06 17:01:46

still getting either

line 26
    2023-08-07 20:40:58
         ^
SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers

when the date is in the code or when i delete it i get this

line 1
    >>> from pydexcom import Dexcom
    ^^
SyntaxError: invalid syntax
>>> from pydexcom import Dexcom
>>> dexcom = Dexcom("***", "***",ous=True) # add ous=True if outside of US
>>> glucose_reading = dexcom.get_current_glucose_reading()
>>> print(glucose_reading)


>>> glucose_reading.value


>>> glucose_reading.mmol_l


>>> glucose_reading.trend


>>> glucose_reading.trend_direction


>>> glucose_reading.trend_description


>>> glucose_reading.trend_arrow


>>> print(bg.datetime)

>>> glucose_reading.json




i did a uninstall pydexcom and a fresh install

The >>> is not valid Python code -- invalid syntax. When using Python interpreter, the >>> indicates the prompt of the interactive Python interpreter, meaning that the interpreter is ready to receive Python statements typed in.

The README provides example code as input into the Python interpreter, where lines without the >>> are output, lines with are Python statements typed in.

Remove the >>>.

ok we're getting closer. its working now but only when i delete the ```
print(bg.datetime)
2023-08-07 20:40:58


with print(bg.datetime) im getting the integer error