Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: python echo server
Post: python echo server
Hi, I commited this little echo server for testing purposes. The only thing I don't like, that I cannot stop or exit from the client side.
I'd like to break the while loop if the client sends a 'q' or... |
|
kerzol81 |
Networking |
2 |
2,733 |
Jan-14-2020, 07:46 AM |
|
|
Thread: Composition question
Post: RE: Composition question
Hi, thanks, I implemented __str__, and now it works lik a charm.
class Folder:
_path = ''
_files = []
def __init__(self, path):
if not os.path.exists(path):
message =... |
|
kerzol81 |
General Coding Help |
3 |
2,056 |
Jan-07-2020, 11:30 AM |
|
|
Thread: Composition question
Post: Composition question
Hi, I'm testing composition, and I don't understand the output in the log file.
Here is the script:
import os
import time
import logging
import datetime
class Logger:
logging.basicConfig(file... |
|
kerzol81 |
General Coding Help |
3 |
2,056 |
Jan-07-2020, 10:00 AM |
|
|
Thread: remove files from folder older than X days
Post: remove files from folder older than X days
Hi,
I made this attempt, it works fine, but I'm not satisfied with it. Couldn't it be done easier in a more pythonic way?
Is there a method for this job in a module? I havent figured it out how to re... |
|
kerzol81 |
General Coding Help |
2 |
8,655 |
Jan-03-2020, 09:35 AM |
|
|
Thread: refactoring
Post: refactoring
Hi all, I dont like my implementation of a cat-human age converter, could you please suggest a a more pythonic approach?
"""
First, allow 15 human years for the first year of your cat's life.
... |
|
kerzol81 |
Homework |
8 |
3,494 |
Oct-27-2019, 07:48 PM |
|
|
Thread: performance
Post: performance
Hi,
Do you know any good diagnostic tool to compare 2 implementations?
First:
def converterA(qdate, qtime):
"""
:param qdate: DDMMYY
:param qtime: HHMMSS
:return: YY-MM-DD HH-MM-SS
... |
|
kerzol81 |
General Coding Help |
1 |
1,915 |
Oct-07-2019, 09:30 AM |
|
|
Thread: Unit testing - AssertRaises
Post: RE: Unit testing - AssertRaises
Thanks, in the meantime I got it working as well:
def test_input(self):
with self.assertRaises(TypeError):
qtime_to_osmand_timestamp(True, False) |
|
kerzol81 |
General Coding Help |
3 |
4,591 |
Oct-07-2019, 09:21 AM |
|
|
Thread: Unit testing - AssertRaises
Post: Unit testing - AssertRaises
Hi, I got this converter:
def nmea_to_dd(coordinate, direction):
if direction not in ['N', 'S', 'W', 'E']:
raise TypeError('only N, S, E or W are valid directions')
if coordinate.fin... |
|
kerzol81 |
General Coding Help |
3 |
4,591 |
Sep-30-2019, 07:35 AM |
|
|
Thread: telnetlib timeout
Post: telnetlib timeout
Hi,
I made this test script, to connect to a telnet server, it works, if there is data to read, but if nor or the server is not available the script never jumps to the exception. It looks to me that ... |
|
kerzol81 |
Networking |
0 |
3,400 |
Sep-12-2019, 08:38 AM |
|
|
Thread: rf64 audio files
Post: RE: rf64 audio files
Do you think that the sample rate starts at the 13th byte? |
|
kerzol81 |
General Coding Help |
7 |
4,247 |
May-14-2019, 01:11 PM |
|
|
Thread: rf64 audio files
Post: RE: rf64 audio files
Yes, But I scanned through segment of the 38 byte chunk, and never came out a human readable data...
I guess there is a problem with endiannes and the integer sizes |
|
kerzol81 |
General Coding Help |
7 |
4,247 |
May-14-2019, 11:50 AM |
|
|
Thread: rf64 audio files
Post: RE: rf64 audio files
ok, but it's not what I expect when I return the first element:
IN: struct.unpack('<i', wavHeader[13:17])[0]
OUT: 'sampleRate': 17446257}
It is supposed to be 44100, 32000, 22100 etc |
|
kerzol81 |
General Coding Help |
7 |
4,247 |
May-14-2019, 08:45 AM |
|
|
Thread: rf64 audio files
Post: rf64 audio files
Hi,
I got tons of rf64 audio files.
I try to parse the meaning of each field from the header with not much success.
here is the header of such file:
Quote: struct FormatChunk5 // decl... |
|
kerzol81 |
General Coding Help |
7 |
4,247 |
May-14-2019, 07:41 AM |
|
|
Thread: FTP file size
Post: FTP file size
Hi All,
Do you know a working solution to compare the remote file with the local file before downloading it from the ftp server?
I tried md5 hashing on both end but it is not supported via FTP, and ... |
|
kerzol81 |
General Coding Help |
2 |
4,983 |
Jan-13-2019, 07:50 AM |
|
|
Thread: pytesseract - enhance image before OCR
Post: pytesseract - enhance image before OCR
Hi,
I'd like to get pytesseract correctly recognise characters from a security camera's OSD.
Here is a sample:
sample OSD image
And here is the code that doesn't recognise that misses the 0 charac... |
|
kerzol81 |
General Coding Help |
0 |
3,712 |
Nov-19-2018, 06:21 PM |
|
|
Thread: OpenCV - extract 1st frame out of a video file
Post: RE: OpenCV - extract 1st frame out of a video file
Hi, I think it's gonna extract ALL the frames from the video file. I just need the first frame so I modified it this way:
def getFirstFrame(videofile):
vidcap = cv2.VideoCapture(videofile)
su... |
|
kerzol81 |
Data Science |
2 |
22,040 |
Nov-12-2018, 09:12 AM |
|
|
Thread: OpenCV - extract 1st frame out of a video file
Post: OpenCV - extract 1st frame out of a video file
Hi All,
I'm trying to extract the first frame of a sample video file with OpenCV however it doesnt work:
import cv2
f = cv2.VideoCapture('1.mkv')
rval, frame = f.read()
cv2.imwrite('first_frame.jp... |
|
kerzol81 |
Data Science |
2 |
22,040 |
Nov-10-2018, 03:46 PM |
|
|
Thread: multiple instances
Post: multiple instances
Hello,
Could you please help me out a bit. Basically I'm doing a command line monitoring tool for my Axis cameras. I put a while loop in the init method, so the second instance is never created:
imp... |
|
kerzol81 |
General Coding Help |
2 |
42,367 |
Aug-01-2018, 08:29 AM |
|
|
Thread: reversing a string
Post: reversing a string
Hello,
I was given a homework, the output should look like this:
W
Wo
Wor
Worl
World
World
World H
World He
World Hel
World Hell
World Hello
The teacher suggested this solution:
userInput = 'Hello... |
|
kerzol81 |
Homework |
3 |
2,812 |
Jul-18-2018, 02:32 PM |
|
|
Thread: [split] [split] regular expression
Post: [split] [split] regular expression
Hi,
Could you help me out a bit? I'd like to remove those colored characters out of a bunch of files like these:
a = 'Python Tutorial for Beginners 1 - Install and Setup for Mac and Windows-YYXdXT2l... |
|
kerzol81 |
Homework |
1 |
3,357 |
Jun-24-2018, 08:24 AM |