Re: Extract lines from file, add to new files

2024-01-31 Thread Rich Shepard via Python-list
On Tue, 30 Jan 2024, Thomas Passin via Python-list wrote: If I had a script that's been working for 30 years, I'd probably just use Python to do the personalizing and let the rest of the bash script do the rest, like it always has. The Python program would pipe or send the personalized messages

Re: Aw: Re: Re: Extract lines from file, add to new files

2024-01-30 Thread Rich Shepard via Python-list
On Tue, 30 Jan 2024, Karsten Hilbert wrote: It doesn't need to. It just sends the (pre-personalized-by-Python) mail files. Karsten, In which case, I might as well have Python format and send the messages. :-) Regards, Rich -- https://mail.python.org/mailman/listinfo/python-list

Re: Aw: Re: Extract lines from file, add to new files

2024-01-30 Thread Rich Shepard via Python-list
On Tue, 30 Jan 2024, Karsten Hilbert wrote: Why not foxus on just the part you think you are better off using python, namely personalization ? Create personalized files and send them with your trusted mailx solution ? Karsten, Too much time. And while mailx accepts the '-a' option for

RE: Extract lines from file, add to new files

2024-01-30 Thread Rich Shepard via Python-list
On Tue, 30 Jan 2024, AVI GROSS via Python-list wrote: But seriously, the OP, AKA Rich, is making clear that he is making a tool for his own use. It sounds like he wants to maintain a data repository of his own with some info about his clients and then have the ability to specify a name and pop

Re: Extract lines from file, add to new files

2024-01-30 Thread Rich Shepard via Python-list
On Tue, 30 Jan 2024, Thomas Passin via Python-list wrote: Fine, my toy example will still be applicable. But, you know, you haven't told us enough to give you help. Do you want to replace text from values in a file? That's been covered. Do you want to send the messages using those libraries?

Re: Extract lines from file, add to new files

2024-01-30 Thread Rich Shepard via Python-list
On Mon, 29 Jan 2024, Thomas Passin via Python-list wrote: If you aren't going to use one or another existing template system, perhaps the easiest is to use unique strings in the message file. For example: Dear __##so-and-so##__: Please don't write this message off as mere spam.

RE: Extract lines from file, add to new files

2024-01-29 Thread Rich Shepard via Python-list
On Mon, 29 Jan 2024, avi.e.gr...@gmail.com wrote: There are several general solutions that may apply. Some involve reading in both files into data structures and perhaps linking them together in some way such as a data.frame or binary tree. You can then process individual request in memory/

RE: Extract lines from file, add to new files [RESOLVED]

2024-01-29 Thread Rich Shepard via Python-list
On Mon, 29 Jan 2024, Rich Shepard via Python-list wrote: I'll keep searching for a solution. IIRC, someone here pointed me to <https://realpython.com/python-send-email/> and I forgot about it ... until now. Regards, Rich -- https://mail.python.org/mailman/listinfo/python-list

RE: Extract lines from file, add to new files

2024-01-29 Thread Rich Shepard via Python-list
On Mon, 29 Jan 2024, Rich Shepard via Python-list wrote: No, I hadn't ... but I am reading it now. Perhaps I missed the answer to my question when reading the io module. It explains how to open/write/read files of text and binary data, not passing a variable's value from one file to a place

RE: Extract lines from file, add to new files

2024-01-29 Thread Rich Shepard via Python-list
On Mon, 29 Jan 2024, dieter.mau...@online.de wrote: Have you read "https://docs.python.org/3/library/io.html#module-io;? Dieter, No, I hadn't ... but I am reading it now. Many thanks, Rich -- https://mail.python.org/mailman/listinfo/python-list

RE: Extract lines from file, add to new files

2024-01-29 Thread Rich Shepard via Python-list
On Fri, 12 Jan 2024, Rich Shepard via Python-list wrote: For my use 1) the salutation and email address (always with an '@') are sequential and 2) I'm developing the script to extract both from the same file. I've looked at my Python books "Python Crash Course," "E

RE: Extract lines from file, add to new files

2024-01-12 Thread Rich Shepard via Python-list
On Fri, 12 Jan 2024, AVI GROSS via Python-list wrote: But is the solution a good one for some purpose? The two output files may end up being out of sync for all kinds of reasons. One of many "errors" can happen if multiple lines in a row do not have an "@" or a person's name does, for example.

Re: Extract lines from file, add to new files

2024-01-11 Thread Rich Shepard via Python-list
On Thu, 11 Jan 2024, Piergiorgio Sartor via Python-list wrote: Why not to use bash script for all? Piergiorgio, That's certainly a possibility, and may well be better than python for this task. Thank you, Rich -- https://mail.python.org/mailman/listinfo/python-list

Re: Extract lines from file, add to new files

2024-01-11 Thread Rich Shepard via Python-list
On Thu, 11 Jan 2024, Mats Wichmann via Python-list wrote: 4. Don't assume it's going to be "plain text" if the email info is harvested from external sources (like incoming emails) - you'll end up stumbling over a 誰かのユーザー from somewhere. Process as bytes, or be really careful about which

Re: Extract lines from file, add to new files

2024-01-11 Thread Rich Shepard via Python-list
On Thu, 11 Jan 2024, MRAB via Python-list wrote: From the look of it: 1. If the line is empty, ignore it. 2. If the line contains "@", it's an email address. 3. Otherwise, it's a name. MRAB, Thanks. I'll take it from here. Regards, Rich --

Extract lines from file, add to new files

2024-01-11 Thread Rich Shepard via Python-list
It's been several years since I've needed to write a python script so I'm asking for advice to get me started with a brief script to separate names and email addresses in one file into two separate files: salutation.txt and emails.txt. An example of the input file: Calvin cal...@example.com

Re: Cannot install pkg_resources using pip

2023-04-17 Thread Rich Shepard
On Mon, 17 Apr 2023, aapost wrote: Slackware isn't as straight forward in it's management as other distros (not standardized anyway). I've used Slackware for 20 years; it's completely rationale and comfortable for me. :-) That being said, if you start from python source ... If worse came

Re: Cannot install pkg_resources using pip [RESOLVED]

2023-04-17 Thread Rich Shepard
On Sun, 16 Apr 2023, Rich Shepard wrote: How do I clean this up? My thanks for the suggestions and ideas you sent me on this issue. I've resolved it by not trying to build pulseaudio-equalizer. I don't need it because I learned this morning that my Yamaha CM500 headset clearly heard the Zoom

Re: Cannot install pkg_resources using pip

2023-04-17 Thread Rich Shepard
On Sun, 16 Apr 2023, Thomas Passin wrote: Sorry, Rich, I've never dealt with this so someone else will have to give suggestions. Thomas, This is all new to me, too. I would try to see if there are any versions available. It could be that meson says it needs version x but only version y > x

Re: Cannot install pkg_resources using pip

2023-04-16 Thread Rich Shepard
On Sun, 16 Apr 2023, Rich Shepard wrote: I'll download the installer from there. But, I still cannot install the pkg_resources module that meson wants to start the build of pulseaudio-equalizer: # pip install pkg_resources ERROR: Could not find a version that satisfies the requirement

Re: Cannot install pkg_resources using pip

2023-04-16 Thread Rich Shepard
On Sun, 16 Apr 2023, Thomas Passin wrote: It worked then because your path found a pip script. When there are more than one Python installations, it can be unclear which one will get run, depending on how the path got set up after the last version was installed. Thomas, I probably last used

Cannot install pkg_resources using pip

2023-04-16 Thread Rich Shepard
Python3-3.9.10 installed on this Slackware64-14.2 desktop. Trying to run meson to build an application I'm told it's missing pkg_resources, which is part of setuptools. The command fails: # pip install setuptools bash: /usr/bin/pip: /usr/bin/python3.7: bad interpreter: No such file or directory

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread Rich Shepard
On Mon, 13 Mar 2023, Thomas Passin wrote: No doubt, depending on the data formats used. But it's still going to be a big task. Thomas, True, but once you have a dataframe with all the information about all the earthquakes you can extract data for every analysis you want to do. If you've not

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread Rich Shepard
On Mon, 13 Mar 2023, Thomas Passin wrote: But what I need is analysis of seismograms from 4,000 seismographs world wide to detect P-wave energy distribution underground around the earthquake to verify EQ Domino Effect In that case, you will have to do a great deal of work to get all that

Re: Tkinter module test: widget class not inserted in application frame

2022-06-18 Thread Rich Shepard
On Sat, 18 Jun 2022, Peter J. Holzer wrote: There is a comma (U+002C) here ... And a dot (U+002E) here. That was a typo when I wrote the message. And I usually add a space after commas and surrounding equal signs, all for easier reading. Thank you, Rich --

Re: Tkinter module test: widget class not inserted in application frame

2022-06-17 Thread Rich Shepard
On Fri, 17 Jun 2022, Dennis Lee Bieber wrote: ContactNameInput, 'lname', ContactNameInput, 'fname', This works if a tk.labelframe is where the widget is placed. In my case, as MRAB taught me, the proper syntax is self,'lname'... self.'fname'... Thanks,

Re: Tkinter module test: widget class not inserted in application frame

2022-06-17 Thread Rich Shepard
On Fri, 17 Jun 2022, MRAB wrote: This: self.inputs['Last name'] = cc.LabelInput( ContactNameInput, 'lname', input_class = ttk.Entry, input_var = tk.StringVar() ) should be this: self.inputs['Last name'] = cc.LabelInput(

Re: Tkinter module test: widget class not inserted in application frame

2022-06-17 Thread Rich Shepard
On Fri, 17 Jun 2022, MRAB wrote: You haven't shown the code for common_classes.LabelInput, but I'm guessing that the first argument should be the parent. Here's the LabelInput class: class LabelInput(tk.Frame): """ A widget containing a label and input together. """ def

Tkinter module test: widget class not inserted in application frame

2022-06-17 Thread Rich Shepard
I'm not seeing the error source in a small tkinter module I'm testing. The module code: --- import tkinter as tk from tkinter import ttk import common_classes as cc class ConactNameInput(tk.Frame): def __init__(self, parent, *args, **kwargs): super().__init__(parent, *args,

Re: Tkinter: multicolumn table widget

2022-06-06 Thread Rich Shepard
On Tue, 31 May 2022, MRAB wrote: There's an example of how to show a tooltip here: https://stackoverflow.com/questions/3221956/how-do-i-display-tooltips-in-tkinter MRAB, A tooltip would work. I downloaded the first example and assume that it will display a treeview cell when the cursor

Re: Tkinter: multicolumn table widget

2022-05-31 Thread Rich Shepard
On Tue, 31 May 2022, MRAB wrote: The note could be displayed partially in the column itself, with the full text displayed either in read-only textbox nearby when the row is selected (and it's the only selected row), or in the form of a tooltip when you hover over it. There's an example of how

Re: Tkinter: multicolumn table widget

2022-05-31 Thread Rich Shepard
On Tue, 31 May 2022, MRAB wrote: Have a look at the tkinter.ttk.Treeview widget; it can be formatted as a tree hierarchy, its name suggests, or a multi-column tables, but it doesn't support multi-line text though, as far as I know. MRAB, Thank you, I will. Each time I add a row to the

Tkinter: multicolumn table widget

2022-05-31 Thread Rich Shepard
My web searches haven't helped me learn how to design a read-only scrollable table widget displaying rows retrieved from postgres database tables. This is for my business development application. I'm writing a view module that displays my contact history with a named person. The person's last

Re: Unable to open Python

2022-03-28 Thread Rich Shepard
On Mon, 28 Mar 2022, kristine RABIA wrote: I downloaded successfully Python, however when I am trying to open it, brings the window repair, modify or uninstall, I tried to click on repair and modify after all it came with the same window. Please advise the further step. Kristine, What

Re: Tkinter widgets for desktop database application

2021-07-14 Thread Rich Shepard
On Wed, 14 Jul 2021, Betty Hollinshead wrote: So.I've had success with GTK3 (not Tkinter). Betty, There are multiple widget sets and all will work better with some application types than others. In the past I used wxPython but switched to Tkinter. Tried PyQt5 (doesn't do complex,

Tkinter widgets for desktop database application

2021-07-13 Thread Rich Shepard
I'm writing a couple of database applications that use tkinter, and not a web browser, for the UI and I'm still trying to determine the optimal way to do this. Individual tk and ttk widgets (LineEntry, Combobox, etc.) work for adding and modifying individual database table rows but not for

Re: Faker package [RESOLVED]

2021-06-19 Thread Rich Shepard
On Sat, 19 Jun 2021, MRAB wrote: It looks like you're mixing some Python usage ("faker.names()") in with command line usage. MRAB, You are correct. That was my problem. Judging from the docs, I'd say you need something more like: $ faker -o temp.out name for 1 fake name or: $ faker

Re: Faker package

2021-06-18 Thread Rich Shepard
On Sat, 19 Jun 2021, MRAB wrote: When it says "command line" it means the operating system's command line. If it's the Python shell , it'll say "Python shell" or "Python prompt. MRAB, The root shell's (#) what I assumed. User shells (in bash, anyway) have $ as the prompt. Regardless, $

Re: Faker package

2021-06-18 Thread Rich Shepard
On Fri, 18 Jun 2021, Terry Reedy wrote: I would try using the 'given' function/decorator of hypothesis (on pypi) to generate random data that conforms to whatever specification. Thank you, Terry. I'll do that. Regards, Rich -- https://mail.python.org/mailman/listinfo/python-list

Faker package

2021-06-18 Thread Rich Shepard
I'm trying to use the faker package to generate data to load in a sample postgres database so I can learn how to use tksheet and psycopg2. The 8.8.1 documentation shows output on a root shell prompt (#), not a python prompt (>>>). It also has a description of using faker from 'the command line',

Re: tkinter: tksheet

2021-06-17 Thread Rich Shepard
On Thu, 17 Jun 2021, Dennis Lee Bieber wrote: FreePascal/Lazarus is supposed to be similar to Delphi, and does have Linux installs -- but I don't know what it provides for database linkages. I do have it installed on my Windows box (the Linux install is HUGE; takes up over 1/4 of the

Re: tkinter: tksheet

2021-06-17 Thread Rich Shepard
On Thu, 17 Jun 2021, Alan Gauld via Python-list wrote: Sounds like a job for a database view. Can you modify the database schema? Could you create a view - even a temporary one just while your app is running? Alan, Yes, created views work well with postgres. Building one for complex,

Re: tkinter: tksheet

2021-06-17 Thread Rich Shepard
On Thu, 17 Jun 2021, Dennis Lee Bieber wrote: My naive idea is to use two queries, one selects * from the company table ordered by nunber, the other by name. The UI offers two radiobuttons when viewing the results, one for each sort column. Presuming all the data fits in memory, it

Re: tkinter: tksheet

2021-06-16 Thread Rich Shepard
On Wed, 16 Jun 2021, Alan Gauld via Python-list wrote: But there is nothing I know of for Tkinter that provides views of database tables in the way that Delphi or VB or C# do, for example. Alan, These are all Microsoft tools. I run linux only. You have to extract the data using SQL and

Re: tkinter: tksheet

2021-06-16 Thread Rich Shepard
On Thu, 17 Jun 2021, dn via Python-list wrote: Use the DBMS by retrieving the data in the desired sequence? dn, Yep. That's what I thought would be the best approach. Thanks, Rich -- https://mail.python.org/mailman/listinfo/python-list

Re: tkinter: tksheet

2021-06-16 Thread Rich Shepard
On Wed, 16 Jun 2021, Dennis Lee Bieber wrote: Scroll further down to "bindings"... rc_insert_row -- a menu binding Dennis, Yes, I saw that one, too. As for sorting, I don't see anything that allows one to add custom events to the bindings... best I can come up with is that

Re: tkinter: tksheet

2021-06-16 Thread Rich Shepard
On Wed, 16 Jun 2021, Terry Reedy wrote: Somewhat sparse doc at https://github.com/ragardner/tksheet/blob/master/DOCUMENTATION.md#5-modifying-table-data insert_row() Terry, I'm reading this now and saw that. and change the column used for sorting (e.g., sorting by company number or company

tkinter: tksheet

2021-06-16 Thread Rich Shepard
Reading the doc for tksheet tells me that it allows me to modify cells (or entire rows) as well as display them. What I don't see is whether I can add a new row using tksheet and change the column used for sorting (e.g., sorting by company number or company name). If you have experience with

Re: Tkinter8.6: date picker

2021-06-11 Thread Rich Shepard
On Fri, 11 Jun 2021, Dan Stromberg wrote: I think most Python folks are doing their GUI's with a web browser, Qt, or GTK+. I mostly use GTK+. But best wishes on getting a recommendation for a Tkinter date picker. Dan, I don't like working in a web browser; Qt apparently has very weak support

Tkinter8.6: date picker

2021-06-11 Thread Rich Shepard
I need a date picker for a couple of Python-3.7.2/Tkinter8.6 applications. There seem to be some available on the web. If you have experience with a date picker (not a calendar that holds appointments for a given date) I'd like your suggestions and recommendations for one. TIA, Rich --

Re: Recommendation for drawing graphs and creating tables, saving as PDF

2021-06-11 Thread Rich Shepard
On Fri, 11 Jun 2021, Jan Erik Moström wrote: I looked around around but could only find two types of libraries for a) libraries for creating histograms, bar charts, etc, b) very basic drawing tools that requires me to figure out the layout etc. I would prefer a library that would allow me to

Re: Neither pdb or print() displays the bug [FIXED]

2021-06-08 Thread Rich Shepard
On Tue, 1 Jun 2021, Rich Shepard wrote: I'm stuck with neither approach (pdb, print()) working. I moved the database code to a separate module, datasource.py, and when I run the activitytypes.py module (using pdb and having entered print() statements at various places in both the datasource

Re: Posting code on stackoverflow

2021-06-06 Thread Rich Shepard
On Sat, 5 Jun 2021, Terry Reedy wrote: Last time I tried *before*, it did not work. paste, reselect (a nuisance) and click does. Terry, I had tried that and it didn't work any better. Bounding the code with two sets of three backticks does work. Regards, Rich --

Re: Neither pdb or print() displays the bug

2021-06-06 Thread Rich Shepard
On Sun, 6 Jun 2021, Fabio Zadrozny wrote: Hint: you should be able to use https://pypi.org/project/pytest-qt/ to unit-test a PyQt application... Fabio, Thank you for confirming this. I hadn't remembered the name so your URL is really helpful. Regards, Rich --

Re: Posting code on stackoverflow

2021-06-06 Thread Rich Shepard
On Sun, 6 Jun 2021, joseph pareti wrote: you need to put the code between 2 lines defined as follows: ``` then it will be formatted for you Thanks, Joseph. I figured that out on the web page. Regards, Rich -- https://mail.python.org/mailman/listinfo/python-list

Re: Posting code on stackoverflow

2021-06-05 Thread Rich Shepard
On Sun, 6 Jun 2021, Roel Schroeven wrote: There are several ways to format code on StackOverflow, see https://meta.stackoverflow.com/questions/251361/how-do-i-format-my-code-blocks Roel, Thanks very much for the URL. What I do most of the time is indent the code by 4 spaces and make sure

Posting code on stackoverflow

2021-06-05 Thread Rich Shepard
I tried to post a question on stackoverflow.com which included a bunch of code (entered after clicking the box 'code'). I noticed that lines were wrapped but could not find how to expand the input box so they would not wrap. SO wouldn't let me post the question because of the wrapped code. As

Re: Neither pdb or print() displays the bug

2021-06-02 Thread Rich Shepard
On Wed, 2 Jun 2021, Peter Otten wrote: Do you have unit tests? Those are an excellent tool to ensure that the components of an application work as expected and that those components have well-defined interfaces. Debugging a failing unittest is usually easier than to debug a complex application.

Re: Neither pdb or print() displays the bug

2021-06-01 Thread Rich Shepard
On Tue, 1 Jun 2021, Dennis Lee Bieber wrote: I suspect you really should be stepping INTO the calls, not just invoking the functions completely and going to the next LOCAL statement. $ /development/business_tracker/activitytypes.py(1)() -> import sys (Pdb) s $

Re: Neither pdb or print() displays the bug

2021-06-01 Thread Rich Shepard
On Tue, 1 Jun 2021, Ethan Furman wrote: Well, you only had two logging statements in that code -- logging is like print: if you want to see it, you have to call it: Ethan, Got it, thanks. I believe my problem is with the datasource module. I'm focused on making it work (using logging to

Re: Neither pdb or print() displays the bug

2021-06-01 Thread Rich Shepard
On Tue, 1 Jun 2021, Ethan Furman wrote: Sounds like a console issue. Try using `logging` with a file... you could even use `print` with a file if you wanted to. Ethan, Not before using logging I found a reference/example page

Re: Neither pdb or print() displays the bug

2021-06-01 Thread Rich Shepard
On Tue, 1 Jun 2021, Rich Shepard wrote: The QSize() statement is never reached. Correction: the window is 800 x 600, but it's still empty. Rich -- https://mail.python.org/mailman/listinfo/python-list

Neither pdb or print() displays the bug

2021-06-01 Thread Rich Shepard
On Sun, 30 May 2021, Cameron Simpson wrote: I've only just started with pdb. As of Python 3.7 there's a builtin function named breakpoint() which drops you into the debugger. I've never been a big debugger person, historicly using print() and equivalent. However, this makes it very easy to

Re: Applying winpdb_reborn

2021-05-29 Thread Rich Shepard
On Sun, 30 May 2021, Chris Angelico wrote: (Plus, there's not always an opportunity to use a debug harness. Sometimes you just have to put your prints into production and let it run for two weeks in the hope that the bug will show itself.) ChrisA, Please excuse my long-winded description of

Re: Applying winpdb_reborn

2021-05-29 Thread Rich Shepard
On Sun, 30 May 2021, Cameron Simpson wrote: Also, searching for "pdb tutorial" seems to find a bunch of links. Cameron, That's true. All the ones I've read list the various pdb commands. Knowing the commands is different from knowing when and how to apply them. I'll work back to remembering

Re: Applying winpdb_reborn

2021-05-29 Thread Rich Shepard
On Sat, 29 May 2021, Dennis Lee Bieber wrote: Except the copy of winpdb source I looked at has RPDBTERM = 'RPDBTERM' near the top. Then again, I don't know how up-to-date the OP's copy is -- I just Googled for a repository with the module. Let me check a Linux

Re: Applying winpdb_reborn

2021-05-28 Thread Rich Shepard
On Fri, 28 May 2021, Dennis Lee Bieber wrote: It's apparently looking for some environment variable based upon the code at

Re: Applying winpdb_reborn

2021-05-28 Thread Rich Shepard
On Fri, 28 May 2021, MRAB wrote: Have you looked at the package's repository? MRAB, It looks like this is the one: https://github.com/bluebird75/winpdb That's where I got it. Thanks, Rich -- https://mail.python.org/mailman/listinfo/python-list

RE: Applying winpdb_reborn

2021-05-28 Thread Rich Shepard
On Fri, 28 May 2021, Schachner, Joseph wrote: I have no familiarity with this issue, but I think one thing to check is whether all capitalized RPDBTERM is truly the name you are looking for, remember that Python is case sensitive. Joseph, According to the only doc I could find, "RPDB2

Applying winpdb_reborn

2021-05-28 Thread Rich Shepard
I'm trying to debug a module of a PyQt5 application using winpdb_reborn. When I invoke the debugger with the module's name I get an empty winpdb window and the console tells me that it cannot find RPDBTERM. The full traceback is attached. Here, rpdb2 is available: $ locate rpdb2.py

Re: Ad-hoc SQL query builder for Python3?

2021-04-27 Thread Rich Shepard
On Mon, 27 Apr 2021, Robert Latest via Python-list wrote: In case nobody mentioned it before, don't forget to take a look at SQLAlchemy. The object-relational-mapper (ORM) creates a 1:1 mapping of Python objects to SQL table rows. Robert, Yes, I've known of SA for years. I want something

Re: Ad-hoc SQL query builder for Python3?

2021-04-26 Thread Rich Shepard
On Sat, 24 Apr 2021, Rich Shepard wrote: My web searches are not finding what I need to include in an application I'm building: an ad-hoc sql query builder. For those interested I've found a couple of possibilities: PyPika and SQLbuilder. I'll be looking deeply into them to learn

Re: Ad-hoc SQL query builder for Python3?

2021-04-25 Thread Rich Shepard
On Sun, 25 Apr 2021, Peter J. Holzer wrote: What should that sql query builder build the queries from? Or in other words what is the user supposed to input? Peter, From the dialog box offering tables, columns, and rows from which a SELECT statement will be constructed. This is not a

Re: Ad-hoc SQL query builder for Python3?

2021-04-25 Thread Rich Shepard
On Sun, 25 Apr 2021, Alan Gauld via Python-list wrote: I assume you understand the huge risks involved in such a tool. Letting users loose on their own data (and possibly other peoples) allows for huge potential damage/data loss etc. Alan, I disagree about the risk. Regardless of the form of

Re: Ad-hoc SQL query builder for Python3?

2021-04-24 Thread Rich Shepard
On Sat, 24 Apr 2021, J. Pic wrote: Maybe search or ask dba stackexchange for more, meanwhile, here's a popular one: https://github.com/dbeaver/dbeaver J., I use dbeaver-ce now and then as an admin tool. I didn't consider it as an included component in a desktop application. I'll look at it

Ad-hoc SQL query builder for Python3?

2021-04-24 Thread Rich Shepard
My web searches are not finding what I need to include in an application I'm building: an ad-hoc sql query builder. End users will want to query their data for reports not included in the built-in queries. My searches find a windows-only tool that apparently costs developers for the version to

Re: Ann: New Python curses book

2021-04-15 Thread Rich Shepard
On Thu, 15 Apr 2021, Alan Gauld via Python-list wrote: In the main() function the block of code starting with the 'with' statement should be indented to be part of main(). It has been left at the outermost indentation level. The source code file is correct so check against that. Thanks,

Re: Ann: New Python curses book

2021-04-14 Thread Rich Shepard
On Wed, 14 Apr 2021, Alan Gauld via Python-list wrote: The paper version should be fine (apart from one error on p44 which has now been fixed!). Alan, What's the error and correction so I can change it in my dead tree version? Rich -- https://mail.python.org/mailman/listinfo/python-list

Re: UI design: combobox or radiobuttons?

2021-04-13 Thread Rich Shepard
On Wed, 14 Apr 2021, Alan Gauld via Python-list wrote: readability? If the combo box puts the units immediately beside the value then it will be more readable than if it is a row of radio buttons above/below or beside the value. But if the radio buttons represent a unit choice that applies to

UI design: combobox or radiobuttons?

2021-04-13 Thread Rich Shepard
My applications use environmental data, each of which has to specify the units (e.g., cm, m, km, ft, yd, mi). With the widget sets I've used (wxPython and TKinter) I've always used a combobox with the acceptable choices in it. I'm now planning a new application using PyQt5 and it occured to me

Re: Comparing text strings

2021-04-13 Thread Rich Shepard
On Tue, 13 Apr 2021, jak wrote: If I understand your problem correctly, the problem would be dealing with numbers as such in file names. This is just a track but it might help you. This example splits filenames into strings and numbers into tuples, appends the tuple into a list, and then sorts

Re: Comparing text strings

2021-04-13 Thread Rich Shepard
On Tue, 13 Apr 2021, Cameron Simpson wrote: The problem is not that simple. Sometimes the package maintainer upgrades the package for the same version number so there could be abc-1.0_1_SBo.tgz and abc-1.0_2_SBo.tgz. The more involved route will be taken. If that _1, _2 thing is like RedHat's

Re: Comparing text strings

2021-04-12 Thread Rich Shepard
On Tue, 13 Apr 2021, Cameron Simpson wrote: I do not know if there are preexisting modules/tools for this, but I recommend looking at slackware's package management tool - they usually have some kind of 'clean" operation to purge "old" package install files. Sometimes that purges all the

Comparing text strings

2021-04-12 Thread Rich Shepard
I'm running Slackware64-14.2 and keep a list of installed packages. When a package is upgraded I want to remove the earlier version, and I've not before written a script like this. Could there be a module or tool that already exists to do this? If not, which string function would be best suited

Re: editor recommendations?

2021-02-26 Thread Rich Shepard
On Fri, 26 Feb 2021, 2qdxy4rzwzuui...@potatochowder.com wrote: That's what my emacs looks like, minus the light-grey frame (the window manager's frame and border are enough for me). Emacs has themes now, but my setup is very old; all I did was set the "base" text background and foreground

Re: Writing a Python3 ttk.Notebook

2021-01-15 Thread Rich Shepard
On Fri, 15 Jan 2021, Terry Reedy wrote: IDLE's settings dialog uses a ttk.Notebook. The file is Lib/idlelib/configdialog.py. Thanks, Terry! I completely forgot that. I'll study the IDLE's code and learn from that. Stay well, Rich -- https://mail.python.org/mailman/listinfo/python-list

Re: Writing a Python3 ttk.Notebook

2021-01-15 Thread Rich Shepard
On Fri, 15 Jan 2021, Rich Shepard wrote: Progress: I didn't put the notebook on the main window using grid. Now I need to find how to specify the position so it's at the top of the window. I'll read the options on grid. The notebook tabs are placed on the grid as nb.grid(row=0, column=0

Re: Writing a Python3 ttk.Notebook

2021-01-15 Thread Rich Shepard
On Fri, 15 Jan 2021, Rich Shepard wrote: The file 'application.py' is attached. If I had better docs here I could probably work a lot of this out by myself. Progress: I didn't put the notebook on the main window using grid. Now I need to find how to specify the position so it's at the top

Re: Writing a Python3 ttk.Notebook

2021-01-15 Thread Rich Shepard
On Fri, 15 Jan 2021, Dennis Lee Bieber wrote: Off-hand, I'd suspect you should be adding these to the NOTEBOOK object "n". Dennis, You're correct. The MWE didn't have the proper syntax. Now, the problem is the notebook doesn't display its tabs on the main window, while the proper

Re: Writing a Python3 ttk.Notebook

2021-01-15 Thread Rich Shepard
On Fri, 15 Jan 2021, MRAB wrote: You should be adding the frames to the notebook. Also, the tabs are 'self.tab1', not 'tab1', etc: n.add(self.tab1, text='Activities') Similarly for the others. Thanks. MRAB. This allows me to move on and put pre-built widget pages on the tabs.

Writing a Python3 ttk.Notebook

2021-01-15 Thread Rich Shepard
I want to replace the menu on my application with the more appropriate notebook. After looking at examples in my reference books and on the Web I still cannot get it working properly. Here's a small example (nbtest.py): ---8< --- #!/usr/bin/env python3 import tkinter as tk

Re: FridayFinking - Was: A beginning beginner's question about input, output and . . .

2021-01-13 Thread Rich Shepard
On Thu, 14 Jan 2021, dn via Python-list wrote: Concerning the definition of "old" - when I'm having a 'good day', it's anyone several years my senior (and above) - when I'm creaking and groaning, it's anyone remotely my age, and older. About 45 years ago a 25-year-older friend of mine offered

Re: Application window geometry specifier

2021-01-12 Thread Rich Shepard
On Tue, 12 Jan 2021, Grant Edwards wrote: And those X11 users will swear at you if you override their window managers configured window placement. Application code should not care about or try to control window geometry. Period. Grant, Since this application is my own business use those

Binding menu accelerator to a callback

2021-01-12 Thread Rich Shepard
Menu options work from the menu, but not from the accelerator associated with that menu item. My research suggests that while 'command' works for the menu item, 'bind' is required for the associated accelerator. For example, File -> Quit is defined this way: self.file_menu.add_command(

Re: Application window geometry specifier

2021-01-12 Thread Rich Shepard
On Tue, 12 Jan 2021, Igor Korot wrote: Maybe. :-) But it looks Wayland becomes more and more popular. Igor, What I've read from those struggling to use Wayland, it may turn out to be a popular as systemd. :-) It's important to remember that while all progress involves change, not all change

Re: Application window geometry specifier

2021-01-12 Thread Rich Shepard
On Tue, 12 Jan 2021, Igor Korot wrote: Keep in mind that if you target Linux, the "modern" window server (Wayland) will not allow user code to decide the positioning and size of the TLW. Igor, I suspect that Slackware will continue with X11. Rich --

Re: Application window geometry specifier [RESOLVED]

2021-01-12 Thread Rich Shepard
On Wed, 13 Jan 2021, Chris Angelico wrote: Do the offsets need to be integers? ChrisA, Yep. I totally missed that. Thanks for seeing it. Stay well, Rich -- https://mail.python.org/mailman/listinfo/python-list

Application window geometry specifier

2021-01-12 Thread Rich Shepard
I want my application's window (main frame) to open centered on the monitor's screen. This code: # open application centered on screen; set window width and height self.appwidth = 600 self.appheight = 500 # get screen width and height self.scrwidth =

Re: tkinter: creating/attaching menubar to top level window

2021-01-08 Thread Rich Shepard
On Fri, 8 Jan 2021, Richard Damon wrote: It could be either: self.menu = menubar or self['menu'] = menubar Got it, Richard. Removed the period after 'self'. Thanks, Rich -- https://mail.python.org/mailman/listinfo/python-list

Re: tkinter: creating/attaching menubar to top level window [RESOLVED]

2021-01-08 Thread Rich Shepard
On Fri, 8 Jan 2021, Christian Gollwitzer wrote: It is a simple typo, remove the dot. self['menu'] = menubar It will then stop at the add_cascade, fix it like this: Christian, Well, I totally missed that because I'm used to adding a period after each self. Your fresh eyes saw what I

  1   2   3   >