- Oct 24, 2011
- 3,219
- 3,625
Wasn't able to post code here, so now trying with an image.I made a few beginner's attempts at making a few python scripts that could make a few bucks at least per run. My codes don't look pretty, some of my variables and prompts are profane, and you pros out there might go roflwtf, but I hope to be able to fix all of that and code like a pro soon enough.
You need a local python environment if you don't have it already. There is IDLE, and theres PyCharm CE that you can install after installing IDLE. I like TextEdit on Ubuntu and the shell for execution. Suit yourself.
I have also put up this thread where fellow members tell me what they need and I code it up for them. I am making this thread to post those working scripts that everyone can use. Thought I'd start off first by posting what I have done so far, which would start from my 2nd post.
Before we get to the moneymakers, I'd like to show off a few scripts that I felt so proud of.
Here is a password generator to start with
Python:import random letters = ['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', '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'] numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] symbols = ['!', '#', '$', '%', '&', '(', ')', '*', '+'] ln=5 nn=4 sn=3 password=[] for i in range(0,ln): password+=letters[random.randint(0,len(letters)-1)] for i in range(0, nn): password+=numbers[random.randint(0,len(numbers)-1)] for i in range(0, sn): password+=symbols[random.randint(0,len(symbols)-1)] random.shuffle(password) pw='' for char in password: pw+=char print(f'Password: {pw}')
The Lucas Lehmer method of finding Mersenne Prime, without which the SSLs don't work. Got the method from this video
Python:import time i = 4 l = 1 start_time = time.time() n=int(input('n = ')) pn = (2 ** n) - 1 if pn % 2 == 0: print(f'{pn} is a fucking even number') else: print(f"the number you're solving for is {pn}\nCalculating...") while i < pn: i = (i ** 2) - 2 l += 1 print(l, 'loop 1 ') i = i % pn while l < n - 1: i = (i ** 2) - 2 i = i % pn l += 1 print(l, 'loop2 ') if (i % (pn)) == 0: print(f'2^{n} - 1 is a prime') print("--- %s seconds ---" % (time.time() - start_time)) else: print(f'2^{n} - 1 isnt a prime') print("--- %s seconds ---" % (time.time() - start_time))

You've got pretty cool code there. I like it, so I played around with it for a few minutes and made it so you don't have to type out all those letters and characters manually.