+ 1

Can someone please help me with imports and modules and actually being able to use a function in a module?

So I'm trying to learn how to use modules once I have imported them. I'm not trying to use an built in module because those are pretty self explanatory. The one I want to use is through qpython on my android and they offer a module called androidhelper that let's you do all kinds of cool things like take a picture, use text to speech, create your own pop ups, and other things. I have been trying to use these but cant figure out how to write the code to actually accomplish it. For example. The one I want to use is call batteryGetLevel and it checks the battery percentage... this is the documentation: batteryGetLevel self batteryGetLevel(self) Returns the most recently received battery level (percentage). Min SDK level=5 So how do I actually write the code to output it? I tried: Import androidhelper Droid = androidhelper.Android Droid.batteryGetLevel().result And nothing really works and I'm kind of confused just on the fundamentals of using something like this... How do I call a method with (self)?

27th Jun 2019, 7:17 PM
Dylan Campbell
Dylan Campbell - avatar
2 Antworten
+ 2
Lothar It did! Thank you!!!
27th Jun 2019, 8:13 PM
Dylan Campbell
Dylan Campbell - avatar