Re: transform a "normal" decorator in one for async functions

2018-09-19 Thread vito . detullio
Il giorno martedì 18 settembre 2018 17:36:16 UTC+2, [email protected] ha 
scritto:

> > > is there a way to "convert" a "normal" decorator in one that can handle 
> > > async functions?
> > In general? No.
> Ouch.
> 
> I'm new to the "async" world, but so this mean that all of the (appliable) 
> decorators present in the various libraries have to be "paired" with async 
> versions?

I was also thinking: there are some decorator functions (and decorator 
functions factories) also in the stdlib (functools.wrap, property, classmethod 
... you name it)
so this means that also we need to check each of them if is applyable to async 
functions?
-- 
https://mail.python.org/mailman/listinfo/python-list


Search box missing from 3.7.0 documentation home page docs.python.org/3

2018-09-19 Thread Winroth, Harald
I noticed the quick search box in the top-right corner of the pages on 
docs.python.org for Python version 3.7.0 is missing (but not for 3.6 or 3.8).
Maybe you’re already aware of that.

Best regards
Harald




Restricted Information and Basic Personal Data



Harald Winroth | Senior Software Engineer
Elekta Instrument, AB
P.O. Box 7593, SE-103 93 Stockholm, Sweden
Visiting Address: Kungstensgatan 18
Office: +46858725408 | Mobile: +46703485833 | Fax: +46858725500
[email protected] | 
www.elekta.com
Elekta Instrument AB, Reg No. 556492-0949


[cid:[email protected]]





This message is confidential and may be legally privileged or otherwise 
protected from disclosure. If you are not the intended recipient, please 
telephone or email the sender and delete this message and any attachment from 
your system; you must not copy or disclose the contents of this message or any 
attachment to any other person.
Any views expressed in this message are those of the individual sender, except 
where the sender specifies and with authority, states them to be the views of 
Elekta. Elekta may monitor email traffic data.


-- 
https://mail.python.org/mailman/listinfo/python-list


python3.7 problem with validation - it doesnt work

2018-09-19 Thread alon . najman
python3.7 problem with validation - it doesn't work.

I added 2 variables to the IF of the validation:
global UserGmail
global PassGmail

here is the code:


import sys
import requests
from lxml import html
import requests
import urllib.request, urllib.error, urllib.parse
import _thread
from PyQt5 import QtCore, QtGui, QtWidgets
import time
import threading
import ctypes  # An included library with Python install.

global flag
global loopexit
global UserSymbol
global RadioButtonBellow
global UserSymbol
global UserStockPrice 
global RadioButtonAbove
global SMScheckBox
global UserGmail
global PassGmail


UserSymbol=0
RadioButtonBellow=0
RadioButtonAbove=0
UserSymbol=0
UserStockPrice=0
UserGmail=0
PassGmail=0


loopexit=0

def get_quote(str):
url="https://api.iextrading.com/1.0/stock/"+str+"/price";
resource = urllib.request.urlopen(url)
content =  resource.read().decode(resource.headers.get_content_charset())
print (content)
content=float(content)
return content

def myfunction():
import paramiko
import sys
global RadioButtonBellow
global UserSymbol
global UserStockPrice 
global RadioButtonAbove
global UserGmail
global PassGmail
print(UserGmail+" "+PassGmail)


from PyQt5 import QtCore, QtGui, QtWidgets

class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(687, 571)
self.radioButton = QtWidgets.QRadioButton(Dialog)
self.radioButton.setGeometry(QtCore.QRect(80, 190, 191, 24))
font = QtGui.QFont()
font.setPointSize(14)
self.radioButton.setFont(font)
self.radioButton.setObjectName("radioButton")
self.buttonGroup_2 = QtWidgets.QButtonGroup(Dialog)
self.buttonGroup_2.setObjectName("buttonGroup_2")
self.buttonGroup_2.addButton(self.radioButton)
self.checkBox = QtWidgets.QCheckBox(Dialog)
self.checkBox.setGeometry(QtCore.QRect(290, 450, 131, 17))
font = QtGui.QFont()
font.setPointSize(14)
self.checkBox.setFont(font)
self.checkBox.setObjectName("checkBox")
self.checkBox_2 = QtWidgets.QCheckBox(Dialog)
self.checkBox_2.setGeometry(QtCore.QRect(290, 480, 141, 17))
font = QtGui.QFont()
font.setPointSize(14)
self.checkBox_2.setFont(font)
self.checkBox_2.setObjectName("checkBox_2")
self.radioButton_2 = QtWidgets.QRadioButton(Dialog)
self.radioButton_2.setGeometry(QtCore.QRect(300, 190, 186, 24))
font = QtGui.QFont()
font.setPointSize(14)
self.radioButton_2.setFont(font)
self.radioButton_2.setObjectName("radioButton_2")
self.buttonGroup_2.addButton(self.radioButton_2)
self.pushButton = QtWidgets.QPushButton(Dialog)
self.pushButton.setEnabled(True)
self.pushButton.setGeometry(QtCore.QRect(60, 460, 72, 31))
font = QtGui.QFont()
font.setPointSize(14)
self.pushButton.setFont(font)
self.pushButton.setObjectName("pushButton")
self.radioButton_3 = QtWidgets.QRadioButton(Dialog)
self.radioButton_3.setGeometry(QtCore.QRect(80, 250, 191, 24))
font = QtGui.QFont()
font.setPointSize(14)
self.radioButton_3.setFont(font)
self.radioButton_3.setObjectName("radioButton_3")
self.buttonGroup = QtWidgets.QButtonGroup(Dialog)
self.buttonGroup.setObjectName("buttonGroup")
self.buttonGroup.addButton(self.radioButton_3)
self.radioButton_4 = QtWidgets.QRadioButton(Dialog)
self.radioButton_4.setGeometry(QtCore.QRect(300, 250, 186, 24))
font = QtGui.QFont()
font.setPointSize(14)
self.radioButton_4.setFont(font)
self.radioButton_4.setObjectName("radioButton_4")
self.buttonGroup.addButton(self.radioButton_4)
self.pushButton_2 = QtWidgets.QPushButton(Dialog)
self.pushButton_2.setGeometry(QtCore.QRect(30, 20, 75, 31))
font = QtGui.QFont()
font.setPointSize(14)
self.pushButton_2.setFont(font)
self.pushButton_2.setObjectName("pushButton_2")
self.textEdit_4 = QtWidgets.QTextEdit(Dialog)
self.textEdit_4.setGeometry(QtCore.QRect(310, 383, 221, 38))
font = QtGui.QFont()
font.setPointSize(16)
self.textEdit_4.setFont(font)
self.textEdit_4.setObjectName("textEdit_4")
self.textEdit_5 = QtWidgets.QTextEdit(Dialog)
self.textEdit_5.setGeometry(QtCore.QRect(310, 340, 221, 38))
font = QtGui.QFont()
font.setPointSize(16)
self.textEdit_5.setFont(font)
self.textEdit_5.setObjectName("textEdit_5")
self.label = QtWidgets.QLabel(Dialog)
self.label.setGeometry(QtCore.QRect(150, 80, 111, 16))
font = QtGui.QFont()
font.setPointSize(14)
self.label.setFont(font)
self.label.setObjectName("label")
self.label_2 = QtWidgets.QLabel

Type error: not enough arguments for format string

2018-09-19 Thread synch1216
I'm just trying to follow along with the logging tutorial documentation and I 
am getting this error:

import logging


logging.basicConfig(format= '%(asctime)s % (message)s', datefmt='%m%d%Y 
%I:%M:%S %p')
logging.warning('is when this event was logged')

Error:

C:\Users\Malcy\PycharmProjects\Udemy\venv\Scripts\python.exe 
C:/Users/Malcy/PycharmProjects/logging/logger.py
Traceback (most recent call last):
  File 
"C:\Users\Malcy\AppData\Local\Continuum\anaconda2\Lib\logging\__init__.py", 
line 861, in emit
msg = self.format(record)
  File 
"C:\Users\Malcy\AppData\Local\Continuum\anaconda2\Lib\logging\__init__.py", 
line 734, in format
return fmt.format(record)
  File 
"C:\Users\Malcy\AppData\Local\Continuum\anaconda2\Lib\logging\__init__.py", 
line 469, in format
s = self._fmt % record.__dict__
TypeError: not enough arguments for format string
Logged from file logger.py, line 6

-- 
https://mail.python.org/mailman/listinfo/python-list


RE: [SPAM] Type error: not enough arguments for format string

2018-09-19 Thread David Raymond
My first bet at the culprit is the space between the % and (message)s, they 
should be together like you have them for asctime.


-Original Message-
From: Python-list 
[mailto:[email protected]] On Behalf Of 
[email protected]
Sent: Wednesday, September 19, 2018 12:12 PM
To: [email protected]
Subject: [SPAM] Type error: not enough arguments for format string
Importance: Low

I'm just trying to follow along with the logging tutorial documentation and I 
am getting this error:

import logging


logging.basicConfig(format= '%(asctime)s % (message)s', datefmt='%m%d%Y 
%I:%M:%S %p')
logging.warning('is when this event was logged')

Error:

C:\Users\Malcy\PycharmProjects\Udemy\venv\Scripts\python.exe 
C:/Users/Malcy/PycharmProjects/logging/logger.py
Traceback (most recent call last):
  File 
"C:\Users\Malcy\AppData\Local\Continuum\anaconda2\Lib\logging\__init__.py", 
line 861, in emit
msg = self.format(record)
  File 
"C:\Users\Malcy\AppData\Local\Continuum\anaconda2\Lib\logging\__init__.py", 
line 734, in format
return fmt.format(record)
  File 
"C:\Users\Malcy\AppData\Local\Continuum\anaconda2\Lib\logging\__init__.py", 
line 469, in format
s = self._fmt % record.__dict__
TypeError: not enough arguments for format string
Logged from file logger.py, line 6

-- 
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python3.7 problem with validation - it doesnt work

2018-09-19 Thread MRAB

On 2018-09-19 13:12, [email protected] wrote:

python3.7 problem with validation - it doesn't work.


In what way doesn't it work? Does your computer explode?

[snip]



 def printMessage(self):
  global UserSymbol
  global UserStockPrice
  global RadioButtonBellow
  global RadioButtonAbove
  global UserGmail
  global PassGmail
  UserSymbol=self.textEdit.toPlainText()
  UserSymbol=UserSymbol[0:4]
  UserStockPrice=self.textEdit_7.toPlainText()


Here you set UserGmail and PassGmail to the contents of some text edits:


  UserGmail=self.textEdit_5.toPlainText()
  PassGmail=self.textEdit_4.toPlainText()


Judging by the names, I'd guess that they are strings.


#here is the IF of the validation!


Here your check whether they are 0, which is a number:


  if PassGmail==0 or UserGmail==0 or UserSymbol==0 or UserStockPrice==0 
or (RadioButtonAbove==0 and RadioButtonBellow==0):


Strings aren't numbers, and numbers aren't strings. "0" != 0.


   def Mbox(title, text, style):
   return ctypes.windll.user32.MessageBoxW(0, text, title, 
style)


Here you've indented the line more than the def Mbox, so this line is 
inside the function:



   Mbox('you need to enter all data first', 'you need to choose 
Stock value,price,bellow/above price', 1 )


You're not calling it.

[snip]
--
https://mail.python.org/mailman/listinfo/python-list


About how to connect python 3.7 with geany

2018-09-19 Thread Singamaneni Saikiran
It was showing some error please help me with a reply to solve this.

saikiran
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: About how to connect python 3.7 with geany

2018-09-19 Thread Grant Edwards
On 2018-09-19, Singamaneni Saikiran  wrote:

> It was showing some error please help me with a reply to solve this.

You need to make changes to it.

HTH...

-- 
Grant Edwards   grant.b.edwardsYow! I'm ANN LANDERS!!
  at   I can SHOPLIFT!!
  gmail.com

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Type error: not enough arguments for format string

2018-09-19 Thread Cameron Simpson

On 19Sep2018 09:12, [email protected]  wrote:

I'm just trying to follow along with the logging tutorial documentation and I 
am getting this error:

import logging

logging.basicConfig(format= '%(asctime)s % (message)s', datefmt='%m%d%Y 
%I:%M:%S %p')


Probably this:  --^^

The space after the "%" in "% (message)s" is preventing correct recognision of 
the format.


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list