def IsCorrect(number):
if number.isdigit() and (len(number) >= 9 and len(number) <= 12):
if number[:2] != '00' and number[0] == '0':
rNumber = '421' + number[1:]
elif number[0] == '9':
rNumber = '0' + number
else:
rNumber = number[2:]
return rNumber
else:
return False
massage_string = True
while massage_string is True
>>> foo = [line.strip() for line in open('foo.txt', 'r')]
>>> foo
['foo', 'bar']
foo = some_string.split('\n')
#####
from <file_with_ParserBazos> import ParserBazos
#####
config_dir = 'modules/sk_sk/bazos/config/config.ini'
open_file_number_dir = 'modules/sk_sk/bazos/database/database_number.txt'
open_file_csv_dir = 'modules/sk_sk/bazos/database/database.csv'
class MyWindow(QtWidgets.QMainWindow):
def __init__(self, parent=None):
super().__init__()
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.ui.parserButton_1.clicked.connect(self.threadBazos)
def threadBazos(self):
self.thread_1 = QtCore.QThread()
self.parserBazos = ParserBazos()
self.parserBazos.moveToThread(self.thread_1)
self.parserBazos.newTextSignalBazos.connect(self.addNewItemBazos)
self.thread_1.started.connect(self.parserBazos.run)
self.thread_1.start()
@QtCore.pyqtSlot(str)
def addNewItemBazos(self, string):
self.ui.parserList_1.addItem(string)
def __init__(self, parent=None):
super().__init__()
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.parserBazos = ParserBazos() # <-
self.thread_1 = QtCore.QThread() # <-
self.ui.parserButton_1.clicked.connect(self.threadBazos)
$(".game-thumb").each(function(index, el){
var gamethumbnum1 = Number($(el).find('.new-price span').text());
var gamethumbnum2 = Number($(el).find('.old-price span').text());
var gamethumbnum = 100 - (gamethumbnum1*100/gamethumbnum2);
$(el).find('.percent-price').text("-" + gamethumbnum + "%");
});
'remove': function(key, product_id) {
...
}
<button onclick="cart.remove('<?= $product['cart_id'] ?>', '<?= $product['product_id'] ?>');">Удалить</button>
$data['products'][] = [
'product_id' => $product['product_id'],
...
]
jQuery(function($){
$(document).mouseup(function (e){ // событие клика по веб-документу
var div = $("#popup"); // тут указываем ID элемента
if (!div.is(e.target) // если клик был не по нашему блоку
&& div.has(e.target).length === 0) { // и не по его дочерним элементам
div.hide(); // скрываем его
}
});
});
<ul class="device-list">
<li><button data-targetClass="desktop-iframe">Десктоп</button></li>
<li><button data-targetClass="tablet-iframe">Планшет</button></li>
<li><button data-targetClass="tabletland-iframe">Планшет2</button></li>
<li><button data-targetClass="phone-iframe">Телефон</button></li>
<li><button data-targetClass="phoneland-iframe">Телефон2</button></li>
</ul>
$(".device-list").on("click", "button", function() {
$(this).parent().addClass('active');
$("#iframelive")
.removeClass()
.addClass($(this).attr('data-targetClass'));
});
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (isset($_POST['name'])) $name = $_POST['name'];
if (isset($_POST['phone'])) $phone = $_POST['phone'];
if (isset($_POST['email'])) $email = $_POST['email'];
if (isset($_POST['text'])) $text= $_POST['text'];
if (isset($_POST['kurs'])) $kurs= $_POST['kurs'];
if (isset($_POST['formData'])) $formData = $_POST['formData'];
}
if (isset($_POST['phone'])) {$phone = $_POST['phone'];}
if (isset($_POST['email'])) {$email = $_POST['email'];}
if (isset($_POST['text'])) {$phone = $_POST['text'];}
if (isset($_POST['kurs'])) {$phone = $_POST['kurs'];}
if (isset($_POST['formData'])) {$formData = $_POST['formData'];}
$lube = ('любая дата');
<input type="hidden" name="date" class="input_text input_form" value="{$lube}">