Re: Trying to understand nested loops

2022-08-05 Thread Mladen Gogala via Python-list
On Fri, 5 Aug 2022 08:34:45 +0100, ojomooluwatolami675 wrote: > Hello, I’m new to learning python and I stumbled upon a question nested > loops. This is the question below. Can you please how they arrived at 9 > as the answer. Thanks > > var = 0 for i in range(3): > for j in range(-2,-7,-2): >

Re: Avoid nested SIGINT handling

2021-11-13 Thread Mladen Gogala via Python-list
On Thu, 11 Nov 2021 17:22:15 +1100, Chris Angelico wrote: > Threads aren't the point here - signals happen immediately. Actually, signals are not delivered immediately. Signals are delivered the next time the process gets its turn on CPU. The process scheduler will make process runnable and the

Re: Website

2021-04-14 Thread Mladen Gogala via Python-list
On Wed, 14 Apr 2021 15:41:37 +0200, Rainyis wrote: > Hello, > I am Sergio Llorente, and I want to create a web about python. I will > publish apps, scripts.. made by python. I will like to put python in the > domain. The domain will be like all-about-python.com but in Spanish( > todosobrepython.co

Re: error of opening Python

2021-02-26 Thread Mladen Gogala via Python-list
On Fri, 26 Feb 2021 02:23:51 -0500, Terry Reedy wrote: > Not on Windows. Please don't spew misleading garbage that will only > confuse the new user on a different operating system. > You are right, I apologize. I sort of like poking fun at the Winduhs users but this is not the right place.

Re: error of opening Python

2021-02-25 Thread Mladen Gogala via Python-list
On Thu, 25 Feb 2021 17:22:35 +, Botao Liu wrote: > Dear Python team, > > This is my first time using Python, I tried to launch Python and it > showed "Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC > v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or > "lic

Re: PSYCOPG2

2021-02-13 Thread Mladen Gogala via Python-list
I don't have PSYCOPG2 on my system, but try doing the following from python: [mgogala@umajor ~]$ python3 Python 3.9.1 (default, Jan 20 2021, 00:00:00) [GCC 10.2.1 20201125 (Red Hat 10.2.1-9)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import cx_Oracle >>>

Re: PSYCOPG2

2021-02-12 Thread Mladen Gogala via Python-list
On Fri, 12 Feb 2021 18:29:48 +, Tony Ogilvie wrote: > I am trying to write a program to open a PostgesSQL 13 database using > psycopg2. All seems to work if I write direct to Python but if I write > the script into IDLE it does not work with the IDLE Shell 3.9.1 > reporting an error of no attr

Re: Issues with running python in Command prompt

2021-01-20 Thread Mladen Gogala via Python-list
On Wed, 20 Jan 2021 08:33:40 -0700, Michael Torrie wrote: > You can use escape characters in regular expression on any platform > Python runs on. Python has a whole host of features to deal with the > directory separator differences on Windows vs everybody else. I am probably slightly biased. I

Re: Issues with running python in Command prompt

2021-01-19 Thread Mladen Gogala via Python-list
On Sat, 16 Jan 2021 19:00:06 +0330, mohsen shooshtari wrote: > hello, > Thanks in advance for your consideration. I install python3.8 and then > install Pycharm but when I call python in Command prompt, followed by ( > 'python' > is not recognized as an internal or external command, operable progr

Re: open sentinel-2image python

2021-01-19 Thread Mladen Gogala via Python-list
On Sun, 17 Jan 2021 18:01:26 +, MRAB wrote: > On 2021-01-17 13:57, Karsten Hilbert wrote: >> Am Sun, Jan 17, 2021 at 02:20:24AM -0800 schrieb omid mohammadi: >> >>> When I open the sentinel-2 image in Python, I get the following error: >>> >>> MemoryError: Unable to allocate 115. MiB for an a

Re: Python not Running

2021-01-18 Thread Mladen Gogala via Python-list
On Sat, 16 Jan 2021 14:55:26 -0600, Logan Cranford wrote: > I downloaded Python but when I try to run Idle it says it is not found > and I should try to redownload it. When I try to do that all that comes > up is a page that says modify, repair or uninstall. I have repaired > several times but it

Re: Is there a log file that tracks every statement that is being executed when a program is running?

2020-10-25 Thread Mladen Gogala via Python-list
On Sun, 25 Oct 2020 12:14:52 +0100, Maxime S wrote: > Hi, > > You can use the trace module for that: > https://docs.python.org/3.8/library/trace.html > > Personally I tend to put print statement at strategic places instead, I > find that easier to analyse than a full trace but YMMV. > > Maxime

Re: Simple question - end a raw string with a single backslash ?

2020-10-18 Thread Mladen Gogala via Python-list
On Mon, 19 Oct 2020 02:44:25 +, Stefan Ram wrote: > Mladen Gogala writes: >>In Perl, there are no classes. > > If there are no classes in Perl, then what does > > bless REF,CLASSNAME > > do? bless \$ref will make the given reference a reference to the class. And classes is Perl are

Re: Simple question - end a raw string with a single backslash ?

2020-10-18 Thread Mladen Gogala via Python-list
On Sun, 18 Oct 2020 12:19:18 -0600, Michael Torrie wrote: > Python certainly is procedural. A script starts at the top and executes > through to the bottom and ends, barring any flow control in the middle. > Like Perl you can use it in many different ways and paradigms including > OO if you desi

Re: Simple question - end a raw string with a single backslash ?

2020-10-18 Thread Mladen Gogala via Python-list
On Sun, 18 Oct 2020 16:13:16 +0200, Peter J. Holzer wrote: > > Ah, I see, that the sillyness of Perl's grammar-altering modules (which > let you write Perl in Latin (with proper declensions and conjugations, > of course) or Chinese) has found its way to Python > To tell the truth, I only instal

Re: File Name issue

2020-10-18 Thread Mladen Gogala via Python-list
On Sun, 18 Oct 2020 21:00:18 +1300, dn wrote: > On 18/10/2020 12:58, Mladen Gogala via Python-list wrote: >> On Sat, 17 Oct 2020 22:51:11 +, Mladen Gogala wrote: >>> On Sat, 17 Oct 2020 18:12:16 -0400, Steve wrote: >>> >>>> with open("HOURLYLOG.

Re: MERGE SQL in cx_Oracle executemany

2020-10-17 Thread Mladen Gogala via Python-list
On Sat, 17 Oct 2020 21:23:40 -0600, Jason Friedman wrote: >> I'm looking to insert values into an oracle table (my_table) using the >> query below. The insert query works when the PROJECT is not NULL/empty >> (""). However when PROJECT is an empty string(''), the query creates a >> new duplicate

Re: File Name issue

2020-10-17 Thread Mladen Gogala via Python-list
On Sat, 17 Oct 2020 22:51:11 +, Mladen Gogala wrote: > On Sat, 17 Oct 2020 18:12:16 -0400, Steve wrote: > >> with open("HOURLYLOG.txt", 'r') as infile: >> works but, when I rename the file, the line: >> with open("HOURLY-LOG.txt", 'r') as infile: >> does not. The complaint is: Cannot Assign

Re: File Name issue

2020-10-17 Thread Mladen Gogala via Python-list
On Sat, 17 Oct 2020 18:12:16 -0400, Steve wrote: > with open("HOURLYLOG.txt", 'r') as infile: > works but, when I rename the file, the line: > with open("HOURLY-LOG.txt", 'r') as infile: > does not. The complaint is: Cannot Assign to operator Try this: with open("HOURLY\-LOG.txt", 'r') as infil

Re: Simple question - end a raw string with a single backslash ?

2020-10-17 Thread Mladen Gogala via Python-list
On Thu, 15 Oct 2020 21:30:15 +, Stefan Ram wrote: > Tony Flury writes: >> >>> a = r'end' + chr(92) > > Or maybe, > > a = r''' > end\ > '''[ 1: -1 ] > > ? The first and the last line are messy, but in the middle, > the intended string is clearly visible. You can use perl module for