Пример #1
0
 def tryingToRun(self, runCtx):
     settings = TUTORIAL_SETTINGS.getSettings(runCtx.settings)
     if not settings.enabled:
         return
     else:
         runCtx.cache = TutorialCache.TutorialCache(BigWorld.player().name,
                                                    settings.space)
         reqs = TUTORIAL_SETTINGS.factory(settings.reqs,
                                          init=(weakref.proxy(self),
                                                runCtx))
         if reqs.isEnabled():
             if self.__tutorial is None or self.__tutorial._settings.id != settings.id:
                 self.__tutorial = Tutorial(settings)
                 if self.__tutorial._descriptor is None:
                     LOG_ERROR(
                         'Tutorial descriptor is not valid. Tutorial is not available.'
                     )
                     return
                 if self.__dispatcher is not None:
                     self.__dispatcher.stop()
                     self.__dispatcher = None
                 self.__dispatcher = TUTORIAL_SETTINGS.factory(
                     settings.dispatcher)
             self.__dispatcher.start(runCtx)
             self.__tutorial.setDispatcher(weakref.proxy(self.__dispatcher))
             reqs.process()
         return
Пример #2
0
 def __doRun(self, settings, state):
     if not settings.enabled:
         return False
     else:
         reqs = _settings.createTutorialElement(settings.reqs)
         if not reqs.isEnabled():
             return False
         descriptor = loadDescriptorData(settings, settings.exParsers)
         if descriptor is None:
             LOG_ERROR('Descriptor is not valid. Tutorial is not available', settings)
             return False
         cache = _cache.TutorialCache(BigWorld.player().name)
         cache.read()
         cache.setSpace(settings.space)
         if state.get('byRequest', False):
             cache.setRefused(False)
         runCtx = RunCtx(cache, **state)
         reqs.prepare(runCtx)
         if not reqs.process(descriptor, runCtx):
             return False
         self.clear()
         if self.__dispatcher is None:
             self.__setDispatcher(settings.dispatcher)
         tutorial = Tutorial(settings, descriptor)
         result = tutorial.run(weakref.proxy(self.__dispatcher), runCtx)
         if result:
             self.__tutorial = tutorial
             self.__tutorial.onStopped += self.__onTutorialStopped
         return result
Пример #3
0
def enter():
    clear_canvas()
    global soldier, space, tutorial

    soldier = Soldier()
    space = Space()
    tutorial = Tutorial()
Пример #4
0
    def main(self, screen):
        pygame.mixer.init()
        clock = pygame.time.Clock()
        background = load_image('menu_background.png')
        music = load_sound('music_credits.ogg')
        menu = kezmenu.KezMenu(
            ['Engage', lambda: Quantum().mainLoop(40)],
            ['Enlighten', lambda: Tutorial().mainLoop(40)],
            ['Archive', lambda: Highscore().mainLoop(40)],
            ['Collaborating Minds', lambda: Credits().mainLoop(40)],
            ['Abort', lambda: setattr(self, 'running', False)],
        )
        menu.x = 10
        menu.y = 10
        menu.enableEffect('raise-col-padding-on-focus', enlarge_time=0.1)
        menu.color = (0, 0, 255)
        menu.focus_color = (174, 23, 92)
        menu.font = load_font('adelle.ttf', 20)

        music.play(-1)

        while self.running:
            menu.update(pygame.event.get(), clock.tick(30) / 1000.)
            screen.blit(background, (0, 0))
            menu.draw(screen)
            pygame.display.flip()
Пример #5
0
def enter():
    clear_canvas()
    global soldier, space, tutorial, soldier_bullet_team, alien_team

    soldier = Soldier()
    space = Space()
    tutorial = Tutorial()
    soldier_bullet_team = creat_soldier_bullet_team()
    alien_team = creat_alien_team()
Пример #6
0
    def choice(self) :

            name = input("이름을 입력해주세요 : ")
            age = input("나이를 입력해주세요 : ")

            f = open("data.txt", 'w')
            f.write(name + "   ")
            f.write(age + "   ")

            print("\n")
            print("안녕하세요 ! " + name + "님의 고등학교 진학을 도와드릴 '학교가고' 프로그램 입니다 :) ! ")
            print("\n")


            t = Tutorial()
            t.tutorial()

            arr = ["1. 컴퓨터 코딩","2. 회계 및 전산","3. 디자인","4. 조리 및 식품","5. 기계","6. 과학","7. 항공정비 및 항공서비스","8. 동물","9. 농사","10. 뷰티"]
            school = ["미림여자정보과학고등학교","서울여자상업고등학교","서울디자인고등학교","서울조리고등학교","수도전기공업고등학교","서울과학고등학교","강호항공고등학교","광주자연과학고등학교","충주농업고등학교","한국뷰티고등학교"]
            url = ['https://www.e-mirim.hs.kr/main.do', "http://sys.sen.hs.kr/index.do", "http://seodi.sen.hs.kr/51522/subMenu.do","http://kcas.hs.kr/", "http://sudo.sen.hs.kr/index.do", "http://sshs.hs.kr/index.do","http://school.jbedu.kr/kangho", "http://kns.hs.kr/main/main.php", "http://school.cbe.go.kr/cjagh-h","http://kbeauty.jje.hs.kr/"]

            for i in arr:
                print(i)

            print("원하는 분야의 번호를 입력하세요 : ")

            keyword = input()

            print("▼▽▼▽▼▽▼▽▼▽▼▽▼▽▼▽▼▽▼▽▼▽▼▽")
            print(arr[(int(keyword)-1)])

            print("학교 : "+school[int(keyword)-1])
            print("사이트 : "+url[int(keyword)-1])
            print("▲△▲△▲△▲△▲△▲△▲△▲△▲△▲△▲△▲△")

            f.write(school[int(keyword)-1] + "   ")
            f.write(url[int(keyword)-1] + "   ")
            f.close()
Пример #7
0
 def __doRun(self, settings, runCtx, byRequest=False):
     if not settings.enabled:
         return False
     reqs = _settings.createTutorialElement(settings.reqs)
     if not reqs.isEnabled():
         return False
     descriptor = loadDescriptorData(settings, settings.exParsers)
     if descriptor is None:
         LOG_ERROR('Descriptor is not valid. Tutorial is not available',
                   settings)
         return False
     runCtx.cache.setSpace(settings.space)
     if byRequest:
         runCtx.cache.setRefused(False)
     reqs.prepare(runCtx)
     if not reqs.process(descriptor, runCtx):
         return False
     self.clear()
     tutorial = Tutorial(settings, descriptor)
     result = tutorial.run(weakref.proxy(self.__dispatcher), runCtx)
     if result:
         self.__tutorial = tutorial
         self.__tutorial.onStopped += self.__onTutorialStopped
     return result
Пример #8
0
 def tutorial(self,widget):
   tutorial_window = Tutorial()
   tutorial_window.connect("delete-event", Gtk.main)
   tutorial_window.show_all()
Пример #9
0
import requests
from bs4 import BeautifulSoup
from tutorial import Tutorial

# Scrapper
BASE_URL = 'https://realpython.com'

response = requests.get(BASE_URL)  # realpython.com .....
response_content = response.content  # click derecho ver código fuente de la página

soup = BeautifulSoup(response_content, features='html.parser')
tutorials = soup.find_all('div', class_='col-12 col-md-6 col-lg-4 mb-5')

tutorials_list = []
for t in tutorials:
    title = t.find('h2', class_='card-title')
    image = t.find('img', class_='card-img-top')
    anchor = t.find('a')
    new_tutorial = Tutorial(title.text, anchor['href'], image['src'])
    tutorials_list.append(new_tutorial)
# POO Almancenamos la información obtenida

for t in tutorials_list:
    components_image_url = t.url_image.split('/media/')
    image_file_name = components_image_url[1]
    remote_image_request = requests.get(t.url_image)
    remote_image_content = remote_image_request.content
    with open(f'temp/{image_file_name}', 'wb') as image_file:
        image_file.write(remote_image_content)
Пример #10
0
def enter():
    global tutorial
    tutorial = Tutorial()
    game_world.add_object(tutorial, 0)
import requests
from bs4 import BeautifulSoup
from tutorial import Tutorial
# Scrapper
BASE_URL = 'https://realpython.com'
response = requests.get(BASE_URL)  # realpython.com .....
response_content = response.content  # click derecho ver código fuente de la página
soup = BeautifulSoup(response_content, features='html.parser')
tutorials = soup.find_all('div', class_='col-12 col-md-6 col-lg-4 mb-5')
tutorials_list = []
for t in tutorials:
    title = t.find('h2', class_='card-title')
    image = t.find('img', class_='card-img-top')
    anchor = t.find('a')
    anchor = BASE_URL + anchor['href']
    new_tutorial = Tutorial(title.text, anchor, image['src'], "0")
    tutorials_list.append(new_tutorial)
# POO Almancenamos la información obtenida
for t in tutorials_list:
    components_image_url = t.url_image.split('/media/')
    image_file_name = components_image_url[1]
    remote_image_request = requests.get(t.url_image)
    remote_image_content = remote_image_request.content
    #Descargamos las imagenes con el siguiente codigo
    with open(f'temp/{image_file_name}', 'wb') as image_file:
        image_file.write(remote_image_content)

for item in tutorials_list:
    second_url = item.url
    response_url_article = requests.get(second_url)  # realpython.com .....
    content_url_article = response_url_article.content  # click derecho ver código fuente de la página