Re: How do you log in your projects?

2022-02-10 Thread Martin Di Paola
? Logs are not intended to be read by end users. Logs are primarily used to understand what the code is doing in a production environment. They could also be used to gather metrics data. Why should you log to give a message instead of simply using a print? You are assuming that logs and prints

Re: PermissionError: [Errno 13] Permission denied: 'Abc.xlsx'

2022-02-10 Thread Dennis Lee Bieber
On Thu, 10 Feb 2022 21:39:05 +0100, Christian Gollwitzer declaimed the following: >Hence it is impossible to concurrently write from Python into an open >Excel file. One might ask what the real problem is the user is trying to >solve. Is Excel a requirement, can it be swapped by a database eng

Re: Abstraction level at which to create SQLAlchemy ORM object

2022-02-10 Thread Cameron Simpson
On 10Feb2022 14:14, Loris Bennett wrote: >I am writing a command line program which will modify entries in a >database and am trying out SQLAlchemy. > >A typical command might look like > > um --operation add --uid ada --gid coders --lang en > >Parsing the arguments I get, ignoring the operation,

Re: How to solve the given problem?

2022-02-10 Thread Avi Gross via Python-list
Anyone think someone keeps asking homework questions? This seems absolutely unrelated to earlier discussions from this person. Jobs often tend to remain focused. I opt out after frustration with earlier exchanges with NArshad about library books and EXCEL ... -Original Message- From: N

Re: Global VS Local Subroutines

2022-02-10 Thread Rob Cliffe via Python-list
On 10/02/2022 21:43, Friedrich Rentsch wrote: I believe to have observed a difference which also might be worth noting: the imbedded function a() (second example) has access to all of the imbedding function's variables, which might be an efficiency factor with lots of variables. The access is

Re: C API PyObject_Call segfaults with string

2022-02-10 Thread Jen Kris via Python-list
Thank you for that suggestion.  It allowed me to replace six lines of code with one.  :) Feb 10, 2022, 12:43 by pyt...@mrabarnett.plus.com: > On 2022-02-10 20:00, Jen Kris via Python-list wrote: > >> With the help of PyErr_Print() I have it solved.  Here is the final code >> (the part relevant

Re: How to solve the given problem?

2022-02-10 Thread Marco Sulla
Narshad, I propose you post your questions to StackOverflow. I'm sure they will be very happy. -- https://mail.python.org/mailman/listinfo/python-list

Re: Global VS Local Subroutines

2022-02-10 Thread Marco Sulla
I agree with Chris. I don't know if it was already written: if you want a local function for speed reasons, you can use the classic approach of a main function. -- https://mail.python.org/mailman/listinfo/python-list

Re: How do you log in your projects?

2022-02-10 Thread Marco Sulla
On Wed, 9 Feb 2022 at 20:40, Martin Di Paola wrote: > > If the logs are meant to be read by my users I log high level messages, > specially before parts that can take a while (like the classic > "Loading..."). ? Logs are not intended to be read by end users. Logs are primarily used to understand

Re: Global VS Local Subroutines

2022-02-10 Thread Friedrich Rentsch
I believe to have observed a difference which also might be worth noting: the imbedded function a() (second example) has access to all of the imbedding function's variables, which might be an efficiency factor with lots of variables. The access is read-only, though. If the inner function writes

Re: PermissionError: [Errno 13] Permission denied: 'Abc.xlsx'

2022-02-10 Thread Chris Angelico
On Fri, 11 Feb 2022 at 07:57, Christian Gollwitzer wrote: > > Am 10.02.22 um 20:43 schrieb Chris Angelico: > > On Fri, 11 Feb 2022 at 06:41, Dennis Lee Bieber > > wrote: > >> While not tested with Excel, I /have/ encountered cases where an > >> application has locked the file for writin

Re: PermissionError: [Errno 13] Permission denied: 'Abc.xlsx'

2022-02-10 Thread Christian Gollwitzer
Am 10.02.22 um 20:43 schrieb Chris Angelico: On Fri, 11 Feb 2022 at 06:41, Dennis Lee Bieber wrote: While not tested with Excel, I /have/ encountered cases where an application has locked the file for writing, but multiple readers are permitted. Those would fail then if one attempts to

Re: C API PyObject_Call segfaults with string

2022-02-10 Thread MRAB
On 2022-02-10 20:00, Jen Kris via Python-list wrote: With the help of PyErr_Print() I have it solved.  Here is the final code (the part relevant to sents):    Py_ssize_t listIndex = 0;    pListItem = PyList_GetItem(pFileIds, listIndex);    pListStrE = PyUnicode_AsEncodedString(pListItem, "UT

Re: C API PyObject_Call segfaults with string

2022-02-10 Thread Jen Kris via Python-list
Hi and thanks very much for your comments on reference counting.  Since I'm new to the C_API that will help a lot.  I know that reference counting is one of the difficult issues with the C API.  I just posted a reply to Inada Naoki showing how I solved the problem I posted yesterday.  Thanks

Re: C API PyObject_Call segfaults with string

2022-02-10 Thread Jen Kris via Python-list
With the help of PyErr_Print() I have it solved.  Here is the final code (the part relevant to sents):    Py_ssize_t listIndex = 0;    pListItem = PyList_GetItem(pFileIds, listIndex);    pListStrE = PyUnicode_AsEncodedString(pListItem, "UTF-8", "strict");    pListStr = PyBytes_AS_STRING(pListStrE

Re: How to solve the given problem?

2022-02-10 Thread Dennis Lee Bieber
On Wed, 9 Feb 2022 22:40:48 -0800 (PST), NArshad declaimed the following: > >Assume that there is a pattern of feeding for a special fish in a day (10 >hours a day) as below: > 150100303030202010 > 55 >Today, the fish is fed in th

Re: PermissionError: [Errno 13] Permission denied: 'Abc.xlsx'

2022-02-10 Thread Chris Angelico
On Fri, 11 Feb 2022 at 06:41, Dennis Lee Bieber wrote: > > On Wed, 9 Feb 2022 18:50:12 +, MRAB > declaimed the following: > > >On 2022-02-09 12:45, Christian Gollwitzer wrote: > > >> It's impossible. Excel locks the file deliberately when it is open, so > >> that you can't overwrite it from a

Re: PermissionError: [Errno 13] Permission denied: 'Abc.xlsx'

2022-02-10 Thread Dennis Lee Bieber
On Wed, 9 Feb 2022 18:50:12 +, MRAB declaimed the following: >On 2022-02-09 12:45, Christian Gollwitzer wrote: >> It's impossible. Excel locks the file deliberately when it is open, so >> that you can't overwrite it from a different program. Otherwise, the >> file could become inconsistent.

Re: Global VS Local Subroutines

2022-02-10 Thread Eryk Sun
On 2/10/22, BlindAnagram wrote: > > This is exactly what I felt too but I then wondered if the code was > recreated dynamically or was static with just a reference being created > on each invocation of the parent. The overhead in this case would be > negligible. But then I thought 'what about the

Re: GCP Copy Files - Data Export

2022-02-10 Thread MRAB
On 2022-02-10 17:20, BmoreIT wrote: I did a data export from Google to export all company data - Google Data Export It shows the root folder and to download, I run this command (it automatically enters this command) gsutil -m cp -r \ "gs://takeout-export-myUniqueID" \. But I have no idea where

Re: Global VS Local Subroutines

2022-02-10 Thread BlindAnagram
On 10/02/2022 16:52, Rob Cliffe wrote: On 10/02/2022 12:13, BlindAnagram wrote: Is there any difference in performance between these two program layouts:    def a(): ...    def(b): c = a(b) or    def(b): def a():    ... c = a(b) I would appreciate any insights on wh

GCP Copy Files - Data Export

2022-02-10 Thread BmoreIT
I did a data export from Google to export all company data - Google Data Export It shows the root folder and to download, I run this command (it automatically enters this command) gsutil -m cp -r \ "gs://takeout-export-myUniqueID" \. But I have no idea where it would save it being I am not a GCP

Python LSTM forecast future values for time series

2022-02-10 Thread Jorge Conforte
HI, I'm starting run the LSTM to forecast future values for time serie data. please can someone give me some information on how i can predict future values ​​for my time series using LSTM. Thanks, Conrado -- https://mail.python.org/mailman/listinfo/python-list

Re: Global VS Local Subroutines

2022-02-10 Thread Chris Angelico
On Fri, 11 Feb 2022 at 03:57, Rob Cliffe via Python-list wrote: > But of course, performance is not the only consideration, as per Chris > Angelico's answer. Yep. In fact, I'd say that performance is the least significant consideration here; do what makes sense. The time difference will be neglig

Re: Global VS Local Subroutines

2022-02-10 Thread Rob Cliffe via Python-list
On 10/02/2022 12:13, BlindAnagram wrote: Is there any difference in performance between these two program layouts:    def a(): ...    def(b): c = a(b) or    def(b): def a():    ... c = a(b) I would appreciate any insights on which layout to choose in which circumsta

Re: How to solve the given problem?

2022-02-10 Thread Christian Gollwitzer
Am 10.02.22 um 11:26 schrieb NArshad: -ChrisA: You don't reply if you have problems. When I don't find any solution elsewhere then only I place in this group -Christian: One problem of different type requires the same elaboration. No it doesn't Q. What technique of statistics or numerical c

Re: Global VS Local Subroutines

2022-02-10 Thread BlindAnagram
On 10/02/2022 15:20, Chris Angelico wrote: On Fri, 11 Feb 2022 at 02:13, BlindAnagram wrote: Is there any difference in performance between these two program layouts: def a(): ... def(b): c = a(b) or def(b): def a(): ... c = a(b) I would

Re: Multiple inheritance using super() in parent classes

2022-02-10 Thread Peter Otten
On 10/02/2022 09:20, Igor Basko wrote: Hi everyone, This is my first question here. Hope to get some clarification. Basically this question is about multiple inheritance and the usage of super().__init__ in parent classes. So I have two classes that inherit from the same base class. For example

Re: How to solve the given problem?

2022-02-10 Thread Chris Angelico
On Fri, 11 Feb 2022 at 02:15, NArshad wrote: > > -ChrisA: > You don't reply if you have problems. > When I don't find any solution elsewhere then only I place in this group > You're a help vampire. Stop it. https://slash7.com/2006/12/22/vampires/ Go do some actual research instead of asking peo

Re: Global VS Local Subroutines

2022-02-10 Thread Chris Angelico
On Fri, 11 Feb 2022 at 02:13, BlindAnagram wrote: > > Is there any difference in performance between these two program layouts: > > def a(): > ... > def(b): > c = a(b) > > or > > def(b): > def a(): > ... > c = a(b) > > I would appreciate any insights on

Abstraction level at which to create SQLAlchemy ORM object

2022-02-10 Thread Loris Bennett
Hi, I am writing a command line program which will modify entries in a database and am trying out SQLAlchemy. A typical command might look like um --operation add --uid ada --gid coders --lang en Parsing the arguments I get, ignoring the operation, a dict {uid: "ada", gid: "coders", lang:

Re: How to solve the given problem?

2022-02-10 Thread NArshad
-ChrisA: You don't reply if you have problems. When I don't find any solution elsewhere then only I place in this group -Christian: One problem of different type requires the same elaboration. Q. What technique of statistics or numerical computation or general mathematics to use to solve this

Global VS Local Subroutines

2022-02-10 Thread BlindAnagram
Is there any difference in performance between these two program layouts: def a(): ... def(b): c = a(b) or def(b): def a(): ... c = a(b) I would appreciate any insights on which layout to choose in which circumstances. -- https://mail.python.org/mailman/l

Multiple inheritance using super() in parent classes

2022-02-10 Thread Igor Basko
Hi everyone, This is my first question here. Hope to get some clarification. Basically this question is about multiple inheritance and the usage of super().__init__ in parent classes. So I have two classes that inherit from the same base class. For example class B and class C inherit from A: class

Re: How to solve the given problem?

2022-02-10 Thread Chris Angelico
On Thu, 10 Feb 2022 at 18:41, NArshad wrote: > > > Assume that there is a pattern of feeding for a special fish in a day (10 > hours a day) as below: >150100303030202010 >55 > Today, the fish is fed in the second hour 60 unit in