Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: why is user = form.getfirst("user", "").upper() safe?
Post: RE: why is user = form.getfirst("user", "").upper(...

I understand the upper() method is used to trigger an AttributeError exception in case it is called on a list but that could not possibly happen in the example code- user = form.getfirst("user", "").u...
shanepy General Coding Help 6 3,947 Nov-27-2018, 06:56 PM
    Thread: why is user = form.getfirst("user", "").upper() safe?
Post: RE: why is user = form.getfirst("user", "").upper(...

@buran: that makes more sense, but I don't see what use upper() serves in this example since form.getfirst("user", "") could only return a string.
shanepy General Coding Help 6 3,947 Nov-27-2018, 03:57 AM
    Thread: why is user = form.getfirst("user", "").upper() safe?
Post: why is user = form.getfirst("user", "").upper() sa...

Hello, https://docs.python.org/3.5/library/cgi....-interface import cgi form = cgi.FieldStorage() user = form.getfirst("user", "").upper() # This way it's safe. ...Why does converting to the cgi ...
shanepy General Coding Help 6 3,947 Nov-22-2018, 08:28 PM
    Thread: How to reliably split string containing multiple sqlite statements?
Post: RE: How to reliably split string containing multip...

@Larz60+ Your solution works perfectly for the example I gave - but not in general. Consider the following 3 statements- >>> sql = "select 123; select 'def'; select 'annoying semicolon ;'" &...
shanepy General Coding Help 2 2,599 Nov-21-2018, 12:07 AM
    Thread: How to reliably split string containing multiple sqlite statements?
Post: How to reliably split string containing multiple s...

Hello, Is there a way to reliably split a string containing multiple sqlite statements? str.split(sep=None, maxsplit=-1) does not always work - Python 3.5.3 (default, Sep 27 2018, 17:25:39) [GCC 6....
shanepy General Coding Help 2 2,599 Nov-20-2018, 11:30 PM
    Thread: How to execute a string with multiple sqlite statements and print results?
Post: How to execute a string with multiple sqlite state...

Hello, How can a string with multiple sqlite statements be executed (for example "select * from tab1; select * from tab2") and print the results? Python 3.5.3 (default, Sep 27 2018, 17:25:39) [GCC 6...
shanepy General Coding Help 0 2,273 Nov-20-2018, 10:19 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020