attrib -H -S Z:\* /S /D
- - #Clear attribute
- H #Hidden file attribute
- S #Show system file attribute
- /S #Matching file in the curent and subdirectory
- /D #Process folder as well
# -*- coding: utf-8 -*-
from PIL import Image, ImageFilter, os
format = ["jpg", "JPEG", "jpeg", "png"]
size = (128, 128)
try:
for root,dirname,filename in os.walk("d:\\snimki"):
for file in filename:
if file.endswith(tuple([x for x in format])):
im = Image.open(os.path.join(root,file))
print "Original Picture %s is in format %s and mode is %s " % (file, im.size, im.mode)
im.thumbnail(size)
im.save(os.path.join(root,"new"+file))
except:
print "Somthing wrong has with script"
#!/bin/bash
#In variable filename save result for find
filename="result.txt"
#use find command for search for file +1G search for file gt 1G
find /home/borko/ -maxdepth 6 -type f -name *.avi -size +1G > $filename &&
#If not result save data in file
if [ $? -ne 0 ]
then
date >> $filename
fi
#Function read line by line and play with vlc
while read line
do
name=$line
echo "Played - $line"
vlc "$name"
kill -9 vlc
done < $filename
#If you not use file do this in same line for play mp3 file:
find /home/borko/ -maxdepth 6 -type f -name *.mp3 -size -exec vlc {} \;
#This is a little function
mp3(){
cd "/home/borko/Музика/"
o=$IFS
IFS=$(echo -n "\n\b")
find -type f -name "*.mp3" -print0 | while read -d $'\0' name
do
`vlc $name`
done
IFS=o
}
import operator
def fff(number):
se = [number]
while number > 1:
number = 3*number+1 if number%2 else number/2
se.append(number)
return sum(se)
result={}
for i in range(1,20):
result[i]=fff(i)
print max(result.items(), key=operator.itemgetter(1))
# -*- coding: utf-8 -*-
import time,datetime
chainese = ['monkey','rooster','dog','pig','rat','ox','tiger','rabbit','dragon','snake','horse','sheep']
zodia = {
'aries': ['3 21', '4 20'],
'taurus' : ['4 21' , '5 20'],
'gemini' : ['5 21' , '6 20'],
'cancer' : ['6 21' , '7 22'],
'leo' : ['7 23' , '8 22'],
'virgo' : ['8 23' , '9 22'],
'libra' : ['9 23' , '10 22'],
'scorpio' : ['10 23' , '11 21'],
'sagittarius' : ['11 22' , '12 21'],
'capricorn' : ['12 22' , '1 20'],
'aquarius' : ['1 21' , '2 19'],
'pisces' : ['2 19' , '3 20']
}
def check_zodia(month,day):
"""Check zodia use dictioanry zodia"""
for i in zip(zodia.keys(),zodia.values()):
if tuple(map(int, [x for x in [i[1][0]]][0].split())) < (month, day) < tuple(map(int,[x for x in [i[1][1]]][0].split())):
print "Your Zodia is %s" % i[0].title()
def check_china_zodia(year):
"""Check China Zodia sign"""
check_china_zodia = int(year%12)
print "In Chaina calendar you'r zodia is : %s" % chainese[check_china_zodia].title()
if __name__ == "__main__":
value = raw_input("Enter day/month/year of Birth :")
result = map(int, value.split("/"))
day=result[0]
month=result[1]
year=result[2]
check_zodia(month,day)
print "\n"
check_china_zodia(year)
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 18 10:24:56 2014
@author: borko-8.1
"""
import platform
import os
print "---------------Radio Station's----------------"
trance={u'Трансе FM': 'http://listen.trance.fm/1/320', u'Elit trance music': 'http://www.slusham.com/radio/fmplus.m3u', u'Elit houce music': 'http://eilo.org:8000/house.m3u'}
bgradio={u'Energy':'http://80.72.68.217/nrj.ogg.m3u', u'Рок радио':'http://80.72.68.217/radio1rock_low.ogg', u'Радио Melody':'http://live.btvradio.bg/melody.mp3.m3u',u'Радио Nova':'http://149.13.0.81/nova.aac.m3u'}
def menu():
print u"1 за меню"
print u"2 за избор на жанр"
print u"3 за изход"
cmenu=0
while cmenu !=3:
print
cmenu=input("Enter choice :")
if cmenu == 1:
menu()
print
elif cmenu == 2:
chanel()
print
print
def chanel():
print u"1 за трансе"
print u"2 за БГ радио"
print u"3 за изход"
choice=0
while choice!=3:
choice = input("Choice radio vid :")
if choice == 1:
for i in range(len(trance)):
print i, "-",trance.keys()[i]
print
tranceradio = input("Play radio")
if platform.system() == "Windows":
print "Windows system "
path = "C:\\Program Files (x86)\\VideoLAN\\VLC"
os.chdir( path )
player = "vlc.exe "
chanel = trance.values()[tranceradio]
start = player+chanel
os.system(start)
if platform.system() == "linux":
print "Linux system"
player = "cvlc -vvv "
chanel = trance.values()[tranceradio]
start = player+chanel
os.system(start)
if choice == 2:
for i in range(len(bgradio)):
print i, "-",bgradio.keys()[i]
print
tranceradio = input("Push radio")
if platform.system() == "Windows":
print "Windows system "
path = "C:\\Program Files (x86)\\VideoLAN\\VLC"
os.chdir( path )
player = "vlc.exe "
chanel = bgradio.values()[tranceradio]
start = player+chanel
os.system(start)
if platform.system() == "linux":
print "Linux system"
player = "cvlc -vvv "
chanel = bgradio.values()[tranceradio]
start = player+chanel
os.system(start)
#if __name__ == "__main__":
# menu()
menu()
raw_input()
#-*- coding:utf-8 -*-
import re, fileinput
File = "bbb.txt"
for line in fileinput.FileInput(File, inplace=1):
pattern = re.compile(r'\d{10}')
if re.search(pattern,line):
line = re.sub(r'(\d{4})(\d{2})(\d{2})(\d{2})',r'\1-\2-\3-\4',line).strip()
print line.strip()
else:
print line.strip()