Python-list Digest, Vol 213, Issue 24

Ayaana Soni ayaanasoni at gmail.com
Tue Jun 22 22:47:09 EDT 2021


Thank you it worked using the code you gave!!!

On Tue, Jun 22, 2021 at 9:33 PM <python-list-request at python.org> wrote:

> Send Python-list mailing list submissions to
>         python-list at python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://mail.python.org/mailman/listinfo/python-list
> or, via email, send a message with subject or body 'help' to
>         python-list-request at python.org
>
> You can reach the person managing the list at
>         python-list-owner at python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Python-list digest..."
> Today's Topics:
>
>    1. Re: PYTHON (Peter Pearson)
>    2. Re: create an empty RGB image with specified number of cells
>       (rows, columns) (Dan Stromberg)
>    3. Re: Subpixel positioning on Tk canvas (Christian Gollwitzer)
>    4. IDLE is not working after Python installation . (Ayaana Soni)
>    5. Re: create an empty RGB image with specified number of cells
>       (rows, columns) (Arak Rachael)
>    6. Re: create an empty RGB image with specified number of cells
>       (rows, columns) (Arak Rachael)
>    7. Re: IDLE is not working after Python installation . (Terry Reedy)
>    8. Re: IDLE is not working after Python installation .
>       (Mats Wichmann)
>
>
>
> ---------- Forwarded message ----------
> From: Peter Pearson <pkpearson at nowhere.invalid>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: 21 Jun 2021 14:27:05 GMT
> Subject: Re: PYTHON
> On Mon, 21 Jun 2021 10:33:26 +0530, Ayaana Soni <ayaanasoni at gmail.com>
> wrote:
> > have installed python from your site. After installation my IDLE doesn't
> > work.  IDLE is not in my search list. Plz help!!
>
> "Your site" is ambiguous.
>
> Does your computer run Windows, Linux, Apple something, ... ?
>
> --
> To email me, substitute nowhere->runbox, invalid->com.
>
>
>
>
> ---------- Forwarded message ----------
> From: Dan Stromberg <drsalists at gmail.com>
> To: Arak Rachael <arakelthedragon at gmail.com>
> Cc: Python List <python-list at python.org>
> Bcc:
> Date: Mon, 21 Jun 2021 12:19:45 -0700
> Subject: Re: create an empty RGB image with specified number of cells
> (rows, columns)
> I don't know about OpenCV, but here's a way of creating a ppm image file of
> arbitrary size and arbitrary solid color:
> https://stromberg.dnsalias.org/svn/solid/trunk
>
> On Mon, Jun 21, 2021 at 4:01 AM Arak Rachael <arakelthedragon at gmail.com>
> wrote:
>
> > Hi guys!
> >
> > Does anyone know how to do this, if possible with OpenCv?
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >
>
>
>
>
> ---------- Forwarded message ----------
> From: Christian Gollwitzer <auriocus at gmx.de>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Mon, 21 Jun 2021 23:37:42 +0200
> Subject: Re: Subpixel positioning on Tk canvas
> Am 20.06.21 um 01:49 schrieb Terry Reedy:
> > On 6/19/2021 12:42 AM, Christian Gollwitzer wrote:
> >> Sorry for that answer, but Tkinter does not support many of the most
> >> useful extensions for Tcl/Tk, because someone has to write the
> >> wrappers. It only supports what is provided by base Tk. Among those I
> >> consider useful and use in almost any application are:
> >
> > Are these extensions included with the tcl/tk distribution, or otherwise
> > available from active state?  Are this extensions included with Linux
> > installations of tcl/tk?  Or easily installed?
>
> Since ActiveState has pulled out the developers of Tcl a few years ago,
> I haven't used ActiveTcl anymore. I was surprised to see that they
> actually offer a fairly recent version, but it also cannot be simply
> downloaded, one has to register. It was unclear to me if it costs money.
>
> Other people have stepped in to provide Tcl distributions where tese
> extensions are included; notable exanples are BAWT by Paul Obermeier
> http://www.bawt.tcl3d.org/download.html which offers all of the
> mentioned packages (and many more), Androwish/Undroidwish by Christian
> Werner which was originally developed for Android, but now works on te
> major desktop platforms, http://androwish.org/home/wiki?name=undroidwish
> and even kbskit can be mentioned, started by Rene Zaumseil and now
> updated in irregular intervals by me https://github.com/auriocus/kbskit
>
> I haven't checked the major linux distros, but they also might ship with
> some of these extensions.
>
> Concerning installation, it differs. Tablelist (also part of tklib) and
> pdf4tcl are pure-Tcl packages and therefore easily installed.
> TkDnD, TkTable and tkTreeCtrl are compiled extensions and therefore more
> difficult - however, due to the stubs mechanism of Tcl, the version
> number of Tcl and C compiler do NOT need to match. Typically a binary
> downloaded for the right OS and bitness will work, and compilation from
> source works with an autoconf-based configure script.
>
> Due to ActiveState's failure with the teapot, the Tcl world does now not
> any longer have a central repository tool like "pip" which works for
> everyone. This has just recently been discussed on comp.lang.tcl, but it
> is unlikely to happen in the near future.
>
> It is of course unrealistic to expect that Tkinter supports every odd Tk
> extension fron the Tcl world, which might not even be maintained any
> longer. OTOH there are extensions that are well-maintained, that could
> as well be part of the core Tk, but aren't for political reasons. If
> Tkinter continues to be the shipped "first choice" GUI for Python, then
> a few could be included - or otherwise Tkinter will lack Drag'n'drop for
> ever and a reasonable Tree widget (the core one is verrrry basic).
>
> Best regards,
>
>              Christian
>
>
>
>
>
>
> ---------- Forwarded message ----------
> From: Ayaana Soni <ayaanasoni at gmail.com>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Tue, 22 Jun 2021 10:44:04 +0530
> Subject: IDLE is not working after Python installation .
> I  have installed python from your site. After installation my IDLE doesn't
> work.  IDLE is not in my search list. Plz help!!
>
>
>
>
> Thank you!
>
>
>
>
> ---------- Forwarded message ----------
> From: Arak Rachael <arakelthedragon at gmail.com>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Tue, 22 Jun 2021 03:36:45 -0700 (PDT)
> Subject: Re: create an empty RGB image with specified number of cells
> (rows, columns)
> On Monday, 21 June 2021 at 21:20:18 UTC+2, Dan Stromberg wrote:
> > I don't know about OpenCV, but here's a way of creating a ppm image file
> of
> > arbitrary size and arbitrary solid color:
> > https://stromberg.dnsalias.org/svn/solid/trunk
> >
> > On Mon, Jun 21, 2021 at 4:01 AM Arak Rachael <arakelt... at gmail.com>
> > wrote:
> > > Hi guys!
> > >
> > > Does anyone know how to do this, if possible with OpenCv?
> > > --
> > > https://mail.python.org/mailman/listinfo/python-list
> > >
> Thanks for the help! I am new to Python, one company gave me a 2 month
> test period to see if I can, but its really hard.
>
> This is the assignment:
> [code]
> TopGIS Dataset Visualization
>
> In this assignment, you will work with satellite images downloaded along a
> GPS route from TopGIS service. You can download the dataset here:
> http://download.mykkro.cz/valeo/route.zip .
>
> 1. Create a new Python module (package) named topgis-viz. This module will
> have this basic directory structure:
>
> topgis-viz/
>     config/     # this will contain your YAML configuration files (if any
> is necessary)
>         config.yaml    # a default configuration file
>     data/       # unpack the dataset into this directory (so it contains a
> subdirectory named topgis with images)
>     target/     # this folder will contain all of your outputs
>     topgisviz/  # this folder will contain the module code
>         __init__.py
>         # all the other stuff
>     setup.py    # the setup script for the package
>     requirements.txt
>     README.md   # a documentation page, with a short description of the
> module and usage instructions
>     topgis-test.py
>     .gitignore  # don't forget to .gitignore data/ and target/ folders
>
> You will use the module by calling it from command line as follows:
>
> python topgis-test.py [--config=config/config.yaml]
>
> The --config parameter is optional, if not used, the default value
> config/config.yaml will be used. Use argparse library to read the command
> line arguments, like this:
>
>     import argparse
>
>     parser = argparse.ArgumentParser()
>     parser.add_argument(
>         "-c",
>         "--config",
>         help="Path to the config file."
>     )
>
>     args = parser.parse_args()
>     config = args.config
>
> When run, this script will read the configuration file in YAML format
> (read about YAML here: https://yaml.org/) into a Python dictionary. You
> can use this code:
>
> def load_yaml(yaml_path):
>     with open(yaml_path, "r", encoding="utf-8") as infile:
>         return yaml.load(infile, Loader=yaml.FullLoader)
>
> The configuration file will look similarly to this:
>
> # configuration file for topgis-viz
>
> # glob pattern for finding the source files
> sources: "data/topgis/utm_*.jpg"
> output_dir: "target/mosaic/"
> mosaic:
>     columns: 5
>     rows: 2
>     cell_width: 250
>     cell_height: 250
> pipeline:
>     - "A0 = src"
>     - "A1 = greyscale A0"
>     - "A2 = red A0"
>     - "A3 = green A0"
>     - "A4 = blue A0"
>     - "B0 = equalized A0"
>     - "B1 = equalized_greyscale A1"
>     - "B2 = equalized A2"
>     - "B3 = equalized A3"
>     - "B4 = equalized A4"
>
> These parameters govern what the script will do with the images. The
> script will:
>
>     get a list of available images (based on sources parameter, via
> glob.glob function) and sort it alphabetically in increasing order
>     iterate over the list of images and for each of those source images:
>         create an empty RGB image with specified number of cells (rows,
> columns)
>         the cells of the grid are denoted by letter-number code indicating
> column and row. E.g. A0 is top-left cell.
>         run a processing pipeline on the source image. The pipeline is
> defined by a list of strings, which are evaluated in sequence. The format
> of each string is as follows: CELL = FUNCTION [ARGS]. E.g. string B0 =
> equalized A0 means that cell B0 of the grid will be filled with an image
> that comes as result of calling image function equalized on an image in
> cell A0.
>         the original size of the images is 1000x1000 pixels. Do the
> pipeline operations on images with this original size. Resize the images
> (to cell_width * cell_height) only when putting them into the big mosaic
> image.
>         the result of the pipeline will be stored in the specified output
> directory as a JPG image (Use this naming pattern: f"{index:05}.jpg").
>
> The following pipeline functions should be supported:
>
>     src - just the source image
>     greyscale RGB_IMAGE - returns a greyscale image constructed from
> RGB_IMAGE
>     red RGB_IMAGE - returns a color image that contains only red channel
>     green RGB_IMAGE - returns a color image that contains only green
> channel
>     blue RGB_IMAGE - returns a color image that contains only blue channel
>     equalized RGB_IMAGE - returns a color image with equalized intensities
>     equalized_greyscale BW_IMAGE - returns a greyscale image with
> equalized intensities
>
> Most of the functions should be easy to implement. For equalization of
> colored images, use this function:
>
> def equalize_histogram_rgb(rgb_img):
>     # convert from RGB color-space to YCrCb
>     ycrcb_img = cv2.cvtColor(rgb_img, cv2.COLOR_BGR2YCrCb)
>
>     # equalize the histogram of the Y channel
>     ycrcb_img[:, :, 0] = cv2.equalizeHist(ycrcb_img[:, :, 0])
>
>     # convert back to RGB color-space from YCrCb
>     equalized_img = cv2.cvtColor(ycrcb_img, cv2.COLOR_YCrCb2BGR)
>
>     return equalized_img
>
> The cv2.equalizeHist function can be used for equalization of black and
> white images.
>
> Running this script should result with the target/mosaic directory
> populated with 624 of JPEG images named 00000.jpg to 00623.jpg. Each of
> these images should be 1250 pixels wide and 500 pixels high and contain a
> mosaic of images, first row containing original, greyscale, red, green and
> blue images and the second row should contain the equalized versions of
> these images.
> [code]
>
> This is my code so far:
> https://www.dropbox.com/s/qos0gztp4g936tk/topgis-test.py?dl=0
>
>
>
>
> ---------- Forwarded message ----------
> From: Arak Rachael <arakelthedragon at gmail.com>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Tue, 22 Jun 2021 03:38:32 -0700 (PDT)
> Subject: Re: create an empty RGB image with specified number of cells
> (rows, columns)
> Thanks for the help! I am new to Python, one company gave me a 2 month
> test period to see if I can, but its really hard.
>
> This is the assignment:
> [code]
> TopGIS Dataset Visualization
>
> In this assignment, you will work with satellite images downloaded along a
> GPS route from TopGIS service. You can download the dataset here: link
> removed do to NDA.
>
> 1. Create a new Python module (package) named topgis-viz. This module will
> have this basic directory structure:
>
> topgis-viz/
> config/ # this will contain your YAML configuration files (if any is
> necessary)
> config.yaml # a default configuration file
> data/ # unpack the dataset into this directory (so it contains a
> subdirectory named topgis with images)
> target/ # this folder will contain all of your outputs
> topgisviz/ # this folder will contain the module code
> __init__.py
> # all the other stuff
> setup.py # the setup script for the package
> requirements.txt
> README.md # a documentation page, with a short description of the module
> and usage instructions
> topgis-test.py
> .gitignore # don't forget to .gitignore data/ and target/ folders
>
> You will use the module by calling it from command line as follows:
>
> python topgis-test.py [--config=config/config.yaml]
>
> The --config parameter is optional, if not used, the default value
> config/config.yaml will be used. Use argparse library to read the command
> line arguments, like this:
>
> import argparse
>
> parser = argparse.ArgumentParser()
> parser.add_argument(
> "-c",
> "--config",
> help="Path to the config file."
> )
>
> args = parser.parse_args()
> config = args.config
>
> When run, this script will read the configuration file in YAML format
> (read about YAML here: https://yaml.org/) into a Python dictionary. You
> can use this code:
>
> def load_yaml(yaml_path):
> with open(yaml_path, "r", encoding="utf-8") as infile:
> return yaml.load(infile, Loader=yaml.FullLoader)
>
> The configuration file will look similarly to this:
>
> # configuration file for topgis-viz
>
> # glob pattern for finding the source files
> sources: "data/topgis/utm_*.jpg"
> output_dir: "target/mosaic/"
> mosaic:
> columns: 5
> rows: 2
> cell_width: 250
> cell_height: 250
> pipeline:
> - "A0 = src"
> - "A1 = greyscale A0"
> - "A2 = red A0"
> - "A3 = green A0"
> - "A4 = blue A0"
> - "B0 = equalized A0"
> - "B1 = equalized_greyscale A1"
> - "B2 = equalized A2"
> - "B3 = equalized A3"
> - "B4 = equalized A4"
>
> These parameters govern what the script will do with the images. The
> script will:
>
> get a list of available images (based on sources parameter, via glob.glob
> function) and sort it alphabetically in increasing order
> iterate over the list of images and for each of those source images:
> create an empty RGB image with specified number of cells (rows, columns)
> the cells of the grid are denoted by letter-number code indicating column
> and row. E.g. A0 is top-left cell.
> run a processing pipeline on the source image. The pipeline is defined by
> a list of strings, which are evaluated in sequence. The format of each
> string is as follows: CELL = FUNCTION [ARGS]. E.g. string B0 = equalized A0
> means that cell B0 of the grid will be filled with an image that comes as
> result of calling image function equalized on an image in cell A0.
> the original size of the images is 1000x1000 pixels. Do the pipeline
> operations on images with this original size. Resize the images (to
> cell_width * cell_height) only when putting them into the big mosaic image.
> the result of the pipeline will be stored in the specified output
> directory as a JPG image (Use this naming pattern: f"{index:05}.jpg").
>
> The following pipeline functions should be supported:
>
> src - just the source image
> greyscale RGB_IMAGE - returns a greyscale image constructed from RGB_IMAGE
> red RGB_IMAGE - returns a color image that contains only red channel
> green RGB_IMAGE - returns a color image that contains only green channel
> blue RGB_IMAGE - returns a color image that contains only blue channel
> equalized RGB_IMAGE - returns a color image with equalized intensities
> equalized_greyscale BW_IMAGE - returns a greyscale image with equalized
> intensities
>
> Most of the functions should be easy to implement. For equalization of
> colored images, use this function:
>
> def equalize_histogram_rgb(rgb_img):
> # convert from RGB color-space to YCrCb
> ycrcb_img = cv2.cvtColor(rgb_img, cv2.COLOR_BGR2YCrCb)
>
> # equalize the histogram of the Y channel
> ycrcb_img[:, :, 0] = cv2.equalizeHist(ycrcb_img[:, :, 0])
>
> # convert back to RGB color-space from YCrCb
> equalized_img = cv2.cvtColor(ycrcb_img, cv2.COLOR_YCrCb2BGR)
>
> return equalized_img
>
> The cv2.equalizeHist function can be used for equalization of black and
> white images.
>
> Running this script should result with the target/mosaic directory
> populated with 624 of JPEG images named 00000.jpg to 00623.jpg. Each of
> these images should be 1250 pixels wide and 500 pixels high and contain a
> mosaic of images, first row containing original, greyscale, red, green and
> blue images and the second row should contain the equalized versions of
> these images.
> [code]
>
> This is my code so far:
> https://www.dropbox.com/s/qos0gztp4g936tk/topgis-test.py?dl=0
>
>
>
>
> ---------- Forwarded message ----------
> From: Terry Reedy <tjreedy at udel.edu>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Tue, 22 Jun 2021 07:48:38 -0400
> Subject: Re: IDLE is not working after Python installation .
> On 6/22/2021 1:14 AM, Ayaana Soni wrote:
> > I  have installed python from your site.
>
> For what OS.
>
> > After installation my IDLE doesn't work.
>
> How did you try to start it?  Did you read the Using Python doc on the
> website?  Can you start python?
>
> >  IDLE is not in my search list.
>
> On Windows and macOS, IDLE is usually started from an installed icon.
>
> --
> Terry Jan Reedy
>
>
>
>
>
> ---------- Forwarded message ----------
> From: Mats Wichmann <mats at wichmann.us>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Tue, 22 Jun 2021 08:35:44 -0600
> Subject: Re: IDLE is not working after Python installation .
>
> On 6/21/21 11:14 PM, Ayaana Soni wrote:
> > I  have installed python from your site. After installation my IDLE
> doesn't
> > work.  IDLE is not in my search list. Plz help!!
> >
> >
> >
> >
> > Thank you!
> >
>
> you asked this before, and didn't answer the questions you got in reply.
>
> What does "doesn't work" mean? How is the problem manifested?  Doesn't
> IDLE selected from the start menu come up? Normally the installation
> creates a shortcut there that "does the right thing".  On Windows you
> don't normally start IDLE by typing a command name. You *can* bring it
> up from a command-line if you type
>
> py -m idlelib
>
> but this is definitely not the most common way to launch.
>
> If you haven't read it, look at
>
> https://docs.python.org/3/using/windows.html
>
>
> among other things, the Microsoft Store version of Python is sometimes a
> little easier to get started with (it's the same programs, just packaged
> differently)
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>


More information about the Python-list mailing list