How make calculator in python We make a calculator in python using kivy module . Kivy module helps us to make android apps . First wait , If you run a kivy program in your terminal then you see a error like this To solve this problem you have to go kivy docs and follow the instruction of kivy docs. First we have to make a virtual environment and then in the virtual environment you have to install kivy . After that you have to write kivy_venv\Scripts\activate in your terminal and then run the file . If this method not work then write the comment below. LETS START CODING First we import kivy .For this we hve to write from kivy.app import App from kivy.uix.label import Label from kivy.uix.button import Button from kivy.core.window import Window from kivy.uix.gridlayout import GridLayout from kivy.uix.widget import Widget from kivy.lang import ...
How to make 3d model of Earth in panda 3d
We make 3d Earth model with help of panda 3d . Panda 3d is a module which is use to make 3d games .
To make 3d Earth model we have to write some lines of code.
LETS START CODING
import panda 3d
We need to import ShoeBase from the panda 3d module. For this we have to write from direct.showbase.ShowBase import ShowBase
After this we have to make class which inherit from ShowBase class . After making class we have to make constructor .
Loading the texture and model
After doing this we have to load texture and earth model .For this we have to write self.tex=self.loader.loadTexture("world.jpg")
self.earth=self.loader.loadModel("models/earth")
self.earth.setTexture(self.tex)
self.earth.setScale(5,5,5)
self.earth.reparentTo(self.render)
After doing this we have to make two variables self.angle=0
self.speed=2
After load model and texture of earth we have to make a function which rotates earth on its axis
for this we have to write def update(self,task):
ft= globalClock.getFrameTime()
self.earth.setH(self.angle)
self.angle += self.speed * 1
return task.cont
After making the class we have to make object of class and run the program. For this we have to write
earth=earth()
earth.run()
HERE ARE THE CODE
OUTPUT