chevron_left chevron_right
Login Register invert_colors photo_library


Stay updated and chat with others! - Join the Discord!
Thread Rating:
  • 0 Vote(s) - 0 Average


My first Program filter_list
Author
Message
My first Program #1
Here is my First Program.

Basically all it does it Shuffles a deck of cards, an easy beginner program. any suggestions on how I could improve it?

Thanks to @Ex094 for his awesome beginners Python tutorial!

source included.

Code:
#Program created by Root@LocalHost
#Thanks to Exo94 for his awesome python help
#This program will shuffle a deck of cards


import itertools, random

#here is the deck of cards, Call them whatever you like.
deck = list(itertools.product(range(1,14), ['spade', 'heart', 'diamond', 'club']))

#this bit will shuffle the deck of cards
random.shuffle(deck)

#This will draw(how many cards you like)
print('You got:')
for i in range(3):
    print(deck[i][0], "of", deck[i][1])
(This post was last modified: 06-18-2014, 02:46 PM by logitech.)







Reply

RE: My first Program #2
Glad to see you are making progress Smile Hook me up with a PM if ya need any further help..
My Blog: http://www.procurity.wordpress.com
Donations: 1HLjiSbnWMpeQU46eUVCrYdbkrtduX7snG

Reply

RE: My first Program #3
(06-18-2014, 03:04 PM)Ex094 Wrote: Glad to see you are making progress Smile Hook me up with a PM if ya need any further help..

Do you any ideas on how I can take this project a step further? As at the moment it is very dull and thank-you Confusedmile:
(This post was last modified: 06-18-2014, 03:06 PM by logitech.)







Reply

RE: My first Program #4
(06-18-2014, 03:05 PM)root@localhost Wrote:
(06-18-2014, 03:04 PM)Ex094 Wrote: Glad to see you are making progress Smile Hook me up with a PM if ya need any further help..

Do you any ideas on how I can take this project a step further? As at the moment it is very dull and thank-you Confusedmile:

I can't give you any tips on this small script since it's operation is limited but you can make a card game
My Blog: http://www.procurity.wordpress.com
Donations: 1HLjiSbnWMpeQU46eUVCrYdbkrtduX7snG

Reply

RE: My first Program #5
(06-18-2014, 03:14 PM)Ex094 Wrote:
(06-18-2014, 03:05 PM)root@localhost Wrote:
(06-18-2014, 03:04 PM)Ex094 Wrote: Glad to see you are making progress Smile Hook me up with a PM if ya need any further help..

Do you any ideas on how I can take this project a step further? As at the moment it is very dull and thank-you Confusedmile:

I can't give you any tips on this small script since it's operation is limited but you can make a card game

Since python supports sockets I am going to attempt to create a tiny port scanner Confusedmile: I was wondering if you could create me some text art for it?







Reply

RE: My first Program #6
Text art, for a port scanner? I'd put more focus into the actual functioning of your project, than the interface Wink

A port scanner is a simple task, I did it in less than 60 lines of code, with error handling. Let me know if you hit any walls.

Reply

RE: My first Program #7
(06-18-2014, 03:26 PM)root@localhost Wrote:
(06-18-2014, 03:14 PM)Ex094 Wrote:
(06-18-2014, 03:05 PM)root@localhost Wrote:
(06-18-2014, 03:04 PM)Ex094 Wrote: Glad to see you are making progress Smile Hook me up with a PM if ya need any further help..

Do you any ideas on how I can take this project a step further? As at the moment it is very dull and thank-you Confusedmile:

I can't give you any tips on this small script since it's operation is limited but you can make a card game

Since python supports sockets I am going to attempt to create a tiny port scanner Confusedmile: I was wondering if you could create me some text art for it?

I don't wanna discourage you but there are lots of port scanners out there, Be Creative and think out of the box Smile I am not saying don't make it, just saying that use your imagination and create something better. If you like PM me and I'll give you some heads up
My Blog: http://www.procurity.wordpress.com
Donations: 1HLjiSbnWMpeQU46eUVCrYdbkrtduX7snG

Reply

RE: My first Program #8
(06-18-2014, 03:33 PM)Anima Templi Wrote: Text art, for a port scanner? I'd put more focus into the actual functioning of your project, than the interface Wink

A port scanner is a simple task, I did it in less than 60 lines of code, with error handling. Let me know if you hit any walls.

Thanks man!







Reply

RE: My first Program #9
This is a version of your program with a prettier print out Biggrin
Check it out..

Code:
import itertools, random

#here is the deck of cards, Call them whatever you like.
deck = list(itertools.product(range(1,14), ['spade', 'heart', 'diamond', 'club']))

#this bit will shuffle the deck of cards
random.shuffle(deck)

#This will draw(how many cards you like)
print('You got:')
for i in range(3):
    print("{:<2} {:<2} {:<10}".format(str(deck[i][0]),"of",str(deck[i][1])))

(06-18-2014, 03:33 PM)Anima Templi Wrote: Text art, for a port scanner? I'd put more focus into the actual functioning of your project, than the interface Wink

A port scanner is a simple task, I did it in less than 60 lines of code, with error handling. Let me know if you hit any walls.

You used python-nmap library to do it dude or just with the socket module?
(This post was last modified: 06-20-2014, 10:18 AM by krozz.)
MASTERING OTHERS IS STRENGTH, MASTERING YOURSELF IS TRUE POWER.

[Image: qJweLN6.jpg]

Reply

RE: My first Program #10
I used sockets.

Reply






Users browsing this thread: 1 Guest(s)