I tried to make a chess game with vb.net under visual studio 2013.
Info:
I wrote this application in vb.net. As you maybe can see the gui is dynamical generated. I use a lot of panels.
I just needed about 2000 rows for this result. There is one interface called Figure and all the others will extend it.
If you are interested in the source code:
https://github.com/marcin96/Marcins_Chess
If you have questions please write.
Maybe you wonder why I haven't used the standart MVC and didn't separate the model from the gui as usually. My intension wasn't to create a real chess app. I wanted to show how you can code an evealuating system for figures and their possible moves. As you can see I used the hole field as an Array and calculated then with with formules for each group of figures their possibilities at the play time.
Info:
A very basic application every programmer knows. Originally developed by a swiss student in the 20th century. I wrote it in java 8 under Netbeans with slick2D a child library of lightweight java game library.
Info:
When you develop a lot of python applications and you want that your next script is close sourced, then you are right with this article. I explain you have to compile a python application and generate a msi Windows installer. For that i use cx_Freeze.
Built Script:
company_name = 'Marcins Programms'
product_name = 'Sokrates'
bdist_msi_options = {
'upgrade_code': '{Banana-rama-30403344939493}',
'add_to_path': False,
'initial_target_dir': r'[ProgramFilesFolder]\%s\%s' % (company_name, product_name),
}
path = sys.path
build_exe_options = {
"path": path,
"icon": "brain.ico"}
base = None
if sys.platform == "win32":
base = "Win32GUI"
exe = Executable(script='Sokrates__PYMATH.py',
base=base,
icon='brain.ico',
)
setup( name = "Sokrates",
version = "1.1",
description = "Powerfull Calculator for all plattforms",
executables = [exe],
options = {'bdist_msi': bdist_msi_options})
run this script with a batch file:
py build.py build
py build.py bdist_msi
Info
This Little Script works with python 3.4 and Tkinter.
It is only 37 lines long, but very fast and has a small size.
Code:
from tkinter import *;turn=None
class pButton(Button):
def setty(self):self.state=None
def SET(self,what):
if what in("X","O"):
self.state=what
if what=="X":self.config(bg="light green")
else:self.config(bg="tomato")
self.config(text=self.state)
else:print("error")
class Main:
def __init__(self):
self.root=Tk();self.root.title("Tic Tac Toe");self.root.geometry("180x180")
self.b=[None,None,None,None,None,None,None,None,None,None]
column=0;row=1
for i in range(0,9):
self.b[i]=pButton(self.root,text="-")
self.b[i].setty()
self.b[i].grid(row=row,column=column,pady=5,padx=5)
self.b[i].config(width=5,height=2)
self.b[i].bind("",lambda event, arg=self.b[i]: self.push(event, arg))
column+=1
if column>2:column=0;row+=1
global turn;turn="X"
self.L=Label(self.root);self.L.grid(row=4,column=1);self.L.config(text="{Turn of X}")
self.root.mainloop()
def push(self,event,pButton):
global turn
if turn=="X":pButton.SET(turn);turn="O";self.L.config(text="Turn of O")
elif turn=="O":pButton.SET(turn);turn="X";self.L.config(text="Turn of X")
self.debug()
def debug(self):
for i in ("X","O"):
for x,y,z in [0,1,2],[3,4,5],[6,7,8],[0,3,6],[0,4,8],[2,4,6],[1,4,7],[2,5,8]:
if self.b[x].state==i and self.b[y].state==i and self.b[z].state==i:self.L.config(text=i+" wins"),self.L.config(bg="yellow")
else:pass
main=Main()
Info:
Everyone knows OpenGl lib. It's often in use with C. But you can also use it with python. Of course it's not the fastest possiblity, but you can do a lot of funny things together with python.
1.) Disable Icons 2.) Disable Visual Effects 3.) Clean your Pc with ccleaner 4.) Customize Autostart 5.) Defragment your hdd 6.) Customize Graphics 7.) Battery Settings on Laptop 8.) Update your drivers 9.)Set a low background 10.) Make a Partition for your Os with enaught memory and a data partition for Software ect.
Python has built in libraries for accessing pop imap or smtp:
import smtplib
From = 'test@python.com'
To = ["test@user.com"]
Subject = "Test_mail"
TEXT = "Hai"
message = "Hai"
server = smtplib.SMTP('myserver')
server.sendmail(FROM, TO, message)
server.quit()