Re: learning python ...

2021-05-24 Thread Alan Gauld via Python-list
tional expression while parsing > 'if' statement"). Although wouldn't it be "expected boolean expression" rather than conditional expression? Python doesn't care how the argument to 'if' is arrived at so long as it's a boolean. And with assignment

Re: learning python ...

2021-05-24 Thread Jon Ribbens via Python-list
On 2021-05-24, Alan Gauld wrote: > On 24/05/2021 16:54, Michael F. Stemper wrote: > >> In my early days of writing python, I created lists named "list", >> dictionaries named "dict", and strings named "str". I mostly know better >> now, but so

RE: learning python ...

2021-05-24 Thread Avi Gross via Python-list
I have studied many programming languages and am amused when people attack python as if every other language is somehow more optimal. Cameron and others have provided examples but look at positives AND negatives. Yes code like: num = int(num) does look a tad off as it reuses the same name for

Re: learning python ...

2021-05-25 Thread Alan Gauld via Python-list
On 25/05/2021 00:41, Jon Ribbens via Python-list wrote: > What would you call the argument to a function that > returns, say, an upper-cased version of its input? Probably 'candidate' or 'original' or 'initial' or somesuch. Or even just 's'.

string storage [was: Re: imaplib: is this really so unwieldy?]

2021-05-26 Thread Alan Gauld via Python-list
On 25/05/2021 23:23, Terry Reedy wrote: > In CPython's Flexible String Representation all characters in a string > are stored with the same number of bytes, depending on the largest > codepoint. I'm learning lots of new things in this thread! Does that mean that if I give P

Re: string storage [was: Re: imaplib: is this really so unwieldy?]

2021-05-26 Thread Jon Ribbens via Python-list
f new things in this thread! > > Does that mean that if I give Python a UTF8 string that is mostly single > byte characters but contains one 4-byte character that Python will store > the string as all 4-byte characters? > > If so, doesn't that introduce a pretty big storage ove

Re: string storage [was: Re: imaplib: is this really so unwieldy?]

2021-05-26 Thread Alan Gauld via Python-list
Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

Re: string storage [was: Re: imaplib: is this really so unwieldy?]

2021-05-26 Thread Alan Gauld via Python-list
://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

RE: learning python ...

2021-05-27 Thread Avi Gross via Python-list
HomeWork, Nobody is suggesting that you change your attitude because of one obstacle. But what if EVERYBODY here gives you similar feedback that python IS the way it is irrelevant of what other language designers have chosen or you expect? Even if you propose a change that might be nice but it

Re: Applying winpdb_reborn

2021-05-29 Thread Alan Gauld via Python-list
w to use it. But that book is now over 20 years old and based on Python 1.5.3! but interestingly nearly all the reviewers specifically praised my inclusion of a chapter on debugging. >> I knew the debugging process with Fortran and C, but haven't learned how to >> effectively use pdb t

Re: Applying winpdb_reborn

2021-05-30 Thread Alan Gauld via Python-list
://mail.python.org/mailman/listinfo/python-list

Re: Definition of "property"

2021-05-30 Thread Jon Ribbens via Python-list
r. Perhaps the best > I've found so far is from the Python documentation: > > A property object has getter, setter, and deleter methods usable as > decorators that create a copy of the property with the corresponding > accessor function set to the decorated function. A propert

Re: Definition of "property"

2021-05-30 Thread Alan Gauld via Python-list
s depressing how many books and articles focus on them to the exclusion of all else that make up the OOP paradigm! Anyway, rant over... > I understand what a "property" is, how it is used and the benefits, Do you? What is that based on? Is it how properties are used in OOP? Or how the

Re: Python doesn't work

2021-05-30 Thread Alan Gauld via Python-list
On 30/05/2021 12:23, Mr.Incognito wrote: >Hello > >I downloaded the latest versioon of Python and tried to open several .py >files, but it doesn't open. It opens for a sec, then closes itself. I >tried uninstalling and reinstalling, but it doesn't work.

Re: How to debug python + curses? [was: RE: Applying winpdb_reborn]

2021-05-30 Thread Alan Gauld via Python-list
On 30/05/2021 18:26, [email protected] wrote: > I tried winpdb-reborn some time last year on my Win10 system (python 3.8.3 > at that time), but could not figure out how to use it to debug a python > script that uses the curses module. You are not alone. debugging curses is o

RE: Definition of "property"

2021-05-30 Thread Avi Gross via Python-list
You guys are all very knowledgeable but he is asking what to say to an EDITOR who clearly may know little or nothing about computers and thinks python is a snake and not a language and may need to be spoken to in his own language which understands other forms of abstraction better. So, just for

ANN: distlib 0.3.2 released on PyPI

2021-05-31 Thread Vinay Sajip via Python-list
s/new -- https://mail.python.org/mailman/listinfo/python-list

Re: Definition of "property"

2021-05-31 Thread Jon Ribbens via Python-list
On 2021-05-30, Terry Reedy wrote: > Note: at least one person says a property *pretends* to be an attribute. No, I said it pretends to be a *data* attribute. It is effectively several methods in a trenchcoat pretending to be a variable. -- https://mail.python.org/mailman/listinfo/python-list

Re: Definition of "property"

2021-05-31 Thread Alan Gauld via Python-list
log on Flickr at: http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

Functions as Enum member values

2021-05-31 Thread Colin McPhail via Python-list
. Also, calling type() on a member gave the result instead of the expected . I am using Python 3.9.5 from python.org on macOS 11.4. Below is a small test script and its output. Are my expectations wrong or is there a problem with Enum? Regards, Colin --- from

Re: Functions as Enum member values

2021-05-31 Thread Colin McPhail via Python-list
> On 31 May 2021, at 18:24, Peter Otten <[email protected]> wrote: > > On 31/05/2021 17:57, Colin McPhail via Python-list wrote: >> Hi, >> According to the enum module's documentation an Enum-based enumeration's >> members can have values of any t

Re: Definition of "property"

2021-06-01 Thread Jon Ribbens via Python-list
method. It's just that in most cases the method is implemented > in C and it looks up a value in the object's dict. Sure, if we take the "lowest level" and pretend there are no higher-level structures it's all just electrons doing apparently random things and there's nothing more to be said about it. -- https://mail.python.org/mailman/listinfo/python-list

Re: Definition of "property"

2021-06-01 Thread Alan Gauld via Python-list
On 31/05/2021 01:24, Greg Ewing wrote: > On 31/05/21 8:20 am, Alan Gauld wrote: >> >> That's a very Pythonic description. > > If it's a book about Python, it needs to be. The word "property" > has a very specialised meaning in Python. > >

Re: Definition of "property"

2021-06-01 Thread Jon Ribbens via Python-list
ke its function or retrieve the value it returns. > (I'm assuming that by "data attribute" you mean a piece of > data that's stored directly in the object. If you mean > something else, we might be talking at cross purposes.) I mean it in the sense it is used by the Python documentation. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to debug python + curses? [was: RE: Applying winpdb_reborn]

2021-06-01 Thread Alan Gauld via Python-list
On 31/05/2021 16:16, Grant Edwards wrote: > On 2021-05-30, Alan Gauld via Python-list wrote: >> You are not alone. debugging curses is one of the biggest obstacles to >> its use. > > Can't you just run the debugger in a different window and attach to > the process

Re: Definition of "property"

2021-06-01 Thread Alan Gauld via Python-list
On 31/05/2021 15:59, Dennis Lee Bieber wrote: > On Sun, 30 May 2021 21:20:24 +0100, Alan Gauld via Python-list > declaimed the following: > >> On 30/05/2021 17:57, Irv Kalb wrote: >>> I am doing some writing (for an upcoming book on OOP), and I'm a little >>&

Pandsa to Excel conversion issue

2021-06-01 Thread EK Esawi via Python-list
ke '22.3' via astype or pd.to_numeric is below Unable to parse string "22." at position 0 Thanks in advance EK -- https://mail.python.org/mailman/listinfo/python-list

Re: Neither pdb or print() displays the bug

2021-06-01 Thread Alan Gauld via Python-list
On 01/06/2021 21:18, Rich Shepard wrote: > 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'm stuck with neither appro

fabric: fab command

2021-06-02 Thread jayshankar nair via Python-list
/mailman/listinfo/python-list

Re: fabric: fab command

2021-06-02 Thread Alan Gauld via Python-list
On 02/06/2021 14:35, jayshankar nair via Python-list wrote: > import tools.fab.dev_utils as dev_utilsImportError: No module named > tools.fab.dev_utils > Please let me know which package i have to install. Work backwards. Can you import tools.fab? Can you import tools? Once you know

Re: Replacement for Mailman

2021-06-08 Thread Jon Ribbens via Python-list
On 2021-06-08, D'Arcy Cain wrote: > Given that mailman still runs under 2.7 and that's being deprecated, > does anyone have a suggestion for a replacement? There is always Mailman 3... -- https://mail.python.org/mailman/listinfo/python-list

Re: Replacement for Mailman

2021-06-08 Thread Jon Ribbens via Python-list
On 2021-06-08, Grant Edwards wrote: > On 2021-06-08, Paul Bryan wrote: >> How about Mailman 3.x on Python 3.x? > > According to https://www.gnu.org/software/mailman/requirements.html > mailman 3.x still requires Python 2.7 for the archiver and the web UI. I'm pretty

Re: Replacement for Mailman

2021-06-08 Thread Jon Ribbens via Python-list
On 2021-06-08, Terry Reedy wrote: > On 6/8/2021 4:36 PM, Jon Ribbens via Python-list wrote: >> On 2021-06-08, Grant Edwards wrote: >>> On 2021-06-08, Paul Bryan wrote: >>>> How about Mailman 3.x on Python 3.x? >>> >>> According to https:

jython getting started question

2021-06-11 Thread Steve Pruitt via Python-list
Not sure if this is the right list for jython questions. I am getting started with both python and jython. My use case need is invoking python from java. org.python:jython:2.7.2 loaded ok. To check, I executed the following. ScriptEngineManager manager = new ScriptEngineManager(); List

Re: jython getting started question

2021-06-11 Thread Steve Pruitt via Python-list
Finally found the solution Options.importSite = false; which solved my issue. I can't set Bindings and pass args to script. The only example I found is for JavaScript. I think maybe it doesn't work for jython. Thanks ____ From: Python-list on behal

Re: Tkinter8.6: date picker

2021-06-14 Thread Alan Gauld via Python-list
org/mailman/listinfo/python-list

Re: Terminology: EU language skills, and Master to Main (or ...)

2021-06-14 Thread Alan Gauld via Python-list
On 13/06/2021 04:21, dn via Python-list wrote: > What do you think a professionally-recognisable series of skill-levels > for programmers? This has been done or attempted many times, with perhaps the most complete scheme being the British Computer Society's "Industry Standard Mod

Php vs Python gui (tkinter...) for small remote database app

2021-06-14 Thread Pascal B via Python-list
Hi, I would like to know if for a small app for instance that requires a connection to a remote server database if php is more suitable than Python mainly regarding security. Php requires one port for http and one port for the connection to the database open. If using Python with a tkinter gui

Re: Why the list creates in two different ways? Does it cause by the mutability of its elements? Where the Python document explains it?

2021-06-14 Thread Rob Cliffe via Python-list
This puzzled me, so I played around with it a bit (Python 3.8.3): n = [] for i in range(3):     n.append((1,7,-3,None,"x")) for i in range(3):     n.append((1,7,-3,None,"x")) print([id(x) for x in n]) a = 4 n = [] for i in range(3):     n.append((1,7,-3,a,None,&q

RE: Why the list creates in two different ways? Does it cause by the mutability of its elements? Where the Python document explains it?

2021-06-15 Thread Avi Gross via Python-list
use less space when possible. Now if you really still want true copies, what ways might fool a compiler? NoDup = [(5, 2), (6-1, 6/3), (12%7, 1/1 + 1/1)] -Original Message- From: Python-list On Behalf Of Greg Ewing Sent: Tuesday, June 15, 2021 7:11 PM To: [email protected] Subject

RE: Why the list creates in two different ways? Does it cause by the mutability of its elements? Where the Python document explains it?

2021-06-15 Thread Avi Gross via Python-list
Greg, My point was not to ASK what python does as much as to ask why it matters to anyone which way it does it. Using less space at absolutely no real expense is generally a plus. Having a compiler work too hard, or even ask the code to work too hard, is often a minus. If I initialized the

Re: tkinter: tksheet

2021-06-16 Thread Alan Gauld via Python-list
worth investigating. There is a grid in Tix but its quite hard to use and Tix is now deprecated. It was also a bit unreliable when used from Python (that's euphemistic for "I couldn't get it to work!" :-) But there is nothing I know of for Tkinter that provides views of database

Re: tkinter: tksheet

2021-06-17 Thread Alan Gauld via Python-list
n_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

Re: Strange disassembly

2021-06-18 Thread Rob Cliffe via Python-list
   22 POP_JUMP_IF_FALSE   21 (to 14) 24 LOAD_CONST   0 (None) 26 RETURN_VALUE >>> (there may be mistakes in this) but this is probably too much to expect of the compiler. Rob Cliffe -- https://mail.python.org/mailman/listinfo/python-list

Re: Strange disassembly

2021-06-19 Thread Rob Cliffe via Python-list
On 19/06/2021 07:50, Chris Angelico wrote: On Sat, Jun 19, 2021 at 4:16 PM Rob Cliffe via Python-list wrote: On 18/06/2021 11:04, Chris Angelico wrote: sys.version '3.10.0b2+ (heads/3.10:33a7a24288, Jun 9 2021, 20:47:39) [GCC 8.3.0]' def chk(x): ... if not(0 < x

Re: Anaconda navigator not working

2021-06-20 Thread Rob Cliffe via Python-list
n Windows or somewhere in Python. Can anybody shed light on this? Best wishes Rob Cliffe PS I have a very vague idea it's to do with mixing 32-bit and 64-bit software. On 20/06/2021 05:21, Liya Ann Sunny wrote: After installing Anaconda, I tried to open the anaconda navigator but it did not

RE: Optimizing Small Python Code

2021-06-22 Thread Avi Gross via Python-list
in range(1, last)])) Now why you want this is beyond me! -Original Message- From: Python-list On Behalf Of Greg Ewing Sent: Tuesday, June 22, 2021 7:05 PM To: [email protected] Subject: Re: Optimizing Small Python Code On 23/06/21 3:03 am, Kais Ayadi wrote: > for n in range(1, 7): >

RE: Optimizing Small Python Code

2021-06-23 Thread Avi Gross via Python-list
the string and uncompressed it, you might have code like: print(unzip("n*n&&S!~se")) -Original Message- From: Python-list On Behalf Of Michael F. Stemper Sent: Wednesday, June 23, 2021 10:23 AM To: [email protected] Subject: Re: Optimizing Small Python Code O

RE: Optimizing Small Python Code

2021-06-24 Thread Avi Gross via Python-list
pare the output will be fooled. -----Original Message- From: jan Sent: Thursday, June 24, 2021 3:01 AM To: Avi Gross Cc: [email protected] Subject: Re: Optimizing Small Python Code If I'm not mistaken, the original output is O(n^2) in quantity of chars, and as output time is propo

RE: Optimizing Small Python Code

2021-06-24 Thread Avi Gross via Python-list
like "x" for example, you can write a function y() that builds in the code described or any variant and your program becomes: Import x y() and it would print out whatever you need. If you can get the python interpreter to make that module standard, it can be shorted mo

Re: pyttsx3 installation error

2021-07-02 Thread Roland Mueller via Python-list
What's about installing? https://pypi.org/project/pyttsx3/ pe 2. heinäk. 2021 klo 23.41 Nikita Lohale ([email protected]) kirjoitti: > Traceback (most recent call last): > File "f:\Nikita\Python programming\Iron Man Jarvis AL\jarvis.py", line > 1,

Re: Tkinter widgets for desktop database application

2021-07-14 Thread Alan Gauld via Python-list
hotos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

RE: Searching pypi.org, is there an 'advanced search'?

2021-07-17 Thread Avi Gross via Python-list
2050 results! LOL! https://www.google.com/search?as_q=google+contacts&as_epq=&as_oq=&as_eq=&as_nlo=&as_nhi=&lr=&cr=&as_qdr=all&as_sitesearch=pypi.org&as_occt=any&safe=images&as_filetype=&tbs= -Original Message- From: Python-list On Beha

Re: Where to keep local Python modules?

2021-07-23 Thread Roland Mueller via Python-list
Hello, pe 23. heinäk. 2021 klo 21.44 Chris Green ([email protected]) kirjoitti: > This isn't a question about how to set PYTHONPATH so that Python code > can find imported modules, it's about what is a sensible layout for > one's home directory - i.e. where to put Python

a simple question

2021-07-26 Thread Glenn Wilson via Python-list
I recently downloaded the latest version of python, 3.9.6. Everything works except, the turtle module. I get an error message every time , I use basic commands like forward, backward, right and left. My syntax is correct: pat.forward(100) is an example. Can you tell me what is wrong

RE: a simple question

2021-07-26 Thread Avi Gross via Python-list
the way they probably did not write proper code in the first place that loads the module(s) they need? -Original Message- From: Python-list On Behalf Of Dennis Lee Bieber Sent: Monday, July 26, 2021 9:46 PM To: [email protected] Subject: Re: a simple question On Mon, 26 Jul 2021 22:19

Re: argparse: delimiter for argparse list arguments

2021-08-03 Thread Jon Ribbens via Python-list
it, diff, log, status, etc. It's not completely unlike what you're describing above, which is already supported automatically by argparse. -- https://mail.python.org/mailman/listinfo/python-list

Re: argparse: delimiter for argparse list arguments

2021-08-03 Thread Jon Ribbens via Python-list
On 2021-08-03, Roel Schroeven wrote: > Jon Ribbens via Python-list schreef op 3/08/2021 om 17:48: >> On 2021-08-03, Michael Torrie wrote: >> > On 8/2/21 1:43 PM, Sven R. Kunze wrote: >> >> maybe, I am missing something here but is it possible to specify a >>

Re: Ask for help on using re

2021-08-06 Thread Jon Ribbens via Python-list
u, I've been using it for over 30 years. In any >> case you can find some traces of it in the "regular expressions quick >> reference" on the site https://regex101.com (bottom right side). > > ...if I'm not mistaken, the '|' it is part of normal regula

Re: Flask – how to write csv file & save using prefilled value of the filename (response.headers["Content-Disposition"]="attachment; filename=xxx")

2021-08-09 Thread Roland Mueller via Python-list
; > back to a new CSV file. My python script produces the correct results on > > its own, but I am not able to get the same results when using Flask. I am > > new to flask. > > > [snip] > > > > csv_reader = csv.reader(new) > > > [snip] > > &

Re: some problems for an introductory python test

2021-08-11 Thread Wolfram Hinderer via Python-list
Am 11.08.2021 um 05:22 schrieb Terry Reedy: Python is a little looser about whitespace than one might expect from reading 'normal' code when the result is unambiguous in that it cannot really mean anything other than what it does.  Two other examples: >>> if3: print('

Re: some problems for an introductory python test

2021-08-11 Thread Rob Cliffe via Python-list
On 11/08/2021 19:10, MRAB wrote: On 2021-08-11 18:10, Wolfram Hinderer via Python-list wrote: Am 11.08.2021 um 05:22 schrieb Terry Reedy: Python is a little looser about whitespace than one might expect from reading 'normal' code when the result is unambiguous in that it cannot r

RE: some problems for an introductory python test

2021-08-11 Thread Avi Gross via Python-list
place for anyone to ask such a question, especially as we have no real idea what was taught and expected. Python is too rich a language and can be taught all kinds of ways including many that largely ignore object-orientedness or other ways that professionals use and appreciate. There are lots of

Re: basic auth request

2021-08-17 Thread Jon Ribbens via Python-list
ords are being supplied. -- https://mail.python.org/mailman/listinfo/python-list

Re: basic auth request

2021-08-18 Thread Jon Ribbens via Python-list
On 2021-08-18, Robin Becker wrote: > On 17/08/2021 22:47, Jon Ribbens via Python-list wrote: > ... >> That's only true if you're not using HTTPS - and you should *never* >> not be using HTTPS, and that goes double if forms are being filled >> in and d

Re: tkinter

2021-08-21 Thread Alan Gauld via Python-list
sure you were running Python v3 and not python v2? In v2 tkinter is spelled Tkinter. If that is the issue then reinstalling python v3.x and ensuring that it is the executable used should resolve the issue. Another option might be that you are using virtual environments which could result in all manne

Re: Decoding of EmailMessage text

2021-08-23 Thread Jon Ribbens via Python-list
On 2021-08-23, Loris Bennett wrote: > If instead of > > mail.set_content(body) > > I do > > mail.set_content(body, cte="quoted-printable") Try print(mail.get_content()) rather than print(mail.as_string()) -- https://mail.python.org/mailman/listinfo/python-list

Why Pyto package not available yet ???

2021-08-23 Thread Steeve Kerou via Python-list
Hi,  Here is Pyto, the first animated character that help you Learn Python like you play video games Why not implement me on Python PyPI ??? Episode 1: Intro / Who is Pyto ? / The Idle World | Pytorial | | | | | | | | | | | Episode 1: Intro / Who is Pyto ? / The Idle World

Re: basic auth request

2021-08-25 Thread Jon Ribbens via Python-list
cale DNS hack is probably capable of getting a very > legit-looking SSL cert for the name as well. There are so many trusted CAs these days that the chances of them all being secure approaches zero - they are not all equal yet they are all equally trusted. Which is why a change of CA on a site you have visited before is potentially suspicious. -- https://mail.python.org/mailman/listinfo/python-list

Re: basic auth request

2021-08-25 Thread Jon Ribbens via Python-list
On 2021-08-25, Chris Angelico wrote: > On Thu, Aug 26, 2021 at 12:16 AM Jon Ribbens via Python-list > wrote: >> There are so many trusted CAs these days that the chances of them all >> being secure approaches zero - they are not all equal yet they are all >> equally truste

Re: basic auth request

2021-08-25 Thread Jon Ribbens via Python-list
On 2021-08-25, Chris Angelico wrote: > On Thu, Aug 26, 2021 at 12:48 AM Jon Ribbens via Python-list > wrote: >> Another attempt at combatting this problem is DNS CAA records, >> which are a way of politely asking all CAs in the world except the >> ones you choose "ple

Re: basic auth request

2021-08-25 Thread Jon Ribbens via Python-list
he permitted CAs - since, as you point out, they genuinely own and control the relevant IP address. -- https://mail.python.org/mailman/listinfo/python-list

Re: on writing a while loop for rolling two dice

2021-08-28 Thread Alan Gauld via Python-list
om/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

RE: on writing a while loop for rolling two dice

2021-08-28 Thread Avi Gross via Python-list
[1, 3, 1, 13, 11, 4, 3, 5, 2, 4] And the code can be a tad shorter, LOL! But obviously then you have more overhead than an iterative solution or one using a generator ... -----Original Message- From: Python-list On Behalf Of Alan Gauld via Python-list Sent: Saturday, August 28, 2021 6:52 PM To:

Python UI (was Re: urgent)

2021-08-30 Thread Alan Gauld via Python-list
On 29/08/2021 11:28, Hari wrote: > i was download ur python software but it is like boring user interface I agree it is a boring user interface. Just 3 chevrons: >>> You can change it a little if you want but ultimately its just an invitation to type commands. What kind of interface

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread Alan Gauld via Python-list
gram web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

RE: urgent (actually NOT urgent at all.)

2021-08-31 Thread Avi Gross via Python-list
re ways to add color or even odd characters and graphics to some prompts but who needs sexy? Realistically, many of us do so much of the programming elsewhere as in some editor or environment, and especially a language like python where indentation levels are strictly a part of the language.

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-09-02 Thread Alan Gauld via Python-list
dphotos -- https://mail.python.org/mailman/listinfo/python-list

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-09-02 Thread Alan Gauld via Python-list
.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-09-02 Thread Alan Gauld via Python-list
e reporting and some updates showing as having happened in the future! -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-09-02 Thread Alan Gauld via Python-list
om/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-09-02 Thread Alan Gauld via Python-list
photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-09-03 Thread Alan Gauld via Python-list
people. Most still see it as a benefit because they get longer working daylight. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

Re: Problem with python

2021-09-04 Thread Rob Cliffe via Python-list
Well, up to a point. In Python 2 the output from     print 1, 2 is '1 2' In Python 3 if you add brackets:     print(1, 2) the output is the same. But if you transplant that syntax back into Python 2, the output from     print(1, 2) is '(1, 2)'.  The brackets have turned two s

CPython / Decimal and bit length of value.

2021-09-04 Thread Nacnud Nac via Python-list
to be able to call. It'd be nice to just be able to tell the "size of data", or something like that, that was stored in the *data? I note there is len "field" in the structure mpd_t Sorry for the dumb question Thanks,Duncan -- https://mail.python.org/mailman/listinfo/python-list

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-09-04 Thread Alan Gauld via Python-list
issue - except we'd be an hour out of sync with the EU. (Post Brexit that may not be seen as a problem!! :-) -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

RE: on writing a while loop for rolling two dice

2021-09-06 Thread Avi Gross via Python-list
ave one extra put it here. If you have two, put one here and one there. My method had all kinds of bells and whistles that this specific case did not need. Let me end with asking if anyone has ever seen a mild variant of this: ... # code while false apologize() ... # more code -Original M

RE: on writing a while loop for rolling two dice

2021-09-06 Thread Avi Gross via Python-list
something kills ...) In languages like C/C++ there are people who make up macros like: #define INDEFINITELY_LOOP while (true) Or something like that and then allow the preprocessor to replace INDEFINITELY_LOOP with valid C code. So, how to do something like that in python, is a challenge left to

RE: on writing a while loop for rolling two dice

2021-09-06 Thread Avi Gross via Python-list
t, rather than within many existing parts. Has anyone mentioned the really stupid looking forever loop in languages with the other style of for loop? for ( ; ;) All that generally was, was an initialization command before a while and so on but here all three parts were null, so why use it? And

RE: on writing a while loop for rolling two dice

2021-09-06 Thread Avi Gross via Python-list
I hate to quibble but as almost anything in Python can evaluate to being truthy, a command like while "never" evaluates to true as the string is not empty. I meant a generator like >>> def boring(): while True: yield() >>> for _ in boring

RE: on writing a while loop for rolling two dice

2021-09-06 Thread Avi Gross via Python-list
ormal then head off into hyperspace at warp speed. Python too has a way to write fairly unsophisticated programs as well as idioms and methods that rapidly become hard to comprehend. -Original Message----- From: Python-list On Behalf Of Stefan Ram Sent: Monday, September 6, 2021 7:49 PM To: p

RE: on writing a while loop for rolling two dice

2021-09-07 Thread Avi Gross via Python-list
the one to use beyond that point. So, I am not sanguine on trying to enforce some standards to make your code easy to read by others and am more a fan of suggesting enough comments in the code to guide anyone on your own idiosyncratic uses. -Original Message- From: Python-list On Behalf Of

Re: on writing a while loop for rolling two dice

2021-09-07 Thread Alan Gauld via Python-list
?!) for a while. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

RE: on writing a while loop for rolling two dice

2021-09-07 Thread Avi Gross via Python-list
them when it seems reasonable. And, a smart person, if they see nothing new, might just go back to their old language or ... Pick a language that easily supports regular expressions and object creation and functional programming and so on, like python, and ask why you might want to use it to simulate

RE: on writing a while loop for rolling two dice

2021-09-07 Thread Avi Gross via Python-list
to do what you want. But if you have developed your own package and want to guarantee the user does not undo your work in specific cases, you should also call some things as explicitly within your own namespace. Back to Python, it is a tad too flexible in some places and my point was that it would

RE: on writing a while loop for rolling two dice

2021-09-08 Thread Avi Gross via Python-list
Charles, This forum is for python discussions so I will clarify that there is nothing wrong with making up a new language, including by bootstrapping an old language. But why not call it new and do not try to confuse people using the old. Python has grown and added much over the years and even

Re: Change the display style of the text on the STACKLINE.

2021-09-09 Thread Roland Mueller via Python-list
d:M-b' Replace D and M with _D_, _M_ >>> percol.view.STACKLINE = re.sub(r'([DM])', r'_\1_', percol.view.STACKLINE) 'Fold:F1,F2,F3 Push:C-p Pop:_M_-p Script:_M_-s _D_ir:_M_-d _D_ircmd:_M_-b' Regards, Roland > How to achieve this purpose? >

Re: Change the display style of the text on the STACKLINE.

2021-09-09 Thread Roland Mueller via Python-list
95m' > OKBLUE = '\033[94m' > OKGREEN = '\033[92m' > WARNING = '\033[93m' > FAIL = '\033[91m' > ENDC = '\033[0m' > LIGHTCYAN = '\033[1;36m' > LIGHTGRAY = '\033[0;37m' >

Re: Friday Finking: Contorted loops

2021-09-10 Thread Alan Gauld via Python-list
On 09/09/2021 22:36, dn via Python-list wrote: > Even in fairly modest Python constructs, we quickly repeal the one-in, > one-out philosophy because try...except operates by providing another > exit-path. Exceptions are exceptional by their nature (or should be!) As such they can ar

Re: Friday Finking: Contorted loops

2021-09-10 Thread Alan Gauld via Python-list
are available? In my experience of using Pascal (and much later with Delphi) that I used repeat loops at least as often as while loops, possibly more. But using Python and to a lesser extent C (which has a rather horrible do/while) construct I use while loops (often with an if-break) simply because tha

<    32   33   34   35   36   37   38   39   40   41   >