Re: Unlimited canvas painting program

2013-10-24 Thread markotaht
So, i`ll take the canvas, somekind of mouse tracker, for each mouse location il draw a dot or 2X2 square or something. Main thing i have never understood, is how can i get the backround to move. Lets say ia hve 200X200 window. In the middle of it is the cursor that draws. If i move the mouse t

Unlimited canvas painting program

2013-10-24 Thread markotaht
How to create a program similar to paint, but the difference would be that the cursor would be always in the middle and the canvas moves or the camera is always fixed on the cursor as it moves around the canvas. And the canvas should be infinite. What would be reasonable to use? In addition, i

Re: class implementation

2013-10-10 Thread markotaht
kolmapäev, 9. oktoober 2013 2:55.28 UTC+3 kirjutas Cameron Simpson: > On 08Oct2013 01:20, wrote: > > > I cant just subclassing doesent work. It seem the init method of the source > > class also calls out another class. And the problem is, i can subclass the > > other class to with the required

Re: öpcaö variable refrenced before assignment

2013-10-09 Thread markotaht
So i got it working, by saving palgad in a variable, before printing it and i count the lines into a global variable. Ty -- https://mail.python.org/mailman/listinfo/python-list

öpcaö variable refrenced before assignment

2013-10-09 Thread markotaht
fail4 = "palgad.txt" f4 = open(fail4, "r") def koguarv_ridu failis(f): for i, l in enumerate(f): pass return i+1 def palgad(f4): palgad = 0 while True: f4r = f4.readline() if f4r == "": break palgad += int(f4r[f4r.find(";")+1:]) ret

Pygame with python 3.3.2

2013-10-09 Thread markotaht
>From pygame tutorials i copied this example: import pygame class spritesheet(object): def __init__(self, filename): try: self.sheet = pygame.image.load(filename).convert() except pygame.error, message: print('Unable to load spritesheet image:', filenam

Re: Image manipulation

2013-10-08 Thread markotaht
I rembembered a bit too late, are there any good tutorials for Pillow? ImageTk.PhotoImage() keeps giving me error that there isnt such a method. -- https://mail.python.org/mailman/listinfo/python-list

Re: Image manipulation

2013-10-08 Thread markotaht
teisipäev, 8. oktoober 2013 17:26.33 UTC+3 kirjutas Steven D'Aprano: > On Tue, 08 Oct 2013 07:15:46 -0700, markotaht wrote: > > > > > First helpful advice i have gotten from this forum > > > > If you insist on dropping cryptic comments with bad spelling

Re: Image manipulation

2013-10-08 Thread markotaht
First helpful advice i have gotten from this forum -- https://mail.python.org/mailman/listinfo/python-list

Re: class implementation

2013-10-08 Thread markotaht
Parent class is at the link. -- https://mail.python.org/mailman/listinfo/python-list

Re: class implementation

2013-10-08 Thread markotaht
I cant just subclassing doesent work. It seem the init method of the source class also calls out another class. And the problem is, i can subclass the other class to with the required function but the end result is that it doesent work, since the source class cant accsess the subclass functions.

Re: HEX to ASCII

2013-10-08 Thread markotaht
esmaspäev, 7. oktoober 2013 17:16.29 UTC+3 kirjutas Mark Lawrence: > On 07/10/2013 14:54, markot...@gmail.com wrote: > > > I forgot to tell. The teisendaja module that i have imported, is a number > > converter that allow to convert numbers from one base to another. i mostly > > use it for HEX t

Re: HEX to ASCII

2013-10-08 Thread markotaht
esmaspäev, 7. oktoober 2013 18:52.21 UTC+3 kirjutas Piet van Oostrum: > markot...@gmail.com writes: > > > > > This is the code i came up with: > > > from teisendaja import * > > > from operator import * > > > import binascii > > > > > > teisendus = teisendus() > > > kood = input("Kood: ")

Re: HEX to ASCII

2013-10-07 Thread markotaht
I forgot to tell. The teisendaja module that i have imported, is a number converter that allow to convert numbers from one base to another. i mostly use it for HEX to BIN and vice versa, but it supports other bases too. -- https://mail.python.org/mailman/listinfo/python-list

Re: HEX to ASCII

2013-10-07 Thread markotaht
esmaspäev, 7. oktoober 2013 4:27.44 UTC+3 kirjutas Piet van Oostrum: > markot...@gmail.com writes: > > > > > problem is : Traceback (most recent call last): > > > File "C:\Users\Marko\Desktop\hacker.org\XOR cypher.py", line 35, in > > > > > print("Key-" + str(võti) + ": " + str("".j

HEX to ASCII

2013-10-06 Thread markotaht
problem is : Traceback (most recent call last): File "C:\Users\Marko\Desktop\hacker.org\XOR cypher.py", line 35, in print("Key-" + str(võti) + ": " + str("".join(tulemus2))) TypeError: sequence item 0: expected str instance, bytes found If i take away the join command i get this: Key

Re: Odd-length string

2013-10-06 Thread markotaht
I fixed this problem but encountered new problem. Problem was that some parts that came throug my decryption were 00 or 0 the first symbol so the program didnt show them. NEw problem is : Traceback (most recent call last): File "C:\Users\Marko\Desktop\hacker.org\XOR cypher.py", line 35, in

Re: Image manipulation

2013-10-06 Thread markotaht
Image consists of pixels. Each pixel has its RGBA values. In python whidout any extra downloadable modules, is there a way to get those values. I know PIG has it but i hav Python 3.3.2 so PIG wont do. In java under swingx there is a command called .getRGB() and whit some manipulation to that val

Re: class implementation

2013-10-06 Thread markotaht
There is this class file, it has its functions and variables. Now im greating my program, that uses the funcions from the class. BUt there are some functions missing from the class. So i want to add some extra funtions to the class, whidout altering the original source code, but by extending it

Odd-length string

2013-10-06 Thread markotaht
print("Key-" + str(võti) + ": " + str(unhexlify("".join(tulemus IM getting this error on this line. This is the print line of a decryption program. I wanti it to convert the tulemus which is in HEX to ASCII so i could read it. I could use online translators for the line, but since i have 255

Image manipulation

2013-10-04 Thread markotaht
Is there a way using the python 3.3.2 whidout any additional downloaded moduls, to get a pixels RGB value? -- https://mail.python.org/mailman/listinfo/python-list

Re: class implementation

2013-09-30 Thread markotaht
under variables, i mean, the int's and lists and strings and floats that the parent class uses. IF in parent class there is variable called location, then can i use the same variable in my sub class. -- https://mail.python.org/mailman/listinfo/python-list

Re: class implementation

2013-09-30 Thread markotaht
esmaspäev, 30. september 2013 11:43.19 UTC+3 kirjutas mark...@gmail.com: > Is there a way to give a class extra functions whidout editing the .py file > where the class is located? But does it have all the variables that the main class have? -- https://mail.python.org/mailman/listinfo/python-lis

class implementation

2013-09-30 Thread markotaht
Is there a way to give a class extra functions whidout editing the .py file where the class is located? -- https://mail.python.org/mailman/listinfo/python-list

card dealer

2013-09-27 Thread markotaht
from random import * from math import floor kaarte_alles = 52 kaart_tõmmatud = [False for i in range(52)] mast = ["ärtu", "ruutu", "poti", "risti"] aste = ["äss", "kaks", "kolm", "neli","viis", "kuus", \ "seitse", "kaheksa", "üheksa", "kümme", "soldat",\ "emand", "kuningas"] de