Re: [Tutor] how do I set variables in Python 3.4

2014-07-12 Thread Steven D'Aprano
Hi Danielle, and welcome. Others have already replied to your post, and I'm going to reply with pretty much the same answer: Please help us to help you! We're not mind-readers, we need to see the actual error messages you get, and your actual code, not just a rough paraphrase of it. When Pyth

Re: [Tutor] While loop issue, variable not equal to var or var

2014-07-12 Thread Steven D'Aprano
On Sat, Jul 12, 2014 at 02:39:12PM +0200, Wolfgang Maier wrote: [...] > Very interesting advice. Wasn't aware at all of this feature of casefold. > As a native German speaker, I have to say that your last two examples > involving the capital ß are pretty contrived: although the capital ß is > par

Re: [Tutor] Anti-Patterns in Python Programming

2014-07-12 Thread Deb Wyatt
> -Original Message- > From: alan.ga...@btinternet.com > Sent: Sat, 12 Jul 2014 19:21:59 +0100 > To: tutor@python.org > Subject: Re: [Tutor] Anti-Patterns in Python Programming > > On 12/07/14 17:43, Deb Wyatt wrote: >> So much has been invented since my dos programming days and it

Re: [Tutor] Image Upload FalconFramework

2014-07-12 Thread Danny Yoo
On Tue, Jul 1, 2014 at 8:51 PM, Peter Romfeld wrote: > Hi, > > I try to make a simple image upload function, in django i just used: > > for feature phones: > file = request.body > > rest: > file = request.FILES['image'].read() > > with falcon i tried but not working > req.stream.read() > > Their F

Re: [Tutor] How to Create Webpage with Python

2014-07-12 Thread Danny Yoo
Hi Chris, Yikes. I need to say that as, for disclosure: I work at Google. I do not work on the App Engine team, but I need to acknowledge my potential conflict-of-interest, and I apologize for not stating this in my reply. ___ Tutor maillist - Tutor@

Re: [Tutor] How to Create Webpage with Python

2014-07-12 Thread Danny Yoo
> On Fri, Jul 11, 2014 at 6:21 AM, Danny Yoo wrote: >> The ones I use for my personal and professional use are webfaction.com and >> appengine.google.com. I'm sure others can give more suggestions. > > Both are services used for hosting webapps, not static websites. Hi Chris, It's true that ho

Re: [Tutor] Anti-Patterns in Python Programming

2014-07-12 Thread Deb Wyatt
> -Original Message- > From: alan.ga...@btinternet.com > Sent: Sat, 12 Jul 2014 21:57:37 +0100 > To: tutor@python.org > Subject: Re: [Tutor] Anti-Patterns in Python Programming > > On 12/07/14 20:24, Deb Wyatt wrote: > >> CA Clipper was the main language > > If I recall correctly it was

Re: [Tutor] Anti-Patterns in Python Programming

2014-07-12 Thread Alan Gauld
On 12/07/14 20:24, Deb Wyatt wrote: CA Clipper was the main language If I recall correctly it was one of several variants on DBase? There were also Foxpro and others all sharing similar syntax. I once got a free copy of DBase4 (back in the days when we paid for compilers!) but it is still in

Re: [Tutor] Anti-Patterns in Python Programming

2014-07-12 Thread Deb Wyatt
Wow. Just wow! Thank you for all that information. That was really helpful. Thank you very much!! > What language or languages did you program with? CA Clipper was the main language I used in my former programming life (dBase compiler). A very simple, basic database manipulation language, b

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-12 Thread Jim Byrnes
On 07/12/2014 01:36 PM, Alan Gauld wrote: On 12/07/14 16:34, Jim Byrnes wrote: I guess because I don't have the depth of knowledge to know any better. I wanted to automate a tedious process using Python. I was working with a Python3 version of breezypythongui on a Python2.7 system. So I would

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-12 Thread Alan Gauld
On 12/07/14 16:34, Jim Byrnes wrote: I guess because I don't have the depth of knowledge to know any better. I wanted to automate a tedious process using Python. I was working with a Python3 version of breezypythongui on a Python2.7 system. So I would open a terminal, cd to the correct director

Re: [Tutor] While loop issue, variable not equal to var or var

2014-07-12 Thread Alan Gauld
On 12/07/14 13:19, Steven D'Aprano wrote: Because the person might have typed any of: grosse große etc., and you want to accept them all, just like in English The bit I was missing was that a German user might use the ss version instead the ß so testing for either of them alone is insuffi

Re: [Tutor] While loop issue, variable not equal to var or var

2014-07-12 Thread Wolfgang Maier
On 12.07.2014 14:20, Dave Angel wrote: I don't remember my high school German enough to remember if the ß character is an example, but in various languages there are characters that exist only in uppercase, and whose lowercase equivalent is multiple letters. Or vice versa. And characters

Re: [Tutor] While loop issue, variable not equal to var or var

2014-07-12 Thread Wolfgang Maier
On 12.07.2014 14:19, Steven D'Aprano wrote: On Sat, Jul 12, 2014 at 11:27:17AM +0100, Alan Gauld wrote: On 12/07/14 10:28, Steven D'Aprano wrote: If you're using Python 3.3 or higher, it is better to use message.casefold rather than lower. For English, there's no real difference: ... but it ca

Re: [Tutor] While loop issue, variable not equal to var or var

2014-07-12 Thread Steve Rodriguez
Thank you guys! Works perfectly! :D Regards, Steve Rodriguez On Sat, Jul 12, 2014 at 1:21 AM, Peter Otten <__pete...@web.de> wrote: > Peter Otten wrote: > > > PS: You sometimes see > > > > message in "qQ" > > > > but this is buggy as it is true when the message is either > > "q", "Q", or "qQ".

Re: [Tutor] Anti-Patterns in Python Programming

2014-07-12 Thread Alan Gauld
On 12/07/14 17:43, Deb Wyatt wrote: So much has been invented since my dos programming days and it is overwhelming, Actually very little has been *invented* since your DOS days. Almost everything we do today was already around back then. I knew someone was going to say that. :-) Maybe

Re: [Tutor] While loop issue, variable not equal to var or var

2014-07-12 Thread Joseph Lee
Hi Steve, In your conditionals: … while message != 'q' or 'Q'/message != “q” or message != “Q”: … Python will only match the first variable. A better approach (which might be a good solution) would be capturing the exit commands in a list like this: JL’s code: while message not in [“q”, “Q”]

Re: [Tutor] Anti-Patterns in Python Programming

2014-07-12 Thread Steven D'Aprano
Hi Deb, My answers are interleaved with your questions. On Sat, Jul 12, 2014 at 08:43:30AM -0800, Deb Wyatt wrote: > Some questions I have at the moment: > > 1. What is functional programming? > 2. What is procedural programming? > 3. What are data patterns? > 4. What are regular expressi

Re: [Tutor] Anti-Patterns in Python Programming

2014-07-12 Thread R. Alan Monroe
> what is a hash value? Some clever person back in the 1950s realized that computers were better at numbers than names. So they came up with some gimmicks to convert names to numbers. It was probably something fancier than "a=1, b=2, etc. Now let's add up all the letters of the person's name to ma

Re: [Tutor] Anti-Patterns in Python Programming

2014-07-12 Thread Mark Lawrence
On 12/07/2014 17:43, Deb Wyatt wrote: So much has been invented since my dos programming days and it is overwhelming, Actually very little has been *invented* since your DOS days. Almost everything we do today was already around back then. I knew someone was going to say that. Maybe it's t

Re: [Tutor] Anti-Patterns in Python Programming

2014-07-12 Thread Deb Wyatt
>> So much has been invented since my dos programming days and it is >> overwhelming, > > Actually very little has been *invented* since your DOS days. > Almost everything we do today was already around back then. > I knew someone was going to say that. Maybe it's the jargon that has been inven

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-12 Thread Jim Byrnes
On 07/12/2014 03:02 AM, Alan Gauld wrote: On 12/07/14 02:29, Jim Byrnes wrote: I've worked on this a little more. If I create a file like: #!/usr/bin/python import os, subprocess subprocess.Popen(args=["gnome-terminal", "--working-directory=/home/jfb/Documents/Prog/Python/breezygui"]) an

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-12 Thread Jim Byrnes
On 07/11/2014 10:50 PM, Cameron Simpson wrote: On 11Jul2014 20:29, Jim Byrnes wrote: I've worked on this a little more. If I create a file like: #!/usr/bin/python import os, subprocess subprocess.Popen(args=["gnome-terminal", "--working-directory=/home/jfb/Documents/Prog/Python/breezygui"])

Re: [Tutor] While loop issue, variable not equal to var or var

2014-07-12 Thread Dave Angel
Steven D'Aprano Wrote in message: > On Sat, Jul 12, 2014 at 09:33:20AM +0100, Alan Gauld wrote: > >> 2) Better (IMHO) is to convert message to lower case (or upper if >> you prefer) and only do one comparison: >> >> while message.lower() != 'q': > > I second this advice, but with a slight modif

Re: [Tutor] While loop issue, variable not equal to var or var

2014-07-12 Thread Steven D'Aprano
On Sat, Jul 12, 2014 at 11:27:17AM +0100, Alan Gauld wrote: > On 12/07/14 10:28, Steven D'Aprano wrote: > > >If you're using Python 3.3 or higher, it is better to use > >message.casefold rather than lower. For English, there's no real > >difference: > >... > >but it can make a difference for non-E

Re: [Tutor] While loop issue, variable not equal to var or var

2014-07-12 Thread Alan Gauld
On 12/07/14 10:28, Steven D'Aprano wrote: If you're using Python 3.3 or higher, it is better to use message.casefold rather than lower. For English, there's no real difference: ... but it can make a difference for non-English languages: py> "Große".lower() # German for "great" or "large" 'groß

Re: [Tutor] While loop issue, variable not equal to var or var

2014-07-12 Thread Steven D'Aprano
On Sat, Jul 12, 2014 at 09:33:20AM +0100, Alan Gauld wrote: > 2) Better (IMHO) is to convert message to lower case (or upper if > you prefer) and only do one comparison: > > while message.lower() != 'q': I second this advice, but with a slight modification. If you're using Python 3.3 or higher,

Re: [Tutor] While loop issue, variable not equal to var or var

2014-07-12 Thread Alan Gauld
On 11/07/14 22:16, Steve Rodriguez wrote: Hey guys n gals, New to python, having some problems with while loops, I would like to make a program quick once q or Q is typed, but thus far I can only get the first variable to be recognized. > My code looks like: > > message = raw_input("-> ")

Re: [Tutor] Anti-Patterns in Python Programming

2014-07-12 Thread Alan Gauld
On 12/07/14 05:50, Deb Wyatt wrote: So much has been invented since my dos programming days and it is overwhelming, Actually very little has been *invented* since your DOS days. Almost everything we do today was already around back then. eg. - The mouse is from the 60s - Touch-screens are fro

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-12 Thread Alan Gauld
On 12/07/14 02:29, Jim Byrnes wrote: I've worked on this a little more. If I create a file like: #!/usr/bin/python import os, subprocess subprocess.Popen(args=["gnome-terminal", "--working-directory=/home/jfb/Documents/Prog/Python/breezygui"]) and execute it, it will take me to the correc

Re: [Tutor] While loop issue, variable not equal to var or var

2014-07-12 Thread Peter Otten
Peter Otten wrote: > PS: You sometimes see > > message in "qQ" > > but this is buggy as it is true when the message is either > "q", "Q", or "qQ". Oops, I forgot "". ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription option

Re: [Tutor] While loop issue, variable not equal to var or var

2014-07-12 Thread Peter Otten
Steve Rodriguez wrote: > Hey guys n gals, > > New to python, having some problems with while loops, I would like to make > a program quick once q or Q is typed, but thus far I can only get the > first variable to be recognized. My code looks like: > > message = raw_input("-> ") > while m