pywin32

PIP (Python) : ImportError: cannot import name _remove_dead_weakref

江枫思渺然 提交于 2019-12-04 21:10:42
问题 I am getting below error, I have search lot around but haven't been able to find a good fix- Please anyone who was getting this kind of error and resolved. please help. File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main "__main__", fname, loader, pkg_name) File "c:\python27\lib\runpy.py", line 72, in _run_code exec code in run_globals File "C:\python27\Tools\Scripts\pip.exe\__main__.py", line 5, in <module> File "c:\python27\lib\site-packages\pip\__init__.py", line 5, in

Scrapy - [twisted] CRITICAL: Unhandled error in Deferred-你的配置文件还在吗?

不羁的心 提交于 2019-12-04 20:13:55
找到问题的那一刻,骂了自己N次的猪脑子!!! 问题:爬虫脚本本来一切正常的,临时有其他事情耽搁了,然后回头正式运行的时候发现一只报错 [twisted] CRITICAL: Unhandled error in Deferred,错误就是下面这样的(因为都一样的错误,所以直接从网上贴过来的): 2016-03-13 08:50:50 [scrapy] INFO: Enabled extensions: CloseSpider, TelnetConsole, LogStats, CoreStats, SpiderState Unhandled error in Deferred: 2016-03-13 08:50:50 [twisted] CRITICAL: Unhandled error in Deferred: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/scrapy/cmdline.py", line 150, in _run_command cmd.run(args, opts) File "/usr/local/lib/python2.7/dist-packages/scrapy/commands/crawl.py", line 57, in run self

Send Email From Specific Outlook Account Via Python?

左心房为你撑大大i 提交于 2019-12-04 19:30:43
I had some code that was written to email lab users whenever certain processes had finished running. This was sent from a gmail account, using SMTP. However, my supervisor wants the mail to be sent from an official department address, which means that I have use Outlook and MAPI. I've had an account created which I want the email to originate from regardless of the lab machine the job is being run on. The problem is that I can only get email to send from the local Outlook account, and not all of the lab machines have a local account. import win32com.client as win32 outlook = win32.Dispatch(

Writing a pandas dataframe to a word document table via pywin32

大城市里の小女人 提交于 2019-12-04 19:30:25
I am currently working on a script that needs to write to a .docx file for presentation purposes. I use pandas to handle all my data calculations in the script. I am looking to write a pandas dataframe into a table at a bookmark in a word.docx file using PyWIN32. The dataframe consists of floats. The psuedo code is something like this. frame = DataFrame(np.arange(28).reshape((4,7)), columns=['Text1',...'Text7']) With pywin32 imported... wordApp = win32.gencache.EnsureDispatch('Word.Application') wordApp.Visible = False doc = wordApp.Documents.Open(os.getcwd()+'\\template.docx') rng = doc

What's the correct way to use win32file.ReadFile to get the output from a pipe?

时光怂恿深爱的人放手 提交于 2019-12-04 18:56:39
I'm using the pywin32 extensions to access the win32 API under Python. I'm new at doing Windows programming in Python -- I'm a POSIX guy -- so I may be doing things in a bone-headed manner. I'm trying to use the win32file.ReadFile function properly, and I'm having some trouble interpreting the possible result codes. I'm calling the function like this: result, data = win32file.ReadFile(child_stdout_r, 4096, None) I'm reading the output from a child process that I launch. I get good data, but I'm concerned that there may be more data in the pipe than 4096 characters. (And I'd rather do this

Problem with loading win32file.pyd on python 2.6

a 夏天 提交于 2019-12-04 09:32:34
问题 I can't make py2exe to pack correctly even a simple script that uses win32file I'm constantly getting the following error message: Traceback (most recent call last): File "dependency_checker.py", line 1, in <module> File "win32file.pyc", line 12, in <module> File "win32file.pyc", line 10, in __load ImportError: DLL load failed: The specified procedure could not be found. The script looks as follows: import win32file print "Hello world!" And here is the setup.py: from distutils.core import

Refresh Windows Balloon Tip from Python thread

喜你入骨 提交于 2019-12-04 05:14:08
问题 I am using a module for balloon tip notifications in the system tray, whenever the user receives a new message. (using Python 3.3 and Kivy 1.8. I am deploying to windows 7.) I believe the original code comes from this github. This is module as I have altered it:: from win32api import * from win32gui import * import win32con import sys, os import struct import threading import time print ("Importing pypops") class WindowsBalloonTip: def __init__(self, title, msg): message_map = { win32con.WM

py2exe - No system module 'pywintypes'

牧云@^-^@ 提交于 2019-12-04 01:19:58
I'm trying to convert a simple Python script into a Windows executable. My setup.py script is: from distutils.core import setup import py2exe setup( name = "Simple Script", options = { "py2exe": { "dll_excludes" : ["libmmd.dll","libifcoremd.dll","libiomp5md.dll","libzmq.dll"] } }, console=['simple_script.py'] ) I have added the dll_excludes as each one of them caused a failure. Now I've hit a failure that I can't simply exlude. This is the error trace: Traceback (most recent call last): File "setup.py", line 12, in <module> console=['rules signed.py'] File "C:\Anaconda\lib\distutils\core.py",

is there a good example of using pywin32 createprocessasuser and getting the output?

偶尔善良 提交于 2019-12-03 21:26:54
I need to use the pywin32 method of creating a process as a different user and then get the stdout, the stderr and the error code from the spawned process as well as feed input into the process while it is running. The problem is, I can't seem to find a very good example of this for the createprocess function. This problem is further complicated by the fact that I need to run the subprocess as a different user and then get the stderr, stdout, feed in the stdin and retrieve the errorcode when it is done. Eryk Sun Here are the ctypes definitions for the CreateProcess family of functions. I've

pywin32 and excel. Exception when writing large quantities of data

孤人 提交于 2019-12-03 16:45:20
I am currently trying to write a large amount of data to an excel spreadsheet using the pywin32 libraries. As a simple example of the problem that I am facing take the following code to generate a 1000 cell x 1000 cell multiplication table. import win32com.client from win32com.client import constants as c xl = win32com.client.gencache.EnsureDispatch("Excel.Application") xl.Visible = True Workbook = xl.Workbooks.Add() Sheets = Workbook.Sheets tableSize = 1000 for i in range(tableSize): for j in range(tableSize): Sheets(1).Cells(i+1, j+1).Value = i*j For small values this works. However, for