コード例 #1
0
def keep():
	print('')
	keep_p = input('Would you like to keep playing? (Y/N) ')
	if keep_p == 'Y' or keep_p == 'y' or keep_p == 's':
		do('cd /home/diogo/Documents; python3 blackjack_game.py')
	else:
		do('clear')
		exit()
コード例 #2
0
ファイル: install.py プロジェクト: jessebmiller/lnk
from os import system as do
do("cp ./lnk /usr/bin/lnk")
コード例 #3
0
ファイル: ID3parser.py プロジェクト: RoguePixel/FDorganizer
def metadata(path,dest):
    if 'v' in flag():
        do('ls ' + str(path))
    do('mkdir ' + str(dest) + '/test')
コード例 #4
0
scoreA2 = 1
scoreF = 1
score10 = 10
score9 = 9
score8 = 8
score7 = 7
score6 = 6
score5 = 5
score4 = 4
score3 = 3
score2 = 2
ncards = 0

random.shuffle(cards)

do('clear')
print('')
print('╔╗ ┬  ┌─┐┌─┐┬┌─ ╦┌─┐┌─┐┬┌─')
print('╠╩╗│  ├─┤│  ├┴┐ ║├─┤│  ├┴┐')
print('╚═╝┴─┘┴ ┴└─┘┴ ┴╚╝┴ ┴└─┘┴ ┴')

def show_house():	
	global cards
	global cards_ingame
	global cards_house
	global score_house
	global scoreA
	global scoreA2
	global scoreF
	global score10
	global score9
コード例 #5
0
ファイル: install.py プロジェクト: oksome/Crane-Old
#!/usr/bin/env python2

import glob
from os import system as do

def list_packages(apt_file):
    pkg_names = []
    for line in open(apt_file).readlines():
        line = line.strip()
        name = line.split('#', 1)[0]
        if name:
            pkg_names.append(name)
    return pkg_names

for apt_file in glob.glob('apt/*.txt'):
    if raw_input("Install packages from '{}' ? [y/N] ".format(apt_file)) in ('y', 'Y'):
        pkg_names = list_packages(apt_file)
        do("apt-get install {}".format(' '.join(pkg_names)))
コード例 #6
0
from os import system as do

do('pip3 install -Uq pyautogui')

from sys import argv
from pathlib import Path as path
from pyautogui import typewrite, hotkey
import pyautogui as coder
from random import randint
from time import sleep


def get_code() -> list:

    argv_file = path(path(argv[1]).stem + '.py')
    if argv_file.exists():
        with open(str(argv_file)) as f:
            code = f.readlines()
        return code
    print('Sorry, that file does not exist')


def open_editor(directory: str, editor='vim', wait_time=1.8) -> None:
    '''
    param directory: The directory to store the copied code

    param editor: The text editor of choice to use

    param wait_time: The time in seconds to wait for the text editor to open
    '''
コード例 #7
0
ファイル: pyUpdate.py プロジェクト: hyperdriveguy/pyUpdate
# define how to get config
def getConfig(filename):
    import imp
    f = open(filename)
    global data
    data = imp.load_source('data', '', f)
    f.close()

# path to "config" file
getConfig('/home/carson/.pyUpdate/updaterConfig.txt')

if data.autoCache == 0:
    while not upCache == "y" or not upCache == "n":
        upCache = input("Update cache? (Recommended) y/n")
    if upCache == "y":
        do("clear")
        do("sudo apt-get update")
    if upCache == "n":
        print("Not updating cache")
        sleep(3)

if data.autoCache == 1:
    do("clear")
    do("sudo apt-get update --force-yes")

if data.autoUpdate == 0:
    while not upSys == "y" or not upSys == "n":
        upSys = input("Update system? (Recommended) y/n")
    if upSys == "y":
        do("clear")
        do("sudo apt-get upgrade --force-yes")