Python Forum
My .exe made using Python being detected as a virus
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My .exe made using Python being detected as a virus
#1
I am currently trying to make simple code that misspells a word and copies it to your clipboard but when I share it to another computer it is detected by antivirus as a trojan. Is there anything I can do to prevent this from happening?
Here is my code:

import random
import pyperclip

filler = []
valid = False


def charGen(x):
    if x == 6:
        return "b"
    elif x == 5:
        return "a"
    elif x == 4:
        return "n"
    elif x == 3:
        return "a"
    elif x == 2:
        return "n"
    elif x == 1:
        return "a"


while not valid:
    word = "b"
    filler = []

    length = random.randint(3, 7)

    word = word + charGen((random.choice([4, 5])))

    for a in range(length):
        filler.append(charGen(random.randint(1, 6)))
        word += filler[a]

    word = word + "a"

    if word.find('n') >= 0:
        print(word)
        valid = True

    for b in range(len(word)-1):
        if word[b] == word [b+1]:
            valid = False
pyperclip.copy(word)
(tbh, the reason the charGen function has so many repeating words is because it was originally intended for another word)
Reply
#2
you can simplify charGen:
def charGen(x):
    ret="banana"
    if x > 0 and x < len(ret)+1:
        return ret[x-1]

print(charGen(5))
print(charGen(2))
print(charGen(7))
print(charGen(0))
Output:
n a None None
Reply
#3
https://python-forum.io/thread-32589-pos...#pid137771
https://python-forum.io/thread-26282-pos...#pid112274
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  python not detected on computer adriennn 3 933 Nov-18-2023, 02:46 PM
Last Post: snippsat
  python --version yields no output, not detected by other programs ten 3 3,421 Jun-25-2020, 04:48 AM
Last Post: perfringo
  Executable looks like virus to windows samuelbachorik 4 3,011 Apr-27-2020, 02:46 PM
Last Post: samuelbachorik
  How can I make this Python script add a limit to trades made with API? streetlaw 0 2,007 Oct-12-2018, 11:41 AM
Last Post: streetlaw
  Python files made on linux don't work on windows sylas 2 3,242 Oct-10-2018, 05:34 AM
Last Post: sylas
  Simple Python Virus microwavedelf 4 10,260 Sep-14-2018, 09:50 PM
Last Post: EhsojSide
  Go to line starting with and variable not detected morgandebray 5 3,312 Aug-09-2018, 09:00 AM
Last Post: morgandebray
  "Widget Javascript not detected" error BobLoblaw 0 4,297 Oct-07-2017, 04:48 PM
Last Post: BobLoblaw
  Object Detection that records the number of secs the face is not detected trabis03 1 2,542 Jul-21-2017, 04:14 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020