Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: reading and writing a image stored in a file
Post: RE: reading and writing a image stored in a file
(Jan-29-2022, 01:25 AM)Skaperen Wrote: i want to read an image from a file, manipulate the pixels in the Python code (to be developed), and write the image to a file. i expect to get the geometry o... |
|
millpond |
News and Discussions |
4 |
2,219 |
Feb-10-2022, 08:06 AM |
|
|
Thread: Moving directories by filetype
Post: RE: Moving directories by filetype
An addendum to my last post .
I tried the revised script out with a couple of dozen etext dirs (modified the target extensions):
All worked well EXCEPT the one labelled something like
Contemporary F... |
|
millpond |
Homework |
3 |
1,507 |
Feb-08-2022, 07:09 PM |
|
|
Thread: Moving directories by filetype
Post: RE: Moving directories by filetype
(Feb-08-2022, 08:53 AM)Gribouillis Wrote: The walk should be pruned to exclude the subdirs of the dirs moved and the destination directory
import os
def dirs_to_move(root, dest):
for path, subd... |
|
millpond |
Homework |
3 |
1,507 |
Feb-08-2022, 06:31 PM |
|
|
Thread: Moving directories by filetype
Post: Moving directories by filetype
Not homework, but a very elementary script, that has a seemingly complex problem.
It mostly works. It is used to move directories based on the filetype content. It should move the target filetype *AN... |
|
millpond |
Homework |
3 |
1,507 |
Feb-08-2022, 06:50 AM |
|
|
Thread: What WERE They Thinking : Python 3.9x
Post: RE: What WERE They Thinking : Python 3.9x
Question: Is there a FAQ on the template/scaffolding used by a Python executable?
The issue: Python 3.9 works in the MSYS environment in Win7.
But in the standard environment outside MSYS it canno... |
|
millpond |
News and Discussions |
8 |
3,803 |
Jun-28-2021, 01:20 AM |
|
|
Thread: What WERE They Thinking : Python 3.9x
Post: RE: What WERE They Thinking : Python 3.9x
VC complains that the source files for the Win10 dll is missing during compile.
Unsure of compiling under Cygwin and its interactions with my normal Python versions and packages.
I've found the solu... |
|
millpond |
News and Discussions |
8 |
3,803 |
Jun-26-2021, 09:42 PM |
|
|
Thread: What WERE They Thinking : Python 3.9x
Post: RE: What WERE They Thinking : Python 3.9x
@ndc
Nobody is even remotely suggensting that anyone 'support' Win7. Python *should* be fairly independent of quirks within OS versions. Win7 has a very similar architecture to 10, without alot of ex... |
|
millpond |
News and Discussions |
8 |
3,803 |
Jun-19-2021, 09:22 PM |
|
|
Thread: What WERE They Thinking : Python 3.9x
Post: RE: What WERE They Thinking : Python 3.9x
I have a Debian Buster install on the same machine, but also like to have my updated scripting languages on the Win platform.
Win allows me more freedom in making scripts as I prefer to have 'securit... |
|
millpond |
News and Discussions |
8 |
3,803 |
Jun-18-2021, 12:34 AM |
|
|
Thread: What WERE They Thinking : Python 3.9x
Post: What WERE They Thinking : Python 3.9x
On my Debian Install I loaded v3.9 in /opt and all worked out fne. It doesnt mess with system Python. All is well.
Then comes Win.
I have Win7.1. I am *not* going to update this macjhine to Win10, ... |
|
millpond |
News and Discussions |
8 |
3,803 |
Jun-16-2021, 12:50 AM |
|
|
Thread: Testing Zipfiles
Post: RE: Testing Zipfiles
Filetypes indeed looks interesting, but as it might just parse the first few binary lines for specific filetype 'tags' (^mz=exe, ^PDF=pdf, ^PK=Zip etc) it might not be able to detect actual damage to ... |
|
millpond |
General Coding Help |
7 |
2,920 |
Jan-11-2021, 10:44 PM |
|
|
Thread: Testing Zipfiles
Post: RE: Testing Zipfiles
Many thanks! wprks like a charm:
#!python3
#This is a zip test script yo test and categorize a single directory of zip files into /GOOD and /BAD subdirectories.
# It uses the Python zipfile module... |
|
millpond |
General Coding Help |
7 |
2,920 |
Jan-09-2021, 09:11 AM |
|
|
Thread: Testing Zipfiles
Post: Testing Zipfiles
Over the holidays my main data drive crashed, requiring a deep data scan, which resulted in hundreds of thousands of files with extensions but no names.
I am trying to devise a utility to seperate o... |
|
millpond |
General Coding Help |
7 |
2,920 |
Jan-08-2021, 07:55 PM |
|
|
Thread: File Name Parsing
Post: RE: File Name Parsing
@bowlofred
With regex, at least the PCRE I am used to \. is always a period, and . means 'any character'.
In python it seems r'.' means any character.
Lets do regex strings:
a = "fee...fi....fo........ |
|
millpond |
General Coding Help |
5 |
3,601 |
Aug-26-2020, 06:26 AM |
|
|
Thread: File Name Parsing
Post: RE: File Name Parsing
(Aug-25-2020, 07:32 AM)ndc85430 Wrote: Learn to write automated tests using, e.g. the unittest module or third-party libraries like pytest. That will allow you to have confidence that your software ... |
|
millpond |
General Coding Help |
5 |
3,601 |
Aug-26-2020, 04:57 AM |
|
|
Thread: File Name Parsing
Post: File Name Parsing
After minths of putzing around with toy code and simple example scripts, I decided to get started on some real code I will actually use. Extending my file name filter collection, but in Python (instea... |
|
millpond |
General Coding Help |
5 |
3,601 |
Aug-25-2020, 07:28 AM |
|
|
Thread: Mutable Strings
Post: RE: Mutable Strings
(Aug-24-2020, 05:02 AM)bowlofred Wrote: You can't modify a string, but you can reassign a replaced string to the original variable. So a transliteration of your above might be...
import re
foo = r... |
|
millpond |
General Coding Help |
3 |
2,549 |
Aug-24-2020, 08:42 AM |
|
|
Thread: Split string between two different delimiters, with exceptions
Post: RE: Split string between two different delimiters,...
I have never seen split used like this. And surprised it works at all.
Are you parsing the class or the raw data?
I would start with something simple like:
foo=rawdata.split(':')
And join or delete... |
|
millpond |
General Coding Help |
2 |
2,018 |
Aug-24-2020, 08:05 AM |
|
|
Thread: Find specific subdir, open files and find specific lines that are missing from a file
Post: RE: Find specific subdir, open files and find spec...
I beleive that the proper way to parse the file (and using the matching suggested) would be with readlines.
Only line by line can tell you if the expression does *not* exist on a given line.
Not fami... |
|
millpond |
General Coding Help |
8 |
3,571 |
Aug-24-2020, 06:53 AM |
|
|
Thread: Binary data to Image convert
Post: RE: Binary data to Image convert
This is Base64 encoding, often used in email and Usenet from the old days.
https://www.base64decoder.io/python/
Should be of help here... |
|
millpond |
General Coding Help |
1 |
5,654 |
Aug-24-2020, 06:03 AM |
|
|
Thread: Including modules in Python using sys.path.append
Post: RE: Including modules in Python using sys.path.app...
There are no .py files for these type of libraries because they are collections of smaller utilities. In short numpy and pandas are directories. Their functions (.py files) are imported after they are... |
|
millpond |
General Coding Help |
1 |
2,898 |
Aug-24-2020, 04:51 AM |