Re: Trying to understand nested loops

2022-08-05 Thread Mladen Gogala via Python-list
s an answer to a homework question. You'll have to work out the details yourself. -- Mladen Gogala Database Consultant https://dbwhisperer.wordpress.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Avoid nested SIGINT handling

2021-11-13 Thread Mladen Gogala via Python-list
antum expires or until initiates a synchronous I/O operation, as is the case with all normal read operations. BTW, that's the case on both Unix/Linux systems and Windows systems. -- Mladen Gogala Database Consultant https://dbwhisperer.wordpress.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Website

2021-04-14 Thread Mladen Gogala via Python-list
t in Spanish( > todosobrepython.com). Can I use it? > > Thanks in advance, > Sergio I give you my permission. May the Force be with you and your website. -- Mladen Gogala Database Consultant https://dbwhisperer.wordpress.com -- https://mail.python.org/mailman/listinfo/python-list

Re: error of opening Python

2021-02-26 Thread Mladen Gogala via Python-list
he right place. -- Mladen Gogala Database Consultant https://dbwhisperer.wordpress.com -- https://mail.python.org/mailman/listinfo/python-list

Re: error of opening Python

2021-02-25 Thread Mladen Gogala via Python-list
, "credits" or > "license" -- [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. &g

Re: PSYCOPG2

2021-02-13 Thread Mladen Gogala via Python-list
, 'DB_TYPE_ROWID', 'DB_T ....... >>> conn=cx_Oracle.Connection("scott/tiger@ora19c") >>> Please use PSYCOPG2 instead of cx_Oracle. After you do it from python3 interpreter do it from Idle: On Sat, 13 Feb 2021 22:08:11 +

Re: PSYCOPG2

2021-02-12 Thread Mladen Gogala via Python-list
vice would be to ditch Idle and use VSCode. It's fabulous. -- Mladen Gogala Database Consultant https://dbwhisperer.wordpress.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Issues with running python in Command prompt

2021-01-20 Thread Mladen Gogala via Python-list
working for a SGI distributor, using Irix. I have worked with HP-UX, AIX, AT&T Unix, Wyse Unix, SCO Unix and, eventually, Linux, among other things. I might be slightly biased against Windows. -- Mladen Gogala Database Consultant https://dbwhisperer.wordpress.com -- https://mail.python.or

Re: Issues with running python in Command prompt

2021-01-19 Thread Mladen Gogala via Python-list
Cygwin version is typically much easier and more natural. -- Mladen Gogala Database Consultant https://dbwhisperer.wordpress.com -- https://mail.python.org/mailman/listinfo/python-list

Re: open sentinel-2image python

2021-01-19 Thread Mladen Gogala via Python-list
the case then using 64-bit Python might fix it, assuming that > it's a 64-bit machine. Or there may be an OS limitation on the size of the address space. I would check the OS log first, then do "ulimit -a". If there are sar or vmstat on the system, I would definitely use them

Re: Python not Running

2021-01-18 Thread Mladen Gogala via Python-list
m Files if you installed 64 bit version, which you should have done. Otherwise, it will be in C:\Program Files(x86). Your "idle" program will be in your "start menu" which came back in Winduhs 10. You would probably never have guessed, but I'm not particular

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
but YMMV. > > Maxime Thank you. I am a YAPN (yet another Python newbie) and this helps me a lot. -- Mladen Gogala Database Consultant http://mgogala.byethost5.com -- https://mail.python.org/mailman/listinfo/python-list

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

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

2020-10-18 Thread Mladen Gogala via Python-list
.com/app-dev-testing/object-oriented-programming-dead-not-long-shot Sometimes, OO has its funny side: https://www.wearethemighty.com/articles/that-time-the-australian-air-force-squared-off-against-missile-shooting-kangaroos -- Mladen Gogala Database Consultant http://mgogala.byethost5.com -- http

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

2020-10-18 Thread Mladen Gogala via Python-list
than to write Perl scripts. I do sort of miss $_, @_ and $!. Python's argparse is supreme and much better than Getopt::Long. -- Mladen Gogala Database Consultant http://mgogala.byethost5.com -- https://mail.python.org/mailman/listinfo/python-list

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 +0000, 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
tion is satisfied and your MERGE statement will insert a new and exciting row. That has nothing to do with Python. The only solution is "ALTER TABLE my_table modify(project not null)" or "ALTER TABLE my_table add constraint project_nn check(project is not null)" I If you

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

Re: File Name issue

2020-10-17 Thread Mladen Gogala via Python-list
tor Try this: with open("HOURLY\-LOG.txt", 'r') as infile: -- Mladen Gogala Database Consultant http://mgogala.byethost5.com -- https://mail.python.org/mailman/listinfo/python-list

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

2020-10-17 Thread Mladen Gogala via Python-list
a="abcd" >>> b=re.sub('$',chr(28),a) >>> b 'abcd\x1c' >>> b=re.sub('$',chr(0x41),a) >>> b 'abcdA' >>> b=re.sub('$','Z',a) >>> b 'abcdZ' >>> b=re.sub('$',chr(0x1C),a) >>> b 'abcd\x1c' >>> Any other character is shown as it should be, except backslash. -- Mladen Gogala Database Consultant http://mgogala.byethost5.com -- https://mail.python.org/mailman/listinfo/python-list

Perl __DATA__ construct.

2012-06-25 Thread Mladen Gogala
I have a script in Perl that I need to rewrite to Python. The script contains __DATA__ at the end of the script, which enables Perl to access all the data after that through a file descriptor, like this: usage() if ( !$stat or !defined($home) or !defined($base) or !defined ($sid) ); while () {

Re: mod_python load cx_Oracle error

2010-07-19 Thread Mladen Gogala
On Mon, 19 Jul 2010 09:12:20 -0700, li wang wrote: > It's quite weird when I import cx_Oracle in python interactive shell, it > works perfectly. > but when I import cx_Oracle in a *,py script, handled by > mod_python.publisher, it keep reportint : > > ImportError: libclntsh.so.10.1: cannot open s

Re: adodb.NewADOConnection('postgres') returns None

2010-07-14 Thread Mladen Gogala
On Wed, 14 Jul 2010 05:14:08 -0700, micayael wrote: > Thanks Thomas. > :-( then adodb today dosn't work with postgres (at least on ubuntu) > right? No, ADOdb doesn't work with the newer versions of Postgres. ADOdb doesn't work with Psycopg2 and the guy who maintains it did not reply to my email

Re: adodb.NewADOConnection('postgres') returns None

2010-07-14 Thread Mladen Gogala
On Wed, 14 Jul 2010 20:04:59 +0200, Thomas Jollans wrote: > It certainly looks that way. It may be possible to install an old > psycopg module by hand - I'd expect that to work as well. Not on Ubuntu 9.10: checking PostgreSQL type catalog... /usr/include/postgresql/catalog/ pg_type.h checking

Re: Composition of functions

2010-06-30 Thread Mladen Gogala
On Wed, 30 Jun 2010 21:04:28 -0700, Stephen Hansen wrote: > On 6/30/10 8:50 PM, Mladen Gogala wrote: >>>>> x="quick brown fox jumps over a lazy dog" >>>>> y=''.join(list(x).reverse()) >> Traceback (most recent call last): >>Fi

Composition of functions

2010-06-30 Thread Mladen Gogala
If I write things with the intermediate variables like below, everything works: >>> x="quick brown fox jumps over a lazy dog" >>> y=list(x) >>> y ['q', 'u', 'i', 'c', 'k', ' ', 'b', 'r', 'o', 'w', 'n', ' ', 'f', 'o', 'x', ' ', 'j', 'u', 'm', 'p', 's', ' ', 'o', 'v', 'e', 'r', ' ', 'a', ' ', 'l'

Re: Python newbie

2008-09-19 Thread Mladen Gogala
Steve Holden wrote: > No. Python implicitly dereferences all names when using them to compute > values, and only uses them as references on the left-hand side of an > assignment. > > Please note the above statement is contentious, and will likely bring a > horde of screaming fanatics of various f

Python newbie

2008-09-19 Thread Mladen Gogala
I am a Python newbie who decided to see what that Python fuss is all about. Quite frankly, I am a bit perplexed. After having had few months of experience with Perl (started in 1994 with Perl v4, and doing it ever since) , here is what perplexes me: perl -e '@a=(1,2,3); map { $_*=2 } @a; map { pri