Skip to content

Instantly share code, notes, and snippets.

View FardinBehboudi's full-sized avatar

Fardin Behboudi FardinBehboudi

  • Berliin
View GitHub Profile
@FardinBehboudi
FardinBehboudi / mbox-jsonConvertor.py
Created April 11, 2017 15:44
this program will get the mbox file as imput and convert it to ordered json file.
# -*- coding: utf-8 -*-
import sys
import mailbox
import email
import quopri
import json
from bs4 import BeautifulSoup
MBOX = 'C:\Users\zzfbehb\Dropbox\Vodafone\Elastic\project files\MyFile.mbox'
@FardinBehboudi
FardinBehboudi / adventure_game.py
Created March 31, 2017 09:22
TextBaset Advanture Game in python
# TextBaset Advanture Game
import random
print 'lets start the text based advanture game '
def msg(room):
if room['msg'] == '':
return 'you have entered to : ' + room['name']
else:
return room['msg']
@FardinBehboudi
FardinBehboudi / guess_number.py
Created March 31, 2017 09:20
computer chooses a number between 1 and 100 randomly and you have to guess it. Python
#in this game computer choses a number between 1 and 100 randomly and you have to guess it
import random
def is_valid_num(s):
if s.isdigit() and 1 <= int(s) <= 100:
return True
else:
return False;
@FardinBehboudi
FardinBehboudi / hangman.py
Created March 31, 2017 09:17
Hangman game in Python
# hangman
# in this application i have a list of predifined words. each time user has to guess a word considering its length and shown like password.
# user has to choose letter by letter. cant have duplicate letter. we counte the steps.
import random
from pip._vendor.html5lib._ihatexml import letter
def get_word():
words = ['choose','list','iran','behboudi','italia','instagram','facebook','war','likeit','motivation','crazy','dirty','love','hate','trump','who','mom','water','torta','kill','no','fardin']
return random.choice(words).upper()
@FardinBehboudi
FardinBehboudi / board.py
Last active March 31, 2017 09:11
This code will drow a N*M board on Screen Python
# this program Draws a board in screen
from operator import index
def ho_line(boardsize_ho, boardsize_vo):
print " --- " * boardsize_ho * (boardsize_vo +1)
def ve_lone(boardsize_ho, boardsize_vo):
print '| ' * (boardsize_ho + 1) * boardsize_vo
def main():
boardsize_ho = int(raw_input('please enter the board horzintal size: '))