Re: RE Version of OpenSSl ?

2025-02-09 Thread Keith Thompson via Python-list
vincent.vandevy...@oqapy.eu writes: >> In case this helps you find the correct package to install: >> >> $ python3 -c "if True: >> > import ssl >> > print('Ok.') >> > " >> Ok. >> >> $ cat /etc/lsb-release >> DISTRIB_ID=Ubuntu >> DISTRIB_RELEASE=24.04 >> DISTRIB_CODENAME=noble >> DISTRIB_D

Re: RE Version of OpenSSl ?

2025-02-09 Thread Left Right via Python-list
So, this is how I know where my SSL headers are found, for instance: ➜ cpython git:(3.12) gcc -I. -I./Include -H ./Modules/_ssl.c 2>&1 | grep evp.h .. /usr/include/openssl/evp.h (this was executed from the repository root). Can you see if you get something similar? Also... just for sanity chec

Re: RE: Problem resizing a window and button placement

2024-02-27 Thread Alan Gauld via Python-list
On 27/02/2024 07:13, Steve GS via Python-list wrote: > Aside from using it to resized > the window, is there no way to > know the last value of the > change for use in the program? The last value would be the current width. And you know how to get that as shown in your configure function: Ww = r

Re: RE: RE: Problem resizing a window and button placement

2024-02-26 Thread Alan Gauld via Python-list
On 26/02/2024 11:02, Steve GS via Python-list wrote: > Although your code produces the value of Ww outside the function, > I do not see how I can use the value of Ww unless I close the program. You have to use a function that operates inside the mainloop. Thats the nature of event driven programs

RE: RE: Problem resizing a window and button placement

2024-02-26 Thread Steve GS via Python-list
quot;) # Can I have concentric loops? SGA -Original Message- From: Alan Gauld Sent: Monday, February 26, 2024 4:04 AM To: Steve GS ; python-list@python.org Subject: Re: RE: Problem resizing a window and button placement On 26/02/2024 07:56, Steve GS via Python-list wrote: > Th

Re: RE: Problem resizing a window and button placement

2024-02-26 Thread Alan Gauld via Python-list
On 26/02/2024 07:56, Steve GS via Python-list wrote: > Then there is that discovery > element: Why is my original > idea not working? I still > cannot pass the value back > from the function. What is > different about this function > that others would have given > me the value? There is nothing

RE: RE: Problem resizing a window and button placement

2024-02-25 Thread Steve GS via Python-list
ot sure how this help[s. As a curio, it would be interesting to see how to use the value of a variable, created in the function used here, and make it available to the code outside the function. SGA -Original Message- From: Alan Gauld Sent: Sunday, February 25, 2024 12:44 PM To:

Re: RE: Problem resizing a window and button placement

2024-02-25 Thread Alan Gauld via Python-list
On 25/02/2024 03:58, Steve GS via Python-list wrote: import tkinter as tk Ww = None def on_configure(*args): global Ww Ww = root.winfo_width() print("Ww Inside = <" + str(Ww) + ">") root = tk.Tk() root.bind('', on_configure) root.mainloop() print("Ww Outside = <" + str(Ww)

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

2024-01-30 Thread Karsten Hilbert 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. :-) Certainly. But it seems you are wrestling with Python. Might as well

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

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

2024-01-30 Thread Karsten Hilbert via Python-list
> > 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 attachments but > has none for

Aw: Re: Re: mypy question

2023-12-30 Thread Karsten Hilbert via Python-list
> I'm fairly sure your database queries don't actually give you strings or > dicts, right? You probably get lists (or iterators) of tuples and > somewhere you convert them to the arguments you are feeding to > run_queries(). Ah, no, those queries are enshrined within the middleware as Python stri

Aw: Re: Re: mypy question

2023-12-30 Thread Karsten Hilbert via Python-list
> It occurs to me that you could simplify things if you converted those > plain query strings to dicts: > > 'SELECT 1' --> {'SQL': 'SELECT 1'} Ha, indeed. There's likely not that many "simple string SQL queries" in that codebase so I shall take it as an opportunity to refactor them. So, at least

Re: RE: Newline (NuBe Question)

2023-11-26 Thread Chris Angelico via Python-list
On Mon, 27 Nov 2023 at 06:15, wrote: > But I learn from criticism. If I ever write a program like that and do not > feel like typing, will this do? > > dents = [ ...] > > Or will that not include students who happen to be edentulous? > If they're learning to drive, this variable name would make c

RE: RE: Newline (NuBe Question)

2023-11-26 Thread AVI GROSS via Python-list
al Message- From: Python-list On Behalf Of Chris Angelico via Python-list Sent: Sunday, November 26, 2023 6:49 AM To: python-list@python.org Subject: Re: RE: Newline (NuBe Question) On Sun, 26 Nov 2023 at 21:08, Michael F. Stemper via Python-list wrote: > > On 24/11/2023 21.45, avi.e.gr...

RE: RE: Newline (NuBe Question)

2023-11-26 Thread AVI GROSS via Python-list
, it makes sense to use the expanded language if it results in faster writing perhaps of faster code with fewer mistakes. -Original Message- From: Python-list On Behalf Of Michael F. Stemper via Python-list Sent: Saturday, November 25, 2023 9:32 AM To: python-list@python.org Subject: Re: R

Re: RE: Newline (NuBe Question)

2023-11-26 Thread Chris Angelico via Python-list
On Sun, 26 Nov 2023 at 21:08, Michael F. Stemper via Python-list wrote: > > On 24/11/2023 21.45, avi.e.gr...@gmail.com wrote: > > Grizz[l]y, > > > > I think the point is not about a sorted list or sorting in general It is > > about reasons why maintaining a data structure such as a list in a progr

Re: RE: Newline (NuBe Question)

2023-11-26 Thread Michael F. Stemper via Python-list
On 24/11/2023 21.45, avi.e.gr...@gmail.com wrote: Grizz[l]y, I think the point is not about a sorted list or sorting in general It is about reasons why maintaining a data structure such as a list in a program can be useful beyond printing things once. There are many possible examples such as hav

Re: Re: Re: Re: Any possible type alias that can also set a default value for a function arg?

2023-10-19 Thread Chris Angelico via Python-list
On Thu, 19 Oct 2023 at 19:34, Karsten Hilbert wrote: > > > > As per my recent foray into abusing existence-checking for Singleton > > > assurance > > > along such lines as > > > > > > >>> try: self.initialized > > > >>> except AttributeError: print('first instantiation'); self.initialized > > >

Aw: Re: Re: Re: Any possible type alias that can also set a default value for a function arg?

2023-10-19 Thread Karsten Hilbert via Python-list
> > As per my recent foray into abusing existence-checking for Singleton > > assurance > > along such lines as > > > > >>> try: self.initialized > > >>> except AttributeError: print('first instantiation'); self.initialized = > > >>> True > > > > and then changing that to > > > > >>> try: self.ini

Re: Re: Re: Any possible type alias that can also set a default value for a function arg?

2023-10-19 Thread Chris Angelico via Python-list
On Thu, 19 Oct 2023 at 18:25, Karsten Hilbert wrote: > > > > > Fundamentally no, at least not without some shenanigans. Type hints do > > > > not affect the regular running of the code, > > > > > > Except when they do ;-) > > > > > > ... depending on what counts as (valid) code ... > > > > > > In

Aw: Re: Re: Any possible type alias that can also set a default value for a function arg?

2023-10-19 Thread Karsten Hilbert via Python-list
> > > Fundamentally no, at least not without some shenanigans. Type hints do > > > not affect the regular running of the code, > > > > Except when they do ;-) > > > > ... depending on what counts as (valid) code ... > > > > In Python a distinction can be made between "runnable" and "valid" :-D > >

Re: Re: Any possible type alias that can also set a default value for a function arg?

2023-10-19 Thread Chris Angelico via Python-list
On Thu, 19 Oct 2023 at 18:04, Karsten Hilbert wrote: > > > > or something like that. Basically, any way to avoid writing `= None` over > > > and over again. > > > > Fundamentally no, at least not without some shenanigans. Type hints do > > not affect the regular running of the code, > > Except wh

RE: RE: Weak Type Ability for Python

2023-04-13 Thread avi.e.gross
what is stored for any shoppers wondering if you are compatible with their needs. -Original Message- From: Python-list On Behalf Of 2qdxy4rzwzuui...@potatochowder.com Sent: Thursday, April 13, 2023 10:27 PM To: python-list@python.org Subject: Re: RE: Weak Type Ability for Python On 2023-04

Re: RE: Weak Type Ability for Python

2023-04-13 Thread 2QdxY4RzWzUUiLuE
On 2023-04-13 at 22:14:25 -0400, avi.e.gr...@gmail.com wrote: > I am looking at a data structure that is an object of some class and > stores the data in any way that it feels like. But it may be a bit of > a chameleon that shows one face or another as needed. I can write code > now that simply ad

RE: RE: Weak Type Ability for Python

2023-04-13 Thread avi.e.gross
text albeit may be implemented in some projects to bridge things as described or in other novel ways. -Original Message- From: Alan Gauld Sent: Thursday, April 13, 2023 8:14 PM To: avi.e.gr...@gmail.com; python-list@python.org Subject: Re: RE: Weak Type Ability for Python On 14/04/

Re: RE: Weak Type Ability for Python

2023-04-13 Thread Alan Gauld
On 14/04/2023 00:25, avi.e.gr...@gmail.com wrote: > Is there any concept in Python of storing information in some way, such as > text, and implementing various ideas or interfaces so that you can query if > the contents are willing and able to be viewed in one of many other ways? Are you talking

Re: RE: Fast full-text searching in Python (job for Whoosh?)

2023-03-08 Thread Dino
On 3/7/2023 2:02 PM, avi.e.gr...@gmail.com wrote: Some of the discussions here leave me confused as the info we think we got early does not last long intact and often morphs into something else and we find much of the discussion is misdirected or wasted. Apologies. I'm the OP and also the OS (

Re: RE: Fast full-text searching in Python (job for Whoosh?)

2023-03-06 Thread Dino
Thank you for taking the time to write such a detailed answer, Avi. And apologies for not providing more info from the get go. What I am trying to achieve here is supporting autocomplete (no pun intended) in a web form field, hence the -i case insensitive example in my initial question. Your

RE: RE: Which more Pythonic - self.__class__ or type(self)?

2023-03-04 Thread avi.e.gross
it becomes an exotic addition to Python in a way that loosely melds, or if it becomes the PYTHONIC way ... -Original Message- From: Alan Gauld Sent: Saturday, March 4, 2023 1:38 PM To: avi.e.gr...@gmail.com; python-list@python.org Subject: Re: RE: Which more Pythonic - self.__class__ or t

Re: RE: Which more Pythonic - self.__class__ or type(self)?

2023-03-04 Thread Alan Gauld
On 04/03/2023 17:38, avi.e.gr...@gmail.com wrote: > > Of course each language has commonly used idioms > That's the point, the correct term is probably "idiomatic" rather than "pythonic" but it is a defacto standard that idiomatic Python has become known as Pythonic. I don't think that's a prob

RE: Re: Python 3.10 Fizzbuzz

2023-02-28 Thread avi.e.gross
Karsten, Would it be OK if we paused this discussion a day till February is History? Sarcasm aside, I repeat, the word black has many unrelated meanings as presumably this case includes. And for those who do not keep close track of the local US nonsense, February has for some reason been dedicate

RE: RE: How to read file content and send email on Debian Bullseye

2023-02-05 Thread avi.e.gross
we are missing anything? Good Luck, ^Avi -Original Message- From: Python-list On Behalf Of ^Bart Sent: Sunday, February 5, 2023 8:58 AM To: python-list@python.org Subject: Re: RE: How to read file content and send email on Debian Bullseye > For example, try to do whatever parts you kno

Re: RE: How to read file content and send email on Debian Bullseye

2023-02-05 Thread ^Bart
For example, try to do whatever parts you know how to do and when some part fails or is missing, ask. You're right but first of all I wrote what I'd like to do and if Python could be the best choice about it! :) I might have replied to you directly if your email email address did not look li

Re: RE: RE: bool and int

2023-01-28 Thread Dino
you have your reasons, and I was tempted to stop there, but... I have to pick this... On 1/26/2023 10:09 PM, avi.e.gr...@gmail.com wrote: You can often borrow ideas and code from an online search and hopefully cobble "a" solution together that works well enough. Of course it may suddenly f

RE: RE: bool and int

2023-01-26 Thread avi.e.gross
ino Sent: Thursday, January 26, 2023 9:26 AM To: python-list@python.org Subject: Re: RE: bool and int Wow. That was quite a message and an interesting read. Tempted to go deep and say what I agree and what I disagree with, but there are two issues: 1) time 2) I will soon be at a disadvantage

Re: RE: bool and int

2023-01-26 Thread Dino
Wow. That was quite a message and an interesting read. Tempted to go deep and say what I agree and what I disagree with, but there are two issues: 1) time 2) I will soon be at a disadvantage discussing with people (you or others) who know more than me (which doesn't make them right necessari

RE: RE: NoneType List

2023-01-02 Thread avi.e.gross
d new users avoid version 2? Other languages have had to split when big enough changes were made. -Original Message- From: Alan Gauld Sent: Monday, January 2, 2023 3:01 AM To: avi.e.gr...@gmail.com; python-list@python.org Subject: Re: RE: NoneType List On 02/01/2023 02:14, avi

Re: RE: NoneType List

2023-01-02 Thread Alan Gauld
On 02/01/2023 02:14, avi.e.gr...@gmail.com wrote: > I used PASCAL before C and I felt like I was wearing a straitjacket at times > in PASCAL when I was trying to write encryption/decryption functions and had > to find ways to fiddle with bits. Similar things were easy in C, and are > even easier in

Re: Re: Long running process - how to speed up?

2022-02-20 Thread Shaozhong SHI
On Sat, 19 Feb 2022 at 18:51, Alan Gauld wrote: > On 19/02/2022 11:28, Shaozhong SHI wrote: > > > I have a cvs file of 932956 row > > That's not a lot in modern computing terms. > > > and have to have time.sleep in a Python > > script. > > Why? Is it a requirement by your customer? Your manager?

Re: Re: Long running process - how to speed up?

2022-02-19 Thread Chris Angelico
On Sat, 19 Feb 2022 at 22:59, Karsten Hilbert wrote: > > > > I have a cvs file of 932956 row and have to have time.sleep in a Python > > > script. It takes a long time to process. > > > > > > How can I speed up the processing? Can I do multi-processing? > > > > > Remove the time.sleep()? > > He'

RE: Re: The task is to invent names for things

2021-10-28 Thread Avi Gross via Python-list
Names can be taken too far as the same variable may have different connotations in one place than another. Say I am counting how many of something and incrementing variable HowMany as I go along and initialized to zero. Then I want to test if I have any and instead of: if (HowMany > 0) I

Re: Re: sum() vs. loop

2021-10-12 Thread Chris Angelico
On Wed, Oct 13, 2021 at 12:36 PM Avi Gross via Python-list wrote: > > Alan, > > I am also wondering about that zip() function call to bind the two lists > into a sort of iterator object. Presumably that calls the iterator N times. > I did a test where I made two list called A and B and used zip to

RE: Re: sum() vs. loop

2021-10-12 Thread Avi Gross via Python-list
Alan, I am also wondering about that zip() function call to bind the two lists into a sort of iterator object. Presumably that calls the iterator N times. I did a test where I made two list called A and B and used zip to make an object holding the two and then removed A and B. I was able to print

Aw: Re: Re: Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Karsten Hilbert
> Trust me: it takes 100x getting anything done plus keep up with your prayers, > and it takes 100^100x learning anything solid, as in just forget about it. > Indeed, consider that we are rather going to the formal verification of > programs, software, and even hardware... I sincerly wish you

Re: Re: Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Julio Di Egidio
On Sunday, 20 December 2020 at 19:54:08 UTC+1, Karsten Hilbert wrote: > > > So what you are looking for is the form of a potential > > > "timeout exception" (say, exception name) ? > > > > > > Provoke one and have a look. > > > > > > Then catch what you saw. > > > >

Aw: Re: Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Karsten Hilbert
> > So what you are looking for is the form of a potential > > "timeout exception" (say, exception name) ? > > > > Provoke one and have a look. > > > > Then catch what you saw. > > > > Programmers don't guess... I did not suggest gue

Re: Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Julio Di Egidio
On Sunday, 20 December 2020 at 19:35:21 UTC+1, Karsten Hilbert wrote: > > If it's a timeout exception I'm going to delay a little while and then > > try again. The timeout is probably because the server is busy. > > So what you are looking for is the form of a potential > "timeout exception" (s

Re: Re: CLI parsing—with `--help` text—`--foo bar`, how to give additional parameters to `bar`?

2020-10-15 Thread Samuel Marks
Yeah I've played with custom actions before https://github.com/offscale/argparse-utils/tree/master/argparse_utils/actions But this would only help in one phase, the important phase of providing help text will need to be provided out-of-argparse and thrown in (like my trivial absl alternative, exp

Re: Re: CLI parsing—with `--help` text—`--foo bar`, how to give additional parameters to `bar`?

2020-10-15 Thread Dieter Maurer
Samuel Marks wrote at 2020-10-16 10:09 +1100: >Yes it’s my module, and I’ve been using argparse >https://github.com/SamuelMarks/ml-params > >No library I’ve found provides a solution to CLI argument parsing for my >use-case. Do you know that with `argparse` you can specify how many arguments an op

Aw: Re: Re: Python 3 how to convert a list of bytes objects to a list of strings?

2020-08-29 Thread Karsten Hilbert
> Just appending a message as a raw file to a mailbox, doesn't properly > add it as a new message. You need to add a From: line to the front, and > then go through the message and alter any line that begins as "From:" > (and possibly any line that begins with something like ">From:" or > ">>From:"

Aw: Re: Re: Another 2 to 3 mail encoding problem

2020-08-27 Thread Karsten Hilbert
> > > Because of this, the Python 3 str type is not suitable to store an email > > > message, since it insists on the string being Unicode encoded, > > > > I should greatly appreciate to be enlightened as to what > > a "string being Unicode encoded" is intended to say ? > > > > A Python 3 "str" or

Re: Re: Another 2 to 3 mail encoding problem

2020-08-27 Thread Chris Angelico
On Thu, Aug 27, 2020 at 11:10 PM Karsten Hilbert wrote: > > > Because of this, the Python 3 str type is not suitable to store an email > > message, since it insists on the string being Unicode encoded, > > I should greatly appreciate to be enlightened as to what > a "string being Unicode encoded"

Re: Aw: Re: Re: Re: stuck on time

2019-12-08 Thread Ethan Furman
On 12/08/2019 06:32 AM, Python wrote: Well... Maybe it's time to admit, Rob, that programming is not your thing. Rob, my apologies. Whoever this person is, they are not "Python", and their behavior will not be tolerated. "Python", if you don't want to help then remain silent. If you don't

Re: Aw: Re: Re: Re: Re: stuck on time

2019-12-08 Thread RobH
On 08/12/2019 14:26, Karsten Hilbert wrote: Like this? >>>print_time() Traceback (most recent call last) File "stdin>", line 1, in File "stdin>", line 2, in print_time File "stdin>", line 2, in print_time File "stdin>", line 2, in print_time [Previous line repeated 996 more times] RecursionEr

Re: Aw: Re: Re: Re: stuck on time

2019-12-08 Thread Chris Angelico
On Mon, Dec 9, 2019 at 1:56 AM RobH wrote: > Thanks, but I am only using the code which someone else has written, and > apparently it works ok for them and others but not for me. > > I only came here to find out why, and that is why I posted the link to > the code, which I thought would be helpful

Re: Aw: Re: Re: Re: stuck on time

2019-12-08 Thread RobH
On 08/12/2019 14:39, Chris Angelico wrote: On Mon, Dec 9, 2019 at 1:36 AM Python wrote: RobH wrote: On 08/12/2019 13:06, Karsten Hilbert wrote: In an interactive interpreter: def print_time(): current_time = time.strftime("%I:%M") What happens if you then do print_time() print_

Re: Aw: Re: Re: Re: stuck on time

2019-12-08 Thread Chris Angelico
On Mon, Dec 9, 2019 at 1:36 AM Python wrote: > > RobH wrote: > > On 08/12/2019 13:06, Karsten Hilbert wrote: > > In an interactive interpreter: > > > > def print_time(): > > current_time = time.strftime("%I:%M") > > What happens if you then do > > print_ti

Re: Aw: Re: Re: Re: stuck on time

2019-12-08 Thread Python
RobH wrote: On 08/12/2019 13:06, Karsten Hilbert wrote: In an interactive interpreter: def print_time():   current_time = time.strftime("%I:%M") What happens if you then do print_time() print_time() on it's own returns NameError: name 'print_time' is not defined Notice the "then" ab

Aw: Re: Re: Re: Re: stuck on time

2019-12-08 Thread Karsten Hilbert
> Like this? > >>>print_time() > Traceback (most recent call last) > File "stdin>", line 1, in > File "stdin>", line 2, in print_time > File "stdin>", line 2, in print_time > File "stdin>", line 2, in print_time > [Previous line repeated 996 more times] > RecursionError: maximum recursion depth

Re: Aw: Re: Re: Re: stuck on time

2019-12-08 Thread RobH
On 08/12/2019 13:06, Karsten Hilbert wrote: In an interactive interpreter: def print_time(): current_time = time.strftime("%I:%M") What happens if you then do print_time() print_time() on it's own returns NameError: name 'print_time' is not defined Notice the "then" above ? Mo

Aw: Re: Re: Re: stuck on time

2019-12-08 Thread Karsten Hilbert
> >> In an interactive interpreter: > >> > >> def print_time(): > >> current_time = time.strftime("%I:%M") > > > > What happens if you then do > > > > print_time() > > > > print_time() > on it's own returns NameError: name 'print_time' is not defined Notice the "then" above ? More precisely:

Re: Aw: Re: Re: stuck on time

2019-12-08 Thread RobH
On 08/12/2019 10:39, Karsten Hilbert wrote: In an interactive interpreter: def print_time(): current_time = time.strftime("%I:%M") returns nothing. That should be correct. What happens if you then do print_time() inside the interpreter ? Karsten print_time() on it's own return

Aw: Re: Re: stuck on time

2019-12-08 Thread Karsten Hilbert
> In an interactive interpreter: > > def print_time(): > current_time = time.strftime("%I:%M") > > returns nothing. That should be correct. What happens if you then do print_time() inside the interpreter ? Karsten -- https://mail.python.org/mailman/listinfo/python-list

Re: re not working

2019-09-16 Thread MRAB
On 2019-09-17 02:31, CrazyVideoGamez wrote: For some reason these are different: pattern = r'[0-9]{4,6}' And pattern2 = r'[0-9][0-9][0-9][0-9]([0-9]){0,2}' And when I try to match them import re re.search(pattern, '1234') and import re re.search(pattern2, '1234') are different. Help? Pyt

Re: Re: absolute path to a file

2019-08-16 Thread Chris Angelico
On Sat, Aug 17, 2019 at 2:27 AM Paul St George wrote: > BUT does not work with > | print('test2:',os.path.realpath(n.image.filepath))| > > This returns only > |/image01.tif| > > > Notes: > Chris, I only mention the extra leading slash on my Mac in case anyone > wonders why it is there. Python puts

Re: Re: absolute path to a file

2019-08-16 Thread Paul St George
Thank you Manfred and Cameron! I think the problem may lie within syntax rather than vocabulary. The code works in one place but not where I use it in my script*. Cameron’s suggestion works when I try | print('test1:', os.path.realpath(bpy.data.filepath))| This returns: |/Users/Lion/Desktop/t

Re: Re: String slices

2019-08-10 Thread Paul St George
On 10/08/2019 17:35, Dennis Lee Bieber wrote: On Sat, 10 Aug 2019 11:45:43 +0200, "Peter J. Holzer" declaimed the following: There are of course many variants to all three methods. And then one can get downright nasty... X = 3.14 Y = 2.78 Z = 6.226E23 print("".join(["Plane rotation

Re: Re: String slices

2019-08-09 Thread Paul St George
On 09/08/2019 16:29, Rhodri James wrote: On 09/08/2019 15:13, Paul St George wrote: In the code (below) I want a new line like this: Plane rotation X: 0.0 Plane rotation Y: 0.0 Plane rotation Z: 0.0 But not like this: Plane rotation X: 0.0 Plane rotation Y: 0.0 Plane rotation Z: 0.0 Is it p

Re: Re: Python in Blender. Writing information to a file.

2019-08-09 Thread Paul St George
On 09/08/2019 15:59, Rhodri James wrote: On 09/08/2019 14:54, Paul St George wrote: On 09/08/2019 04:09, Cameron Simpson wrote: On 08Aug2019 22:42, Paul St George wrote: On 08/08/2019 10:18, Peter Otten wrote: The print() function has a keyword-only file argument. So: with open(..., "w") a

Re: Re: Python in Blender. Writing information to a file.

2019-08-08 Thread Paul St George
On 08/08/2019 10:18, Peter Otten wrote: Paul St George wrote: I am using Python 3.5 within Blender. I want to collect values of the current settings and then write all the results to a file. I can see the settings and the values in the Python console by doing this for each of the settings | |

Re: Re: Issue in using "subprocess.Popen" for parsing the command output

2018-11-25 Thread Chris Angelico
On Mon, Nov 26, 2018 at 5:40 AM srinivasan wrote: > > Dear Karsten, > > With the help of Mrab Inputs, I tried Even with "return > stdout.strip().decode("utf-8")", it still seems to be an issue, I am using > python 3.6, is this causing a issue? No, it isn't. Two things are causing most of your is

Re: Re: Issue in using "subprocess.Popen" for parsing the command output

2018-11-25 Thread srinivasan
Dear Karsten, With the help of Mrab Inputs, I tried Even with "return stdout.strip().decode("utf-8")", it still seems to be an issue, I am using python 3.6, is this causing a issue? /home/srinivasan/Downloads/wifidisconnectissuenov23_homework/venv/bin/python /home/srinivasan/Downloads/wifidiscon

Re: Re: Generators, generator expressions, and loops

2018-11-16 Thread Peter via Python-list
Lovely, succinct answers. On 17/11/2018 2:44 AM, Ian Kelly wrote: On Fri, Nov 16, 2018 at 7:57 AM Steve Keller wrote: I have looked at generators, generator expressions, and iterators and I try to get more familiar with these. 1. How would I loop over all (with no upper bound) integers or al

Re: Re: PEP 394

2018-10-20 Thread Chris Angelico
On Sun, Oct 21, 2018 at 12:41 PM Peter via Python-list wrote: > > I'd imagine the PEP would stay as active, but changed so that: > > python2 -> always refers to python v2 > python3 -> always refers to python v3 > python -> which currently refers to python v2 will change to point to > python v3 Th

Re: Re: PEP 394

2018-10-20 Thread Peter via Python-list
I'd imagine the PEP would stay as active, but changed so that: python2 -> always refers to python v2 python3 -> always refers to python v3 python -> which currently refers to python v2 will change to point to python v3 I don't know when the core team would be considering this. The PEP was las

Re: Re: Python indentation (3 spaces)

2018-10-07 Thread Peter via Python-list
It's also useful to be aware of the standard tabnanny module for "Detection of ambiguous indentation". Very useful for highlighting problems with tabs and spaces. Peter On 8/10/2018 2:32 AM, Terry Reedy wrote: On 10/5/2018 11:30 PM, Ryan Johnson wrote: The point that OP is trying to make is

Re: Re : So apparently I've been banned from this list

2018-10-02 Thread Ethan Furman
On 10/02/2018 03:40 PM, armand.fouca...@telecom-bretagne.eu wrote: Hello there, I'm quite new here. Welcome! I'm sorry to interfere, but this thread is only creating noise on this list. You are correct. This thread is now closed. Is there a place where such topics can be debated, other

Re: Re[2]: [OT] master/slave debate in Python

2018-09-26 Thread Ian Kelly
On Wed, Sep 26, 2018 at 3:10 PM Brian Grawburg wrote: > > This is right next to the objection of the use male and female to describe > the two parts of a connector. I lament that snowflakes and such are trying > desperately to enforce their quest for radical egalitarianism and see hidden > agen

Re: Re: CURSES WINDOWS

2018-09-05 Thread Peter via Python-list
I get this: C:\Users\Me> py Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Inte l)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import curses Traceback (most recent call last):   File "", line 1, in   File "C:\Program Files

Re: Re: name 'aLOCK' is not defined When I add aLOCK = threading.RLock() behind if __name__ == "__main__"

2018-08-09 Thread Karsten Hilbert
On Fri, Aug 10, 2018 at 12:24:25AM +0800, xuanwu348 wrote: > Yes, move the code from positionA(can run normally) to positionB(exception > with name undefined) > I find this content > "https://docs.python.org/3.3/tutorial/classes.html#python-scopes-and-namespaces"; > But I still don't undewrstand

Re: Re: FULLSCREEN and DOUBLEBUF

2018-06-12 Thread Paul St George
Dennis Lee Bieber wrote: Both may be dependent upon the actual hardware graphics board and the drivers for said board. On 11/06/2018 01:47, Gregory Ewing wrote: My guess is that if your surface is not fullscreen or is not a hardware surface, then you're always drawing into an ofscreen bu

Re: Re: Re: FULLSCREEN and DOUBLEBUF

2018-06-10 Thread Paul St George
Paul St George wrote: So... print pygame.display.get_surface() gives and print screen.get_flags() gives -2147483648 To recap: this thread started with a question. How do I know whether DOUBLEBUF has been set with: screen = pygame.display.set_mode((720,480), pygame.DOUBLEBUF | pyg

Re: Re: FULLSCREEN and DOUBLEBUF

2018-06-10 Thread Peter Otten
Paul St George wrote: > So... > > print pygame.display.get_surface() > gives > > > and > print screen.get_flags() > gives > -2147483648 > To recap: this thread started with a question. How do I know whether > DOUBLEBUF has been set with: > > screen = pygame.display.set_mode((720,480

Re: Re: FULLSCREEN and DOUBLEBUF

2018-06-10 Thread Paul St George
To recap: this thread started with a question. How do I know whether DOUBLEBUF has been set with:     screen = pygame.display.set_mode((720,480), pygame.DOUBLEBUF | pygame.FULLSCREEN) On 09/06/2018 22:04, Mark Lawrence wrote: On 09/06/18 20:31, Paul St George wrote: print pygame.disp

Re: Re: FULLSCREEN and DOUBLEBUF

2018-06-09 Thread Paul St George
On 08/06/18 09:00, Paul St George wrote: Excellent. Now I know what to do in this instance and I understand the principle. I hesitantly tried this: screen = pygame.display.set_mode((720,480), pygame.FULLSCREEN | pygame.DOUBLEBUF) Hesitantly because I expected the *bitwise or operator

Re: Re: FULLSCREEN and DOUBLEBUF

2018-06-08 Thread Paul St George
Excellent. Now I know what to do in this instance and I understand the principle. I hesitantly tried this:     screen = pygame.display.set_mode((720,480), pygame.FULLSCREEN | pygame.DOUBLEBUF) Hesitantly because I expected the *bitwise or operator* (|) to work like a toggle, so FULLSCREEN o

Re: Re: Re: The PIL show() method looks for the default viewer. How do I change this to a different viewer (of my choice)?

2018-05-31 Thread Paul St George
That's what I wanted! But, I didn't know the question because I didn't know the answer. On 30/05/2018 23:09, Karsten Hilbert wrote: On Wed, May 30, 2018 at 11:01:17PM +0200, Peter J. Holzer wrote: On 2018-05-30 22:08:45 +0200, Paul St George wrote: Ha! No, my question was clumsy. If I know

Re: Re: The PIL show() method looks for the default viewer. How do I change this to a different viewer (of my choice)?

2018-05-30 Thread Karsten Hilbert
On Wed, May 30, 2018 at 11:01:17PM +0200, Peter J. Holzer wrote: > On 2018-05-30 22:08:45 +0200, Paul St George wrote: > > Ha! No, my question was clumsy. > > > > If I know the name of the viewer that I want to use (say for example: > > ‘ImageMagick’), where do I find the argument that should be

Re: Re: The PIL show() method looks for the default viewer. How do I change this to a different viewer (of my choice)?

2018-05-30 Thread Peter J. Holzer
On 2018-05-30 22:08:45 +0200, Paul St George wrote: > Ha! No, my question was clumsy. > > If I know the name of the viewer that I want to use (say for example: > ‘ImageMagick’), where do I find the argument that should be used in a line > of code such as this: > > ImageShow.register(MyViewer("gwe

Re: Re: The PIL show() method looks for the default viewer. How do I change this to a different viewer (of my choice)?

2018-05-30 Thread Paul St George
Ha! No, my question was clumsy. If I know the name of the viewer that I want to use (say for example: ‘ImageMagick’), where do I find the argument that should be used in a line of code such as this: ImageShow.register(MyViewer("gwenview"), -1) I want to replace ‘gwenview’ with the name of my

Re: Re: Re: The PIL show() method looks for the default viewer. How do I change this to a different viewer (of my choice)?

2018-05-30 Thread Paul St George
True, but I wanted to have some control over the image window, fullscreen, colour depth, etc. I am also exploring pygame. I will try your suggestion as it is so much simpler. Being a novice, I had been frightened off using shell=True. See

Re: Re: The PIL show() method looks for the default viewer. How do I change this to a different viewer (of my choice)?

2018-05-29 Thread Ian Kelly
On Sat, May 26, 2018 at 9:17 AM, Paul St George wrote: > Thank you. > You are very right. The show() method is intended for debugging purposes and > is useful for that, but what method should I be using and is PIL the best > imaging library for my purposes? I do not want to manipulate images, I on

Re: Re: Re: Re: The PIL show() method looks for the default viewer. How do I change this to a different viewer (of my choice)?

2018-05-29 Thread Paul St George
Is there, somewhere, a list of viewers and their names (for the purposes of this script)? I am assuming that if I want to ImageMagick (for example), there would be some shorter name - such as 'magick' - and it would be lower case . On 29/05/2018 08:58, Peter Otten wrote: Paul St George wrot

Re: Re: The PIL show() method looks for the default viewer. How do I change this to a different viewer (of my choice)?

2018-05-29 Thread Paul St George
I tried this anyway. The error was:     non-keyword arg after keyword arg On 27/05/2018 21:51, Dennis Lee Bieber wrote: On Sun, 27 May 2018 19:59:41 +0200, Paul St George declaimed the following: So, on Unix I would use Image.show(title=None, nameofdisplayutilty), or Image.show(title=None

Re: Re: The PIL show() method looks for the default viewer. How do I change this to a different viewer (of my choice)?

2018-05-29 Thread Paul St George
Thank you. For the advice, and for the new word 'monkeypatch'. On 27/05/2018 23:58, Cameron Simpson wrote: On 27May2018 20:15, Paul St George wrote: This is very helpful indeed, thank you. Awe-inspiring. It occurred to me that I could edit the PIL/ImageShow.py, replacing ‘xv’ (in five place

Re: Re: The PIL show() method looks for the default viewer. How do I change this to a different viewer (of my choice)?

2018-05-29 Thread Paul St George
Should the PIL code be corrected? On 28/05/2018 06:34, Christian Gollwitzer wrote: Am 27.05.18 um 23:58 schrieb Cameron Simpson: On 27May2018 20:15, Paul St George wrote: This is very helpful indeed, thank you. Awe-inspiring. It occurred to me that I could edit the PIL/ImageShow.py, replaci

Re: Re: Re: The PIL show() method looks for the default viewer. How do I change this to a different viewer (of my choice)?

2018-05-29 Thread Peter Otten
Paul St George wrote: > This is very helpful indeed, thank you. Awe-inspiring. > > It occurred to me that I could edit the PIL/ImageShow.py, replacing ‘xv’ > (in five places) with the utility of my choice and using ‘executable’ as > the command. > > Or, is this just not done? No, this tends to

Re: Re: Re: The PIL show() method looks for the default viewer. How do I change this to a different viewer (of my choice)?

2018-05-27 Thread Paul St George
This is very helpful indeed, thank you. Awe-inspiring. It occurred to me that I could edit the PIL/ImageShow.py, replacing ‘xv’ (in five places) with the utility of my choice and using ‘executable’ as the command. Or, is this just not done? On 26/05/2018 19:11, Peter Otten wrote: Paul St Ge

Re: Re: The PIL show() method looks for the default viewer. How do I change this to a different viewer (of my choice)?

2018-05-27 Thread Paul St George
So, on Unix I would use Image.show(title=None, nameofdisplayutilty), or Image.show(title=None, scriptname) #where script with name scriptname invokes the program I will try this now! And thank you. On 26/05/2018 19:30, Dennis Lee Bieber wrote: On Sat, 26 May 2018 17:17:42 +0200, Paul St Geo

  1   2   3   4   5   6   7   8   9   10   >