Hi,
does anyone understand the timezone conversions?
I found I cannot see the "real" timestamps of the files in a share in Asia when I mount it to my server in Pacific NW.
I thought I can do the following and it will give me the results I want but it did not.
time_today_KL =...
Hi, thank you for helping me with this!
I need to accomplish two things.
1. get the Process list from a remote computer
2. start a script on a remote host
I tested both one-liners, I ran it from my laptop to get the Process list and to execute a Python script on my desktop.
Of course, both PCs...
Hi,
I need to pass a User name and a Pass to the PS script.
I tried to find it online but could not.
Ant idea how to do this?
Invoke-Command -Computer DESK-2.domain.somecorp.com -Scriptblock {C:\Python39\python.exe 'C:\temp\DT_Col\HN.py'}
thank you.
Here is the error:
Get-Process : Couldn't connect to remote machine.
At line:1 char:2
+ Get-Process powershell -ComputerName desk2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-Process], InvalidOperationException
I can ping the...
Greetings!
I have never used PS.
I'm trying to get PS script to get processes running on a remote computer.
Microsoft documents have this example "Get-Process -Name PowerShell -ComputerName localhost, Server01, Server02"
But like everything at Microsoft, it is confusing and not clear.
I tried...
And the same story with this snippet.
It prints what I need but I need to print it to aa different file.
Have no idea how to print the lines to a file.
index = 0
with open(myfile, "r") as f:
for line in f:
index += 1
if "FIND" in line:
f.seek(0)...
To "feherke".
I'm trying to understand your code but it is too much for me for now.
Why this If block is the last block in the script?
if "FIND" in line:
And this part of the script is totally confusing
if (len(before) < 5):
before.append(line)
else...
OK. I could not make csv modules to work and I decided to go the long way.
I wanted to open both files, find matching lines, and append the last element of one file to the end of the second file.
For some reason, the code stops after the first match.
Here is a code:
import os
import re...
Hi,
I need to append some of the rows in a .csv file from another file. I have never done it before, I found some snippets online to do that.
I thought I should do it line by line.
First, I wanted to find lines for appending in a File1, then find the same in a File2 and use the last element of...
To mikrom,
Great post!
I'm still at the beginning of my "Python road" and I need to learn a lot. I did not even try to use dictionary or functions.....
I'm sure there are some other ways how to do this I just do not see any and I appreciate your help!
Hi,
I have a directory with bunch of subdirectories each subdir has a one file only,
I need to process files only form the subdirectories that have letter “H” in a name.
Each file will contain lines with the words "CELL-1", "CELL-2" up to "CELL-12 "- I’m interested in those lines .
I'd like to...
Greeting!
I’m trying to print 4 lines before and after a “match” found in a line.
I do not understand how to do it with my current knowledge of Python Confused but I found 2 snippets,
One finds lines Before the match and one After the match. Need help putting them together.
Thank you.
from...
Hi,
Does anybody knows how to add times in Python?
Need to add HH:MM:SS:MS
The file goes like this:
5/1/2020 2:40:31 PM, 5/1/2020 2:43:11 PM, 00:02:40.5449136,
5/1/2020 2:45:26 PM, 5/1/2020 2:48:17 PM, 00:02:50.8250927,
the third column is a timduration, need to sum it up.
Thank you.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.