Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: some logic help
Post: RE: some logic help

(Jun-11-2023, 09:28 AM)Gribouillis Wrote: You can also replace for last_line in file: passwith import io file.seek(0, io.SEEK_END) # go directly to the end of the file Thank you for this, it wor...
droidus General Coding Help 5 8,149 Jun-11-2023, 10:41 AM
    Thread: some logic help
Post: RE: some logic help

(Jun-10-2023, 08:53 PM)deanhystad Wrote: You should take a look at watchdog. https://pypi.org/project/watchdog/ I think your loop is wrong. You don't want to re-read the file. You could open the...
droidus General Coding Help 5 8,149 Jun-10-2023, 11:34 PM
  Question Thread: some logic help
Post: some logic help

I have a UPS, and once in a while, the driver crashes for some unknown reason. It needs to be (re)started using this command: upsdrvctl start. I've written a python3 script to attempt to automatical...
droidus General Coding Help 5 8,149 Jun-10-2023, 05:34 PM
    Thread: modified file text getting cut off
Post: RE: modified file text getting cut off

*BUMP*
droidus General Coding Help 3 2,653 Jan-22-2019, 01:55 PM
    Thread: modified file text getting cut off
Post: RE: modified file text getting cut off

Sure Error:ERROR: /etc/snort/rules/protocol-voip.rules(336) Invalid configuration line: alerIn the modified file: .... alert udp $EXTERNAL_NET any -> $SIP_SERVERS $SIP_PORTS (msg:"PR...
droidus General Coding Help 3 2,653 Jan-05-2019, 04:08 AM
    Thread: modified file text getting cut off
Post: modified file text getting cut off

I am trying to modify the lines in a file. After the first few lines in a rules file, there are a lot of commented out rules, and it follows this format: # alert tcp... After running the script, I not...
droidus General Coding Help 3 2,653 Jan-02-2019, 01:19 AM

User Panel Messages

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