Skip to content

Instantly share code, notes, and snippets.

import sys
from PyQt5.QtWidgets import *
class MainWindow(QWidget):
def __init__(self):
super(MainWindow, self).__init__()
self.setFixedSize(480, 320)
#self.setStyleSheet("background-color: rgb(255, 255, 255);")
self.buttons()
import sys
from PyQt5.QtWidgets import *
class MainWindow(QWidget):
def __init__(self):
super(MainWindow, self).__init__()
self.setFixedSize(480, 320)
#self.setStyleSheet("background-color: rgb(255, 255, 255);")
self.buttons()
@altendky
altendky / p.py
Last active March 16, 2017 18:32
#!/usr/bin/env python3
import functools
import random
import threading
from turtle import *
lock = threading.Lock()
@altendky
altendky / -
Created October 25, 2016 11:31
Collecting es2csv
Using cached es2csv-1.0.3.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-567efp2j/es2csv/setup.py", line 26, in <module>
with open('HISTORY.rst') as history_file:
FileNotFoundError: [Errno 2] No such file or directory: 'HISTORY.rst'
----------------------------------------
(venv) C:\Users\IEUser\Desktop\src\ST>python setup.py develop
running develop
running egg_info
writing entry points to EPyQ.egg-info\entry_points.txt
writing EPyQ.egg-info\PKG-INFO
writing requirements to EPyQ.egg-info\requires.txt
writing dependency_links to EPyQ.egg-info\dependency_links.txt
writing top-level names to EPyQ.egg-info\top_level.txt
reading manifest file 'EPyQ.egg-info\SOURCES.txt'
writing manifest file 'EPyQ.egg-info\SOURCES.txt'
(venv) C:\Users\IEUser\Desktop\src\ST>deactivate & rd /s /q venv & python -m virtualenv venv & venv\Scripts\activate & python setup.py develop
Using base prefix 'C:\\Program Files (x86)\\Python35-32'
New python executable in C:\Users\IEUser\Desktop\src\ST\venv\Scripts\python.exe
Installing setuptools, pip, wheel...done.
running develop
running egg_info
writing dependency_links to EPyQ.egg-info\dependency_links.txt
writing top-level names to EPyQ.egg-info\top_level.txt
writing requirements to EPyQ.egg-info\requires.txt
writing EPyQ.egg-info\PKG-INFO
#!/usr/bin/env python3
import argparse
import collections
import epyqlib.device
try:
import git
except ImportError as e:
raise ImportError('Package gitpython expected but not found') from e
import json
from lxml import etree
import lxml.html.soupparser as soupparser
#import lxml.html.soupparser
import sys
#from bs4 import BeautifulSoup
#BeautifulSoup(lxml.html, 'html.parser')
htmlfile = open("index.html", "r")
@altendky
altendky / -
Created October 27, 2016 02:35
Traceback (most recent call last):
File "b.py", line 11, in <module>
soup = soupparser.parse(htmlfile, features='lxml.html.soupparser')
File "/home/altendky/venv.bs/lib/python3.5/site-packages/lxml/html/soupparser.py", line 47, in parse
root = _parse(file, beautifulsoup, makeelement, **bsargs)
File "/home/altendky/venv.bs/lib/python3.5/site-packages/lxml/html/soupparser.py", line 78, in _parse
tree = beautifulsoup(source, **bsargs)
File "/home/altendky/venv.bs/lib/python3.5/site-packages/bs4/__init__.py", line 165, in __init__
% ",".join(features))
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml.html.soupparser. Do you need to install a parser library?
list1 = ['1\n', '00:04:11,588 --> 00:04:13,920\n', 'Nurse Evelyn! Nurse Evelyn!\n', '\n', '2\n', '00:04:15,024 --> 00:04:17,788\n', 'I have a message for you. In English!\n', '\n', '3\n', '00:04:35,345 --> 00:04:37,575\n']
def get_strings_position_in_list(astring, alist, position):
for position, string in enumerate(alist):
if alist[position].find(astring) != -1:
yield position
for g in get_strings_position_in_list(" --> ", list1, 0):
print(g)