pyscripter

logging not writing to file when called from function in Pyscripter

白昼怎懂夜的黑 提交于 2019-12-02 06:03:01
问题 Currently if I run the following code from the python command line it writes to the file specified by filename as expected. import logging def test(): logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p', filename=r'C:\Users\theo\Documents\myLog.txt') logging.warning('Example logged message.') test() But when I copy the code into one of my functions and run the function with Pyscripter, it does not seem to write the file. How can I get logging to appear in

logging not writing to file when called from function in Pyscripter

微笑、不失礼 提交于 2019-12-02 02:27:31
Currently if I run the following code from the python command line it writes to the file specified by filename as expected. import logging def test(): logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p', filename=r'C:\Users\theo\Documents\myLog.txt') logging.warning('Example logged message.') test() But when I copy the code into one of my functions and run the function with Pyscripter, it does not seem to write the file. How can I get logging to appear in Pyscripter? Pyscripter has an 'External Run' option ( Run > External Run (Alt + F9)), choosing this made

How to change the version of python that pyscripter uses

巧了我就是萌 提交于 2019-12-01 03:43:06
I am a newb with python and just learning what to do. I am using pyscripter and have been for a while whilst learning. I am now going through an online course which is taught in 2.6, yet my pyscripter uses the latest. I need to know how to change it to use an older version, I have seen replies about changing the PATH variable but not where it is or how to do it. I have 3 versions of python on my machine, 25,26 and 33. I don't know if this is the best way to do it, but those are the two ways I did it: WAY 1 (The best of two) Go to PyScripter>>Tools>>Options...>>Custom Parameters... and add the

UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 34: ordinal not in range(128)

雨燕双飞 提交于 2019-11-29 15:59:11
问题 I have been working on a program to retrieve questions from stack overflow. Till yesterday the program was working fine, but since today I'm getting the error "Message File Name Line Position Traceback <module> C:\Users\DPT\Desktop\questions.py 13 UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 34: ordinal not in range(128)" Currently the Questions are being displayed but I seem to be unable to copy the output to a new text file. import sys sys.path.append('.')

WindowsError: [Error 193] %1 is not a valid Win32 application in Python

让人想犯罪 __ 提交于 2019-11-29 08:00:21
I wish to import liblas module in Python 2.7 on window 64bit. If I import the module with IDLE (Python GUI) I have no problem. If I use PyScripter "PyScripter-v2.5.3-x64-Setup.exe" I get this error message. >>> import liblas Traceback (most recent call last): File "<interactive input>", line 1, in <module> File "C:\Python27\lib\site-packages\liblas\__init__.py", line 2, in <module> from core import get_version File "C:\Python27\lib\site-packages\liblas\core.py", line 138, in <module> las = ctypes.CDLL(os.path.join(local_dlls, lib_name)) File "C:\Python27\Lib\ctypes\__init__.py", line 365, in _

WindowsError: [Error 193] %1 is not a valid Win32 application in Python

一世执手 提交于 2019-11-28 01:32:52
问题 I wish to import liblas module in Python 2.7 on window 64bit. If I import the module with IDLE (Python GUI) I have no problem. If I use PyScripter "PyScripter-v2.5.3-x64-Setup.exe" I get this error message. >>> import liblas Traceback (most recent call last): File "<interactive input>", line 1, in <module> File "C:\Python27\lib\site-packages\liblas\__init__.py", line 2, in <module> from core import get_version File "C:\Python27\lib\site-packages\liblas\core.py", line 138, in <module> las =