[pysqlite] How do I use pysqlite in a multi-threading env.?

2005-05-19 Thread F. GEIGER
In my wxPython-app a part of it gathers data, when a button is pressed, and stores it into a db. The GUI part should display the stuff being stored in the db. When both parts work on the same connection, I get "SQL statements in progress errors". Seems ok to me, you can't do that. So, next step:

Re: [pysqlite] How do I use pysqlite in a multi-threading env.?

2005-05-21 Thread F. GEIGER
"Gerhard Haering" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] I've completely rewritten the db handling stuff, which formerly did too much behind the scenes (explicit is better than implicit...). Now everything looks much better. No unexpected errors and - most important - l

Re: firebird and unicode

2005-05-23 Thread F. Petitjean
Le Mon, 23 May 2005 09:30:31 GMT, flupke a écrit : > It's like jumping over a fence with barb wire. > You know your balls might be in danger but > sometimes you got to take a risk :) +1 QOTW > > I hope i don't end up singing with a funny voice ;) -- http://mail.python.org/mailman/listinfo/pyth

Re: what is addMethod ?

2005-05-23 Thread F. Petitjean
Le 23 May 2005 02:40:57 -0700, [EMAIL PROTECTED] a écrit : > Hello, > >I saw some python open source project with many > self.addMethod() functions (with 3 paramters) Which "open source project" ? Which class in which module ? > > What does self.addMethod() is good for ? > Find where this m

[pysqlite 2.0.2] UnicodeDecodeError: 'utf8' codec can't decode bytes in position 44-45: invalid data

2005-05-27 Thread F. GEIGER
A fetchall() call causes the above error. There must be some non-utf8 chars in the table in question and - indeed - there very likely are: The table contains pathnames of files on the harddisk of a German "speaking" PC. What I have already done to try to overcome this is: - Inserted "# coding: iso

[pysqlite] Equivalent for SHOW TABLES?

2005-05-27 Thread F. GEIGER
For now, the names of the tables, the app knows of, are added into an internal list, when the app is started. Then, when queries fail, the app knoes that it has to create them. It would be nice somehow to be able to ask the database what tables it contains. Is anyone doing this that way? How do yo

Re: Threading questions

2005-05-28 Thread F. GEIGER
Just an idea: You could have n data collector threads, that all put their results into a queue connected to 1 db thread, that stores the results into the db. Cheers Franz GEIGER "Antal Rutz" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Hi, All! > > I'm new to threading. I

Re: 2D vector graphics Problem

2005-05-29 Thread F. GEIGER
> xRel, yRel = self.relPoint # The rotation should be relative to this Shouldn't it be x -= xRel y -= yRel xR = x * cos(phi) - y * sin(phi) yR = x * sin(phi) + y * cos(phi) then? Regards Franz GEIGER "Karl Max" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Hi all, > > I

Re: eric3 question

2005-05-30 Thread F. Petitjean
Le Tue, 31 May 2005 03:13:31 +0400, Alexander Zatvornitskiy a écrit : > Hello All! > > I'am using eric3 IDE under win32 (snapshot 2005-04-10), and have a trouble. I > use this code: > print "enter q to quit, or smthing else to continue" > while not sys.stdin.readline()=="q": > smth

Re: decimal and trunkating

2005-06-02 Thread F. Petitjean
Le Thu, 02 Jun 2005 19:59:08 +1000, Timothy Smith a écrit : > i want to trunkate 199.999 to 199.99 round(199.999, 2) # 2 digits after the decimal point > do i really have to use floats to do this? 19.999 is a float : type(19.999) is float # ==> True -- http://mail.python.org/mailman/listin

Re: __init__.py in packages

2005-06-08 Thread F. Petitjean
Le Wed, 08 Jun 2005 10:34:38 -0500, Gary Wilson Jr a écrit : > I'm creating a python package foo. > > What is intended use for __init__.py files? > Well, I found this: http://www.python.org/doc/essays/packages.html >>From what I can gather it is for initialization of the package when doing an > im

Re: What is different with Python ?

2005-06-13 Thread F. Petitjean
Le Mon, 13 Jun 2005 07:53:03 -0400, Roy Smith a écrit : > Python let's you concentrate on the real universal > fundamentals of data structures, algorithms, and control flow without > getting bogged down in details. +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

Error in random module, bad installation?

2007-09-12 Thread Andrew F
I'm a linux user and I just upgraded from 2.1 to 2.5 and changed the location of a number of libraries and tools. So far I've tracked most errors, but this one has me scratching my head : $ which python /usr/local/bin/python $ echo $PYTHONPATH /usr/local/bin/python $ python Python 2.5.1 (r251:548

Re: Error in random module, bad installation?

2007-09-13 Thread Andrew F
On Sep 13, 12:57 am, Tim Roberts <[EMAIL PROTECTED]> wrote: > Andrew F <[EMAIL PROTECTED]> wrote: > >I'm a linux user and I just upgraded from 2.1 to 2.5 and changed the > >location of a number of libraries and tools. > > >So far I've tracked most err

Re: Requesting direction for installation problem

2008-11-27 Thread F. Rentsch
Bruno Desthuilliers wrote: Frederic Rentsch a écrit : Hi, Where can one get assistance if a Windows installation service fails to install an msi installer? I used to download zip files, but they seem to have been replaced with msi files. I know this issue is off topic here. So my question si

POP3 Mail Download

2006-03-18 Thread Kevin F
Having some troubles downloading messages with POP3... I can connect to the server just fine and list messages without any problem with the following code: from poplib import * server = POP3("mail.bluebottle.com") print server.getwelcome() print server.user("[EMAIL PROT

Re: POP3 Mail Download

2006-03-18 Thread Kevin F
Dennis Lee Bieber wrote: > On Sat, 18 Mar 2006 16:44:44 -0500, Kevin F <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >> However, if I try to actually download the messages themselves, my >> python editor highlights 'msgSize' and

Re: Getting .NET SDK to work with Python 2.4.2

2006-03-18 Thread Kevin F
Dave wrote: > I searched the usenet and some mail archives and tried various > techniques, but I can't seem to get the .NET 2.0 SDK to work with > python. I'm a total newbie when it comes to python installs. I > downloaded the .NET 2.0 SDK and I have python 2.4.2 and im trying to > install zope. So

Re: Getting .NET SDK to work with Python 2.4.2

2006-03-18 Thread Kevin F
;)[1] if(msgSize < 2): message = server.retr(msgNum)[1] message = join(message, "\n") emails.append(message) Kevin F wrote: > Dave wrote: >> I searched the usenet and some mail archives and tried various >> techniques, but I can't seem to get the .NE

Re: POP3 Mail Download

2006-03-18 Thread Kevin F
Dennis Lee Bieber wrote: > On Sat, 18 Mar 2006 17:24:05 -0500, Kevin F <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> I fixed the indentation to: >> >> emails = [] >> for msg in messagesInfo: >> msgNum = int(split(msg

Re: POP3 Mail Download

2006-03-18 Thread Kevin F
Paul McGuire wrote: > "Kevin F" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Dennis Lee Bieber wrote: >>> On Sat, 18 Mar 2006 16:44:44 -0500, Kevin F <[EMAIL PROTECTED]> >>> declaimed the following in comp.lang.python: >

pop3 mail download - using python.org example

2006-03-18 Thread Kevin F
i'm trying to this this code to access my pop server but it only prompts for a password and not a username, how do i get it to ask for my username as well? ##from http://docs.python.org/lib/pop3-example.html import getpass, poplib M = poplib.POP3('localhost') M.user(getpass.getuser()) M.pass_

IMAP Folder Size Information

2006-03-19 Thread Kevin F
I'm trying to use the following code to get my remote server's folder size information. Unfortunately, i'm getting the error: Traceback (most recent call last): File "/Life/School/Homework/Spring 2006/OPIM 399/Tutorial/IMAP/mailboxsize.py", line 23, in -toplevel- number_of_messages_al

IMAP Checking Folder Size

2006-03-20 Thread Kevin F
I'm trying to use the following code to get my remote server's folder size information. Unfortunately, i'm getting the error: Traceback (most recent call last): File "/Life/School/Homework/Spring 2006/OPIM 399/Tutorial/IMAP/mailboxsize.py", line 23, in -toplevel- number_of_messages_al

parsing downloaded mail via POP3

2006-03-22 Thread Kevin F
I have the following script: emails = [] for msg in messagesInfo: msgNum = int(msg.split()[0]) msgSize = int(msg.split()[1]) if(msgSize < 2): message = server.retr(msgNum)[1] Message = join(message, “\n”) emails.append(message) It downloads

newbie question

2006-03-22 Thread Kevin F
what does it mean when there are [0] or [1] after a variable? e.g. print 'Message %s\n%s\n' % (num, data[0][1]) -- http://mail.python.org/mailman/listinfo/python-list

searching imap mail folder but excluding one subfolder

2006-03-22 Thread Kevin F
I have code that searches under the default folder (inbox) but I would like to modify it to search for everything in that folder with the exception of one subfolder where I would like it not to search. my current code is: from imaplib import * import getpass server = IMAP4("webmail.x.

where is os.path.expanduser?

2006-03-23 Thread Kevin F
where is this code looking for the .imap file? I am on OSX and am not sure where to put the file it is looking for. f = open(os.path.expanduser('~/.imap')) -- http://mail.python.org/mailman/listinfo/python-list

os.path.expanduser ... where is this?

2006-03-23 Thread Kevin F
I have a code that opens an .imap file in os.path.expanduser. Unfortunately, I am on OS X and have no idea where that directory is. I am wondering how I can change this code to just open the .imap file in the directory where the code is saved. f = open(os.path.expanduser('~/.imap

Re: where is os.path.expanduser?

2006-03-23 Thread Kevin F
Peter Otten wrote: > Kevin F wrote: > >> where is this code looking for the .imap file? I am on OSX and am not >> sure where to put the file it is looking for. >> >> f = open(os.path.expanduser('~/.imap')) > > Your interactiv

IMAP mailwatcher w/Tkinter

2006-03-23 Thread Kevin F
er import * PollInterval = 60 # seconds def getimapaccount(): try: f = open(('info.imap')) except IOError, e: print 'Unable to open ~/.imap: ', e sys.exit(1) global imap_server, imap_user, imap_password try: imap_server,

IMAP Tkinter Issue

2006-03-23 Thread Kevin F
python import imaplib, string, sys, os, re, rfc822 from Tkinter import * PollInterval = 60 # seconds def getimapaccount(): try: f = open(('info.imap')) except IOError, e: print 'Unable to open ~/.imap: ', e sys.exit(1) global imap_serv

Cannot send email

2010-07-15 Thread G F
A while back I was working for a company and set up a little python script to send out maintenance emails for some equipment we had set up in the field. The script collected information about the equipment composed an email and sent it out to interested persons. Then I left the company and they

pyserial and end-of-line specification

2017-07-14 Thread F S
I just started using Python and I am writing code to access my serial port using pyserial. I have no problem with unix based text coming in the stream using a LF (0x0A) record separator. I also am using unblocked IO. However I have some sensor devices that use the windows CRLF (0x0A,0x0D) record

Re: [ANN] Python 2.5.6 Release Candidate 1

2011-04-18 Thread Werner F. Bruhin
On 04/17/2011 11:57 PM, "Martin v. Löwis" wrote: http://www.python.org/2.5.6 Just FYI, getting a 404 error on the above. I can see a 2.5.6c1 listes on "http://www.python.org/download/releases/2.5/highlights/"; which goes to "http://www.python.org/download/releases/2.5.6/"; Werner --

Re: This newsgroup (comp.lang.python) may soon be blocked by Google Gro

2018-02-11 Thread Michael F. Stemper
capability? I'm surprised. I'm with Charter and the only external IP address is for the cable modem (I think). "icanhazip" shows the same one, no matter which computer I use. -- Michael F. Stemper Psalm 94:3-6 -- https://mail.python.org/mailman/listinfo/python-list

Re: Can't Uninstall !

2018-02-12 Thread Michael F. Stemper
did you install two different 3.x versions? -- Michael F. Stemper Indians scattered on dawn's highway bleeding; Ghosts crowd the young child's fragile eggshell mind. -- https://mail.python.org/mailman/listinfo/python-list

Re: This newsgroup (comp.lang.python) may soon be blocked by Google Gro

2018-02-13 Thread Michael F. Stemper
On 2018-02-10 16:40, Chris Angelico wrote: On Sun, Feb 11, 2018 at 8:52 AM, Chris Green wrote: Michael F. Stemper wrote: On 2018-02-09 13:37, Chris Green wrote: Use ssh (is that available at worK?) to connect from work to home Your ISP provides that capability? I'm surprised

Re: Suggestions on programming in Python an email simple client

2018-02-15 Thread Michael F. Stemper
er be provided interactively -- Michael F. Stemper Soglin for governor. -- https://mail.python.org/mailman/listinfo/python-list

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-21 Thread Michael F. Stemper
ntroduction to Programming and Problem Solving With Pascal_; Schneider, Weingart, and Perlman; (C) 1978 [2] Kernighan examines a similar issue in Section 2.1 of "Why Pascal is Not My Favorite Programming Language", <http://www.cs.virginia.edu/~cs655/readings/bwk-on-pascal.html> -- Mi

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-21 Thread Michael F. Stemper
ntroduction to Programming and Problem Solving With Pascal_; Schneider, Weingart, and Perlman; (C) 1978 [2] Kernighan examines a similar issue in Section 2.1 of "Why Pascal is Not My Favorite Programming Language", <http://www.cs.virginia.edu/~cs655/readings/bwk-on-pascal.html -- Micha

Re: help me ?

2018-02-27 Thread Michael F. Stemper
27;1b', '1c', '2a', '2b', '2c', '3a', '3b', '3c' ] That's absolutely wonderful! However, I'd like to suggest one change, which would allow greater CPU utilization: for i in a: for j in b: # Sorry, I'm not PEP-8 compliant result = [ '1a', '1b', '1c', '2a', '2b', '2c', '3a', '3b', '3c' ] -- Michael F. Stemper Always remember that you are unique. Just like everyone else. -- https://mail.python.org/mailman/listinfo/python-list

Style for docstring

2022-04-22 Thread Michael F. Stemper
#x27;s odd.) Returns True if permutation is even, False if it is odd. (Before somebody suggests it, I'm not going to put six weeks' worth of a course in group theory in there to help somebody who doesn't know what those standard terms mean.) -- Michael F. Stemper 87.3% of all stat

Re: Style for docstring

2022-04-22 Thread Michael F. Stemper
On 22/04/2022 14.59, Chris Angelico wrote: On Sat, 23 Apr 2022 at 05:56, Michael F. Stemper wrote: I'm writing a function that is nearly self-documenting by its name, but still want to give it a docstring. Which of these would be best from a stylistic point of view: Tells caller wh

Re: Style for docstring

2022-04-23 Thread Michael F. Stemper
nk about before breakfast, or even  after, odd as that may seem, ... I see what you did there :-> -- Michael F. Stemper Psalm 94:3-6 -- https://mail.python.org/mailman/listinfo/python-list

Re: Style for docstring

2022-04-23 Thread Michael F. Stemper
On 22/04/2022 16.12, alister wrote: On Fri, 22 Apr 2022 14:36:27 -0500, Michael F. Stemper wrote: I'm writing a function that is nearly self-documenting by its name, but still want to give it a docstring. Which of these would be best from a stylistic point of view: for guidance I

Re: Style for docstring

2022-04-24 Thread Michael F. Stemper
ation will cause an exception, so the function won't return. >>> d = {'1':'2', '2':'2', '3':'3'} >>> pg.ValidateDict(d) False >>> If I was to do it over, I would have named this function something like IsValidPermutation(), hiding the internal representation as well as making the function's Boolean nature explicit. -- Michael F. Stemper No animals were harmed in the composition of this message. -- https://mail.python.org/mailman/listinfo/python-list

Re: Style for docstring

2022-04-24 Thread Michael F. Stemper
On 24/04/2022 08.24, Michael F. Stemper wrote: On 23/04/2022 12.43, Avi Gross wrote: Given what you added, Michael, your function is part of a larger collection of functions and being compatible with the others is a valid consideration. Whatever you decide, would ideally be done consistently

Changing calling sequence

2022-05-11 Thread Michael F. Stemper
risky, as well as being a bunch of work. (Admittedly, I'd only do it once.) The third is really klunky, but wouldn't need to touch anything besides this function. What are others' thoughts? Which of the approaches above looks least undesirable (and why)? Can anybody see a fourt

Re: Changing calling sequence

2022-05-12 Thread Michael F. Stemper
function seems a lot simpler that any of my ideas. I think that I'll even use the name from your example. Thanks to all who posted, as well as the many lurkers who support me in email. -- Michael F. Stemper Economists have correctly predicted seven of the last three recessions. --

Re: Automatic Gain Control in Python?

2022-05-29 Thread Michael F. Stemper
as already shown the rudiments of urllib. Another option to consider is the use of something like curl or wget to download the podcasts, which can be automated separately from your replay program. -- Michael F. Stemper This email is to be read by its intended recipient only. Any other party reading i

min, max with position

2022-06-04 Thread Michael F. Stemper
lso its position? >>> specialmin(l) (0,1.618033) >>> specialmax(l) 3.141593 >>> -- Michael F. Stemper I feel more like I do now than I did when I came in. -- https://mail.python.org/mailman/listinfo/python-list

Re: min, max with position

2022-06-04 Thread Michael F. Stemper
On 04/06/2022 13.56, Dennis Lee Bieber wrote: On Sat, 4 Jun 2022 13:36:26 -0500, "Michael F. Stemper" declaimed the following: Are there similar functions that return not only the minimum or maximum value, but also its position? If it isn't in the library refer

Re: min, max with position

2022-06-05 Thread Michael F. Stemper
On 04/06/2022 14.08, Stefan Ram wrote: "Michael F. Stemper" writes: Are there similar functions that return not only the minimum or maximum value, but also its position? The maximum value does not need to have a unique position. Which is something that I'll just ha

Re: Function to Print a nicely formatted Dictionary or List?

2022-06-09 Thread Michael F. Stemper
/pprint.html from pprint import pprint pprint(thing) >>> from pprint import pprint >>> d = {'two':2, 'three':5} >>> pprint(d) {'three': 5, 'two': 2} >>> This is all on one line. That might be acceptable to the OP, but it doe

Re: fill out bulletins

2022-06-13 Thread Michael F. Stemper
t, so that your recipients can (if they so desire) search on that text, or copy/paste from your bulletin. Somebody suggested TeX/LaTeX. Excellent idea. -- Michael F. Stemper A preposition is something you should never end a sentence with. -- https://mail.python.org/mailman/listinfo/python-list

Why isn't there a built-in product()?

2022-07-07 Thread Michael F. Stemper
Does anybody here know why that was not included in the language? It seems as if it would be useful, so there must have been some rationale for that decision. -- Michael F. Stemper 87.3% of all statistics are made up by the person giving them. -- https://mail.python.org/mailman/listinfo/python-list

Re: Why isn't there a built-in product()?

2022-07-09 Thread Michael F. Stemper
On 07/07/2022 19.06, Oscar Benjamin wrote: On Thu, 7 Jul 2022 at 22:55, Michael F. Stemper wrote: sum() is wonderful. I understand that there is no product() or prod(). Does anybody here know why that was not included in the language? It seems as if it would be useful, so there must have

Re: calculate diff between dates

2022-07-14 Thread Michael F. Stemper
ates?" >>> import datetime >>> d1 = datetime.date(2022,1,1) >>> d2 = datetime.date(2022,7,12) >>> d2-d1 datetime.timedelta(192) >>> -- Michael F. Stemper If it isn't running programs and it isn't fusing atoms, it's just bending space. -- https://mail.python.org/mailman/listinfo/python-list

Re: random.SystemRandom().randint() inefficient

2022-07-27 Thread Michael F. Stemper
>>> to_try = [2,3,5,7,11,13,"seventeen",19] >>> choice(to_try) 2 >>> choice(to_try) 'seventeen' >>> choice(to_try) 13 >>> choice(to_try) 5 >>> -- Michael F. Stemper This sentence no verb. -- https://mail.python.org/mailman/listinfo/python-list

Re: Coffee

2022-08-30 Thread Michael F. Stemper
cent video "Coffee with Brian Kernighan". For those who'd like to see the whole chat: <https://www.youtube.com/watch?v=GNyQxXw_oMQ> -- Michael F. Stemper Deuteronomy 24:17 -- https://mail.python.org/mailman/listinfo/python-list

Re: Regarding python 3.10 installation

2022-09-19 Thread Michael F. Stemper
password and IP address. -- Michael F. Stemper Psalm 82:3-4 -- https://mail.python.org/mailman/listinfo/python-list

Re: TkSheet

2022-10-08 Thread Michael F. Stemper
On 08/10/2022 07.58, Benny Rieger wrote: What a great work;-) I need a solution for save my tabel as csv. How to do that? Has someone a solution for that? Is this what you're seeking? <https://www.pythontutorial.net/python-basics/python-write-csv-file/> -- Michael F. Stemper

Re: What to use for finding as many syntax errors as possible.

2022-10-10 Thread Michael F. Stemper
mething similar that I could do in python. -- Michael F. Stemper 87.3% of all statistics are made up by the person giving them. -- https://mail.python.org/mailman/listinfo/python-list

Re: for -- else: what was the motivation?

2022-10-10 Thread Michael F. Stemper
ww.dabeaz.com/generators/Generators.pdf> -- Michael F. Stemper Life's too important to take seriously. -- https://mail.python.org/mailman/listinfo/python-list

Re: Find the path of a shell command

2022-10-12 Thread Michael F. Stemper
in /usr/bin. On two different versions of Ubuntu, it's in /bin. -- Michael F. Stemper Psalm 94:3-6 -- https://mail.python.org/mailman/listinfo/python-list

Re: Passing information between modules

2022-11-19 Thread Michael F. Stemper
n append to sys.argv. However, it seems like an incredibly bad idea. -- Michael F. Stemper The name of the story is "A Sound of Thunder". It was written by Ray Bradbury. You're welcome. -- https://mail.python.org/mailman/listinfo/python-list

Top level of a recursive function

2022-12-13 Thread Michael F. Stemper
uot; + x + fred(cf[1:],False) + ")" else: if toplevel: return x else: return "(" + x + ")" Aside from being ugly, this lets the caller diddle with "toplevel", which shouldn't really be externally modifiable. Are there better ways to d

Re: Top level of a recursive function

2022-12-13 Thread Michael F. Stemper
On 13/12/2022 09.03, Stefan Ram wrote: "Michael F. Stemper" writes: def fred(cf,toplevel=True): x = cf[0] if len(cf)>1: if toplevel: return x + fred(cf[1:],False) else: return "(" + x + fred(cf[1:],False) + ")" else: if to

Re: String to Float, without introducing errors

2022-12-19 Thread Michael F. Stemper
quot;. For more detail, see: <https://en.wikipedia.org/wiki/Uncertainty#Measurements> -- Michael F. Stemper Isaiah 58:6-7 -- https://mail.python.org/mailman/listinfo/python-list

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

2021-01-12 Thread Michael F. Stemper
On 12/01/2021 10.40, Michael F. Stemper wrote: Modeling of electric power systems: - load behavior in response to conservation load reduction Sorry, that should have been "conservation voltage reduction". -- Michael F. Stemper Psalm 82:1-4 -- https://mail.python.org/mailman/listi

Re: why sqrt is not a built-in function?

2021-01-15 Thread Michael F. Stemper
e most use currently are c, EcmaScript, python, and Java. Of these, only EcmaScript has Math.sqrt() as part of the language, and that could be partly due to the fact that the language doesn't have any concept of "import" or "include". -- Michael F. Stemper This email is to be

Re: why sqrt is not a built-in function?

2021-01-15 Thread Michael F. Stemper
On 15/01/2021 14.00, Chris Green wrote: Michael F. Stemper wrote: On 14/01/2021 13.00, Rob Cliffe wrote: On 14/01/2021 17:44, Denys Contant wrote: I don't understand why sqrt is not a built-in function. Why do we have to first import the function from the math module? I use it ALL THE

Re: why sqrt is not a built-in function?

2021-01-15 Thread Michael F. Stemper
On 15/01/2021 14.02, Chris Angelico wrote: On Sat, Jan 16, 2021 at 6:21 AM Michael F. Stemper wrote: Here's the status of the square root function in various languages, in the order that I encountered them: FORTRANPart of the language Pascal Part of the language SNOBOL Part o

Re: why sqrt is not a built-in function?

2021-01-15 Thread Michael F. Stemper
On 15/01/2021 14.01, Stefan Ram wrote: "Michael F. Stemper" writes: Of these, only EcmaScript has Math.sqrt() as part of the language, and that could be partly due to the fact that the language doesn't have any concept of "import" or &

Re: why sqrt is not a built-in function?

2021-01-15 Thread Michael F. Stemper
On 15/01/2021 15.26, Stefan Ram wrote: "Michael F. Stemper" writes: On 15/01/2021 14.01, Stefan Ram wrote: __import__( "math" ).sqrt( 4 ) I had no idea that syntax existed, and find it completely at odds with The Zen of Python. I'm torn between forgetting that I eve

Re: why sqrt is not a built-in function?

2021-01-15 Thread Michael F. Stemper
On 15/01/2021 16.01, Chris Angelico wrote: On Sat, Jan 16, 2021 at 8:56 AM Michael F. Stemper wrote: On 15/01/2021 15.26, Stefan Ram wrote: "Michael F. Stemper" writes: On 15/01/2021 14.01, Stefan Ram wrote: __import__( "math" ).sqrt( 4 ) I had no idea that syntax

Re: why sqrt is not a built-in function?

2021-01-16 Thread Michael F. Stemper
On 15/01/2021 17.17, dn wrote: On 16/01/2021 11.40, Michael F. Stemper wrote: On 15/01/2021 16.01, Chris Angelico wrote: On Sat, Jan 16, 2021 at 8:56 AM Michael F. Stemper wrote: On 15/01/2021 15.26, Stefan Ram wrote: "Michael F. Stemper" writes: On 15/01/2021 14.01, Stefan

Re: Python cannot count apparently

2021-02-08 Thread Michael F. Stemper
s that the code you posted has very little to do with the code you ran. If you really want us to help, please directly copy and paste the exact code that you ran. We can't really help you with only guesses as to what you did. [1] (leading > replaced with . to fool news clients) -- Michael

Re: Python cannot count apparently

2021-02-08 Thread Michael F. Stemper
lly help you with only guesses as to what you did. -- Michael F. Stemper Outside of a dog, a book is man's best friend. Inside of a dog, it's too dark to read. -- https://mail.python.org/mailman/listinfo/python-list

Re: New Python implementation

2021-02-19 Thread Michael F. Stemper
cons. <https://www.youtube.com/watch?v=DcQDqZIN09I> -- Michael F. Stemper If you take cranberries and stew them like applesauce they taste much more like prunes than rhubarb does. -- https://mail.python.org/mailman/listinfo/python-list

Re: error of opening Python

2021-02-25 Thread Michael F. Stemper
credits" or "license" for more information." I don't know what this meant and how to fix this. Could you please help me? There isn't anything to fix. It's working just fine. -- Michael F. Stemper If you take cranberries and stew them like applesauce they taste much more

Re: FileNotFoundError: [Errno 2] No such file or directory: ''

2021-04-14 Thread Michael F. Stemper
name. For instance, I might do saga = open(r'c:\my\dir\ect\ory\Egils Saga 1-15.txt', 'r') or even with open(r'c:\my\dir\ect\ory\Egils Saga 1-15.txt', 'r') as saga: The latter form eliminates the need for saga.close(). (I'm sure that you know that; it&#x

Re: Bloody rubbish

2021-05-06 Thread Michael F. Stemper
hat's what the sixteen toggle switches are for. -- Michael F. Stemper Life's too important to take seriously. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python script accessing own source code

2021-05-12 Thread Michael F. Stemper
rgv[0], "rt" ) as myself: for line in myself: junk = sys.stdout.write( "%s" % (line) ) sys.exit(0) It's not bullet-proof. If you put it in a directory in your $PATH and run it from somewhere else, it won't work. --

Writers [Was: Re: Standarize TOML?]

2021-05-18 Thread Michael F. Stemper
I could read up on them? [1] Well, I've used csv.DictWriter() which might be an instance. -- Michael F. Stemper Galatians 3:28 -- https://mail.python.org/mailman/listinfo/python-list

Re: Writers [Was: Re: Standarize TOML?]

2021-05-18 Thread Michael F. Stemper
On 18/05/2021 08.23, Jon Ribbens wrote: On 2021-05-18, Michael F. Stemper wrote: On 17/05/2021 18.48, Terry Reedy wrote: There are multiple packages.  There is no consensus on which to pick, *if any*. Existing modules apparently include writers, which are necessarily opinionated (as is

Re: learning python ...

2021-05-24 Thread Michael F. Stemper
str 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 sometimes still need to restrain my fingers. -- Michael F. Stemper Nostalgia just ain't what it used to be. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python ...

2021-05-25 Thread Michael F. Stemper
java (Ack, spit) does the same thing. -- Michael F. Stemper Isaiah 10:1-2 -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python ...

2021-05-25 Thread Michael F. Stemper
On 24/05/2021 18.30, 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 sometimes still need to restr

Turtle module

2021-05-26 Thread Michael F. Stemper
e to return with the pen in the same state (up or down) as when my functions were called. Again, I can't find any way to query the pen state. How can my function get this information? Or do I need to be sloppy and let the callers beware? -- Michael F. Stemper 2 Chronicles 19:7 -- https://mail.py

Re: Turtle module

2021-05-26 Thread Michael F. Stemper
On 26/05/2021 11.17, Chris Angelico wrote: On Thu, May 27, 2021 at 1:59 AM Michael F. Stemper wrote: What I would like to do is capture the angle-representation mode on entry and restore it on return. However, looking through the methods of turtle.Turtle(), I can't find any mea

Re: Turtle module

2021-05-26 Thread Michael F. Stemper
On 26/05/2021 13.24, Stefan Ram wrote: "Michael F. Stemper" writes: What I would like to do is capture the angle-representation mode on entry and restore it on return. another one: def f( turtle_ ): my_turtle = turtle_.clone() # now work with

Re: learning python ...

2021-05-27 Thread Michael F. Stemper
x27;t expect that ... The strange thing, coming from a different language, is the apparent difference, if instead of a list, you pass an integer: def f(a): a=5 l=3 f(l) print(l) > 3 Here, the "l" is not changed. The reason is that the statement "a=5" does NOT

Re: Python doesn't work

2021-05-30 Thread Michael F. Stemper
uess would be that the following happens: 1. You click on the file in some GUI. 2. The program contained in that file executes; taking a second or so. 3. Having done what you asked it to, it goes away. -- Michael F. Stemper 87.3% of all statistics are made up by the person giving them

Re: Python

2021-06-14 Thread Michael F. Stemper
, Linux, something else? Specific version. -- Michael F. Stemper You can lead a horse to water, but you can't make him talk like Mr. Ed by rubbing peanut butter on his gums. -- https://mail.python.org/mailman/listinfo/python-list

Re: Optimizing Small Python Code

2021-06-23 Thread Michael F. Stemper
1\n 2\n 3\n 4\n 5\n' ) Unless I'm figuring ot wrong, you just took it from O(n^2) to O(1). That deserves a Turing award or something. -- Michael F. Stemper You can lead a horse to water, but you can't make him talk like Mr. Ed by rubbing peanut butter on his gu

Syntactic sugar

2021-06-28 Thread Michael F. Stemper
morning, I had use for that syntax, but couldn't find it on-line or guess what it was. Does this syntax exist, or am I simply imagining things? Thanks, -- Michael F. Stemper There's no "me" in "team". There's no "us" in "team", either. -- https://mail.python.org/mailman/listinfo/python-list

Re: Syntactic sugar

2021-06-28 Thread Michael F. Stemper
On 28/06/2021 11.57, Stefan Ram wrote: "Michael F. Stemper" writes: for iter in range(n): chunkofcode When the counter does not matter, people sometimes write "_": for _ in range( n ): chunkofcode That looks like what I wanted. Thanks! -- Michael F. Stemp

Rotation of a cube

2021-07-29 Thread Michael F. Stemper
[1], briefly showing each step. However, it seems to me that this is a solved problem, so there is probably a module that will do most of the scutwork for me. Any suggestions on where to find such a module? Thanks. [1] <https://mathworld.wolfram.com/RotationMatrix.html> -- Michael F. S

<    1   2   3   4   >