Python Forum
How to import win32api and win32con
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to import win32api and win32con
#1
So I'm trying to import win32api and win32con. So I was researching and I found that I needed pywin32 to do this. So I used pip and installed it but python still said pywin32 was an invalid module. So I'm kinda stuck. Can someone help me?

I tried this.
from PyWin32 import win32api, win32con
I also tried this
from pywin32 import win32api, win32con
Reply
#2
see: https://superuser.com/a/1329256
Reply
#3
Use pypiwin32 it's a newer version to get out of exe install of PyWin32 install and over to pip.
It also simply some imports.
(my_env) E:\div_code\my_env
λ pip install pypiwin32
Collecting pypiwin32
'''''
Using cached cp37m-win32.whl (8.3MB)
    100% |████████████████████████████████| 8.3MB 1.9MB/s
Installing collected packages: pywin32, pypiwin32
Successfully installed pypiwin32-223 pywin32-224

Use:
(my_env) E:\div_code\my_env
λ ptpython
>>> import win32api, win32con
# No erros

>>> win32api.DeleteFile
<built-in function DeleteFile>
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python win32api keybd_event: How do I input a string of characters? JaneTan 3 3,727 Oct-19-2020, 04:16 AM
Last Post: deanhystad
  Win32API Troubles daaaabs 2 2,896 Mar-24-2020, 08:19 PM
Last Post: daaaabs
  how do i fix “No module named win32api” on python2.7 ? shongr2001 1 12,842 Apr-18-2019, 04:03 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020