2013-09-26 3 views
0
def main(): 
    print("Hello :") 
    myMessage=input("Enter The Code :") 
    myKey=int(input("Enter The Secret Key :")) 

    cipehertext=encryptMessage(myKey,myMessage) 


    # Print the encrypted string in ciphertext to the screen, with 
    # a | (called "pipe" character) after it in case there are spaces at 
    # the end of the encrypted message. 
    print(ciphertext+'|') 

    # Copy the encrypted string in ciphertext to the clipboard. 
    pyperclip.copy(ciphertext) 

     // There are more codes.... 
    # ......................................... 
     # Keep looping until pointer goes past the length of the message. 
     while pointer<len(message): 
     # Place the character at pointer in message at the end of the 
     # current column in the ciphertext list. 
      ciphertext[col]+=message[pointer] 

     #move pointer over 

     # Convert the ciphertext list into a single string value and return it. 
     return ''.join(ciphertext) 

    # If transpositionEncrypt.py is run (instead of imported as a module) call 
    # the main() function. 
    if __name__=="__main__": 
     main() 

У меня проблема с указанным выше кодом. Пожалуйста, помогите мне найти мою проблему.Основная функция, кажется, не работает в python

ответ

4

Ваш if __name__ заявление внутриmain функция, поэтому она никогда не будет выполнена. Удалите отступ.

Смежные вопросы