Thedocs are a long and sad story, but there's now an online versionof the helpfile that ships with the installers (thanks @ofek!).Lots of that is very old, but some is auto-generated and current. Would love help untangling the docs!
However, please do not open github issues for general support requests, orfor problems or questions using the modules in this package - they will beclosed. For such issues, please email thepython-win32 mailing list -note that you must be subscribed to the list before posting.
Note that if you want to use pywin32 for "system wide" features, such asregistering COM objects or implementing Windows Services, then you must runthat command from an elevated (ie, "Run as Administrator) command prompt.
In almost all cases, this tends to mean there are other pywin32 DLLs installed in your system,but in a different location than the new ones. This sometimes happens in environments thatcome with pywin32 pre-shipped (eg, anaconda?).
Is there a good Python library for win32 console commands ? I am speaking about python code for the most popular win32 console commands. I release I can call generic commands through the os or subprocess modules but I am looking for a library of win32 console commands I can call directly in Python. I am trying to convert some Windows CMD batch files to Python.
I am new to Python but if you are able to call the Windows API then see Console Reference - Windows Console Microsoft Docs. That describes the classical console API. Microsoft has developed a new console system called pseudo consoles that are much more like Linux consoles but the Microsoft solution is (currently) too complicated.
For the command shell there are internal and external commands. The internal commands, such as directory listings, can be executed by executing cmd.exe and using the command as an argument. External commands such as xcopy can be executed directly. The tricky part is that the input and output must be redirected, at least the output. And the output might need to be parsed, but since it is command prompt (.bat) files being converted the redirection and processsing of output might not be necessary.
If I try to copy the whole application folder, with \python subfolder, in another PC, and run the code where Python try to import numpy, I always get a ModuleNotFoundError : No module named 'numpy' (matplotlib is the next import module in the script, but Python script aborts on numpy import line, I think).
If I don't try yo import and use these libraries my application runs just fine from the zip file.
I've used Google to search for a hack but no solution seems to help: someone could suggest how to add Numpy (and MatPlotLib, I think this should be the same) to that zip file, so my customer can simply de-zip my installation file and use my Delphi application?
Thanks!
Thank you Bernhard.
No, I couldn't use the external libraries either way.
Having to use the a different version of Python from any other that was eventually registered, I set the DLL's path on the OnBeforeLoad event of the Engine.
The problem was only with Python external libraries
Anyway, I found a solution.
I am trying to use Vim R plugin [1], which is a Python plugin that uses
PyWin32 on Windows. I have installed Python 2.7.1 and PyWin32. It is
installed correctly, as I am able to do a "import win32api" from python
shell without errors. But, on GVim, if I do::python import win32apiI receive the following error:Traceback (most recent call last):
File "", line 1, in
ImportError: DLL load failed: The specified module could not be found.Notice that this is not the standard error for module not found ("No
module named x"). It is probably related to the path python uses for its
DLL modules. I have played with sys.path, but without success.I also noticed the first path in sys.path is "C:\\must>not&exist", which
is probably a bug. Don't know if this could be related, but I tried do a
sys.path.pop(0), and it didn't work.Anyone has an idea of the problem?Thanks[1] - _id=2628
--
*Alexandre Martani* GDX Investimentos
> I am trying to use Vim R plugin [1], which is a Python plugin
> that uses PyWin32 on Windows. I have installed Python 2.7.1
> and PyWin32. It is installed correctly, as I am able to do a
> "import win32api" from python
> Notice that this is not the standard error for module not
> found ("No module named x"). It is probably related to the
> path python uses for its DLL modules. I have played with
> sys.path, but without success.
Is the directory where the Win32API DLLs are in the Windows environment
variable PATH?
If not, please try to add it there and restart VIM. Do the same also for
the R DLLs.
By the way: I wasn't aware of this VIM R plugin. I like R-Project and
VIM. So this is a good fit.Regards, Roland
The module works when used directly from the Python shell (only fails
from Gvim). I have checked os.environ["PATH"] from both instances, and
they are basically equal (they both includes "C:\Python2.7"), so I think
this is not the problem. Is there any other paths Windows uses to search
its DLLs?Alexandre
I have removed all versions of Python and removed folders C:/Python2.7.
I also tried to use ActivePython, as in my experiences it fixes some
problems with windows paths, but none of them worked. Someone using
Python 2.7 there? I can try later to install Python 2.6.
As of v33, Chrome encrypts cookie values on Windows, Mac, and Linux. The cookies table in 'Cookies' database file now has both an value and an encrypted_value column, only one of which should have data. The encryption is done differently depending on the host OS, with the Windows and Mac OS implementations leveraging user-specific crypto APIs and Linux using a static salt and password (salt = 'saltysalt' and password = 'peanuts'). Fortunately, Python libraries exist to access Mac's keychain (keyring) and the Windows encryption API (win32crypt) and the PyCrypto set of tools lets us decrypt the Linux cookies. Nathan Henrie's post "Decrypt Chrome Cookies with Python" provided me the base for decrypting Mac/Linux cookies, and Jordan Wright's chrome_extract.py did the same for Windows. Many thanks to both of them for posting their research online for others to use!
The reason why Hindsight can only decrypt some cookies is those user APIs. If you are analyzing the encrypted cookies on their native system under the user account that generated them, Hindsight can use the APIs to decrypt them. I know this leaves a vast number of cases where Hindsight won't be able to decrypt the cookies, but it's a start. I believe Hindsight should be able to decrypt cookies from a Linux system on any system that has the required Python modules installed, as the static password/salt aren't very good protection.
I've tested the Windows decryption the most and I've fixed all the bugs I can find. The Linux version also seems to work as well in my limited testing. I don't have a Mac to test on, so please consider decryption on Mac "alpha" (and please let me know if you encounter any issues). The decryption piece requires a number of new Python modules to be installed and I've added some logic in the import block to detect when some modules aren't present. If some are missing, Hindsight will warn the user and keep going, leaving any cookies it can't decrypt with a value of "".
Having logging in a forensic tool is a good thing for many reasons. Logs provide a running account of what the tool did, as well as any errors or anomalies it encountered. They let an examiner look back a year from the time of analysis and find an accurate record of what they did. They also help tool developers pinpoint bugs :).
I've added logging into Hindsight. By default, the log is saved to hindsight.log in the same directory as hindsight.py, but the user can change the path with -l or --log. Hindsight will append new log entries to the end of the log file. I've had the program generate logs at a number of places that made sense to me, but I'm sure as I go I'll find more opportunities to expand the logging. If you have any suggestions on something you'd like to see logged that isn't, please let me know and I can add it.
3a8082e126