my first python project, with the help of google
it's a simple gui calculator but i am happy the way it turned out, any constructive criticism is very much appreciated
`from tkinter import *`
`import tkinter.font as tkFont`
`root=Tk();`
`fontStyle = tkFont.Font(size=20)`
`def clear():`
`numberEnter.delete(0,END)`
`def numberInput(number):`
`currentNumber=numberEnter.get()`
`numberEnter.delete(0, END)`
`numberEnter.insert(0, str(currentNumber)+str(number))`
`def clear():`
`numberEnter.delete(0,END)`
`def addition():`
`firstNumber=numberEnter.get()`
`global Number;`
`global operator;`
`operator ="+"`
`Number = int(firstNumber);`
`numberEnter.delete(0, END)`
`def subtraction():`
`firstNumber=numberEnter.get()`
`global Number;`
`global operator;`
`operator ="-"`
`Number = int(firstNumber);`
`numberEnter.delete(0, END)`
`def multiplication():`
`firstNumber=numberEnter.get()`
`global Number;`
`global operator;`
`operator ="*"`
`Number = int(firstNumber);`
`numberEnter.delete(0, END)`
`def division():`
`firstNumber=numberEnter.get()`
`global Number;`
`global operator;`
`operator ="/"`
`Number = int(firstNumber);`
`numberEnter.delete(0, END)`
`def buttonEqual():`
`secondNumber=numberEnter.get()`
`numberEnter.delete(0, END)`
`if operator == "+":`
`numberEnter.insert(0,Number + int(secondNumber))`
`if(operator=="-"):`
`numberEnter.insert(0,Number - int(secondNumber))`
`if(operator=="*"):`
`numberEnter.insert(0,Number * int(secondNumber))`
`if(operator=="/"):`
`numberEnter.insert(0,Number / int(secondNumber))`
`#UI`
`#=======================================================================`
`# CREATING TEXT FIELD`
`# text
/r/Python
https://redd.it/k2hj65
it's a simple gui calculator but i am happy the way it turned out, any constructive criticism is very much appreciated
`from tkinter import *`
`import tkinter.font as tkFont`
`root=Tk();`
`fontStyle = tkFont.Font(size=20)`
`def clear():`
`numberEnter.delete(0,END)`
`def numberInput(number):`
`currentNumber=numberEnter.get()`
`numberEnter.delete(0, END)`
`numberEnter.insert(0, str(currentNumber)+str(number))`
`def clear():`
`numberEnter.delete(0,END)`
`def addition():`
`firstNumber=numberEnter.get()`
`global Number;`
`global operator;`
`operator ="+"`
`Number = int(firstNumber);`
`numberEnter.delete(0, END)`
`def subtraction():`
`firstNumber=numberEnter.get()`
`global Number;`
`global operator;`
`operator ="-"`
`Number = int(firstNumber);`
`numberEnter.delete(0, END)`
`def multiplication():`
`firstNumber=numberEnter.get()`
`global Number;`
`global operator;`
`operator ="*"`
`Number = int(firstNumber);`
`numberEnter.delete(0, END)`
`def division():`
`firstNumber=numberEnter.get()`
`global Number;`
`global operator;`
`operator ="/"`
`Number = int(firstNumber);`
`numberEnter.delete(0, END)`
`def buttonEqual():`
`secondNumber=numberEnter.get()`
`numberEnter.delete(0, END)`
`if operator == "+":`
`numberEnter.insert(0,Number + int(secondNumber))`
`if(operator=="-"):`
`numberEnter.insert(0,Number - int(secondNumber))`
`if(operator=="*"):`
`numberEnter.insert(0,Number * int(secondNumber))`
`if(operator=="/"):`
`numberEnter.insert(0,Number / int(secondNumber))`
`#UI`
`#=======================================================================`
`# CREATING TEXT FIELD`
`# text
/r/Python
https://redd.it/k2hj65
reddit
my first python project, with the help of google
Posted in r/Python by u/Amin_Abdul_Awal • 89 points and 31 comments
I created a playground to my python UI framework DARS
I'm excited to share the new Dars Playground! I have been working on this project for a long time now and I am expanding its ecosystem as much as I can. Now I have just launched a playground so that everyone can try Dars on the web without installing anything, just reading a little documentation and using bases from other frameworks. The next step will be to implement a VDom (virtual dom) option to the framework itself and a signals (hooks) system, all of this optional for those who want to use the virtual dom and those who do not, so use the export or hot reload that is already integrated.
The playground allows you to experiment with Dars UI code and preview the results instantly in your browser. It's a great way to learn, prototype, and see how Dars turns your Python code into static HTML/CSS/JS.
Key Features:
• Write Dars Python code directly in the editor.
• Instant preview with a single click (or Ctrl + Enter).
• Ideal for experimenting and building UI quickly.
Give it a try and tell me what you think!
Link to Playground: https://dars-playground.vercel.app
Dars GitHub repository: https://github.com/ZtaMDev/Dars-Framework
#Python #UI #WebDevelopment #DarsFramework
/r/Python
https://redd.it/1n69tas
I'm excited to share the new Dars Playground! I have been working on this project for a long time now and I am expanding its ecosystem as much as I can. Now I have just launched a playground so that everyone can try Dars on the web without installing anything, just reading a little documentation and using bases from other frameworks. The next step will be to implement a VDom (virtual dom) option to the framework itself and a signals (hooks) system, all of this optional for those who want to use the virtual dom and those who do not, so use the export or hot reload that is already integrated.
The playground allows you to experiment with Dars UI code and preview the results instantly in your browser. It's a great way to learn, prototype, and see how Dars turns your Python code into static HTML/CSS/JS.
Key Features:
• Write Dars Python code directly in the editor.
• Instant preview with a single click (or Ctrl + Enter).
• Ideal for experimenting and building UI quickly.
Give it a try and tell me what you think!
Link to Playground: https://dars-playground.vercel.app
Dars GitHub repository: https://github.com/ZtaMDev/Dars-Framework
#Python #UI #WebDevelopment #DarsFramework
/r/Python
https://redd.it/1n69tas