PyQt4 and Windows7 64bit Error

I've decided to use PyQt which is more attractive Graphical User Interface (GUI) than Tkinter. I downloaded the setup file from official site, and started to install PyQt4. My all attempts were unsuccesful with ridiculous error messages. "Required Python version 2.6 did not installed on your computer" was written as an error code.

On the internet i've checked that error code and, i found this mail list. Somebody faced the same problem and he or she stoped working with PyQt beacuse of same silly problem.

I've changed the PATH, uninstalled and re-installed the PyQt again and again, but nothing was changed. At the end i've removed the Python2.6.4 (64bit) and instead of 64bit i've downloaded and installed Python2.6.4(32bit). After this substitution everything is working properly now.

If you have 64bit Windows and 64bit Python too and also use PyQt, please explain me your solution.



Caesar Cipher

Everyone knows Caesar Cipher in crypthography. There is a source word and on the other hand there is a step number. According to this step number, all letters in a word are shifted.

As a source word we have a "python", and our step number is 1(one), according these datas our crypted data is "qzuipo". "p" letter shifted to "q", "y" letter shifted to "z" etc.

For practicing i tried to write basic script about Caesar Cipher, and a few minutes ago i completed it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python
# -*- coding: utf8 -*-
class cryptor:
    
    def find_index(self,parameter):
        self.tuple1="a","b","c","d","e","f","g","h","i","j","k","l","m",\
                "n","o","p","q","r","s","t","u","v","w","x","y","z"," "
        return self.tuple1.index(parameter)
    
    def crypt_word(self,word,step):
        array=[]
        for i in word:
            array.append(crypt.find_index(i))
        word=""
        for i in array:
            word=word+self.tuple1[(i+step) % 27]
        return word
        
 
crypt=cryptor()

According to my script, you can both crypt and decrypt words via same function.

Examples:

1
2
3
4
5
6
7
IDLE 2.6.5      ==== No Subprocess ====
>>> 
>>> crypt.crypt_word("titus",12)
'euefd'
>>> crypt.crypt_word("euefd",-12)
'titus'
>>>

After making some optimizing to this script, you can send secure text files to others :)

 



Just Landed

I've just landed to this site. I'm gonna share my all advantures about Python.

See you again next time. ;)




Copyright(c) 2017 - PythonBlogs.com
By using this website, you signify your acceptance of Terms and Conditions and Privacy Policy
All rights reserved