Re: I have tried and errored a reasonable amount of times

2014-08-31 Thread Steven D'Aprano
For future reference, here is a hint as to how to debug problems like this, and a cleaner way to write the code. Seymore4Head wrote: > On Sat, 30 Aug 2014 13:48:09 -0500, Tim Chase > wrote: >>> if e[0].isupper == False: >>> print ("False") >>> if e[0].isupper == True: >>>

Re: I have tried and errored a reasonable amount of times

2014-08-31 Thread Steven D'Aprano
Seymore4Head wrote: > That would work now, but I didn't even know no.isupper() was command > until 15 min ago.  :) > > I have been told that one is a method and the other calls a method.  I > still have to learn exactly what that means.  I'm getting there. Indeed you are :-) "Command", in Pytho

Re: I have tried and errored a reasonable amount of times

2014-08-31 Thread Chris Angelico
On Sun, Aug 31, 2014 at 6:37 PM, Steven D'Aprano wrote: > - Use print() to see the intermediate results: > > a = e[0].isupper > print(e[0], a, a == False, a == True) And I'll add to this: *Copy and paste* the original code to craft this output statement. I recently was trying to figure ou

Re: Sequencing images using tkinter?

2014-08-31 Thread theteacher . info
Okay. Got it now. Your help is much appreciated. Thanks. -- https://mail.python.org/mailman/listinfo/python-list

Psycopg2 package installation puzzle in Pycharm - any thoughts?

2014-08-31 Thread andydtaylor
Hi, I have a puzzle, for which I would appreciate your opinion on! I have been trying to setup a project in Pycharm with psycopg2. If I install it using pip install it is added. However if I use the Pycharm "preferences>project interpreter>add package" option it fails with the below message.

Re: CAD -> FEM | writing FEM meshes in abacus format || pythonOCC

2014-08-31 Thread hacaoideas
coolbut at what industry are you aiming for? I'm willing to try my hand to model shiphull. On Wednesday, October 21, 2009 5:04:11 AM UTC+7, jelle feringa wrote: > Hi, > > I'm wondering whether someone has experience / code / pointers on > how to write FEM meshes to Abacus ( Simulia, whatev

Re: Psycopg2 package installation puzzle in Pycharm - any thoughts?

2014-08-31 Thread andydtaylor
Actually I realise that postgres app didn't come from brew I wonder if that's the issue On Sunday, 31 August 2014 15:19:24 UTC+1, andyd...@gmail.com wrote: > Hi, > > > > I have a puzzle, for which I would appreciate your opinion on! > > > > I have been trying to setup a project in Pych

Re: Psycopg2 package installation puzzle in Pycharm - any thoughts?

2014-08-31 Thread Chris “Kwpolska” Warrick
On Sun, Aug 31, 2014 at 4:19 PM, wrote: > Hi, > > I have a puzzle, for which I would appreciate your opinion on! That’s not much of a puzzle (a game, toy, or problem designed to test ingenuity or knowledge, as defined by Oxford American College Dictionary via http://google.com/search?q=define+pu

Re: Psycopg2 package installation puzzle in Pycharm - any thoughts?

2014-08-31 Thread Andrea D'Amore
On 2014-08-31 14:19:24 +, andydtay...@gmail.com said: - Installing to a virtualenv python environment. Are you using the virtualenv interpreter as the Pycharm project interpreter? -- Andrea -- https://mail.python.org/mailman/listinfo/python-list

More questions on Python strings

2014-08-31 Thread Dennis E. Evans
Hi I have a function that reads some meta data from a database and builds a default order by and where clause for a table. some details, rows is a list of pyOdbc.Row and will look like this [1, 'ColumnName', 3, 5] there will be one to n elements EmptyString, defaultColumn, default

Re: More questions on Python strings

2014-08-31 Thread MRAB
On 2014-08-31 18:37, Dennis E. Evans wrote: Hi I have a function that reads some meta data from a database and builds a default order by and where clause for a table. some details, rows is a list of pyOdbc.Row and will look like this [1, 'ColumnName', 3, 5] there will be one to n el

Distinguishing between maildir, mbox, and MH files/directories?

2014-08-31 Thread Tim Chase
Tinkering around with a little script, I found myself with the need to walk a directory tree and process mail messaged found within. Sometimes these end up being mbox files (with multiple messages within), sometimes it's a Maildir structure with messages in each individual file and extra holding di

Re: Distinguishing between maildir, mbox, and MH files/directories?

2014-08-31 Thread Dan Stromberg
On Sun, Aug 31, 2014 at 11:45 AM, Tim Chase wrote: > Tinkering around with a little script, I found myself with the need > to walk a directory tree and process mail messaged found within. > Sometimes these end up being mbox files (with multiple messages > within), sometimes it's a Maildir structur

Re: Distinguishing between maildir, mbox, and MH files/directories?

2014-08-31 Thread Terry Reedy
On 8/31/2014 2:45 PM, Tim Chase wrote: Tinkering around with a little script, I found myself with the need to walk a directory tree and process mail messaged found within. Sometimes these end up being mbox files (with multiple messages within), sometimes it's a Maildir structure with messages in

This could be an interesting error

2014-08-31 Thread Seymore4Head
import math import random import sys ex='Hey buddy get away from the car' newex = ex.split() sentence="" print (newex) wait = input (" Wait") def pigword(test): for x in range(len(test)): if test[x] in "AEIOUaeiou": stem = test [x:] prefix = test [:x]

Re: This could be an interesting error

2014-08-31 Thread Seymore4Head
I forgot to mention this is supposed to be piglatin. It prints the prefix and the suffix before printing the translated word. On Sun, 31 Aug 2014 17:02:51 -0400, Seymore4Head wrote: >import math >import random >import sys > >ex='Hey buddy get away from the car' >newex = ex.split() >sentence=""

Re: This could be an interesting error

2014-08-31 Thread Mark Lawrence
On 31/08/2014 22:02, Seymore4Head wrote: import math import random import sys ex='Hey buddy get away from the car' newex = ex.split() sentence="" print (newex) wait = input (" Wait") def pigword(test): for x in range(len(test)): Please read up on how to use for loops as the abo

Re: This could be an interesting error

2014-08-31 Thread MRAB
On 2014-08-31 22:02, Seymore4Head wrote: import math import random import sys ex='Hey buddy get away from the car' newex = ex.split() sentence="" print (newex) wait = input (" Wait") def pigword(test): for x in range(len(test)): if test[x] in "AEIOUaeiou": s

Re: This could be an interesting error

2014-08-31 Thread Seymore4Head
On Sun, 31 Aug 2014 22:38:12 +0100, Mark Lawrence wrote: >On 31/08/2014 22:02, Seymore4Head wrote: >> import math >> import random >> import sys >> >> ex='Hey buddy get away from the car' >> newex = ex.split() >> sentence="" >> >> print (newex) >> wait = input (" Wait") >> >> def pigword

Re: This could be an interesting error

2014-08-31 Thread Michael Torrie
On 08/31/2014 03:02 PM, Seymore4Head wrote: > def pigword(test): > for x in range(len(test)): > if test[x] in "AEIOUaeiou": > stem = test [x:] > prefix = test [:x] > pigword = stem + prefix + "ay" > print ("Stem ",stem) > print

Re: This could be an interesting error

2014-08-31 Thread Seymore4Head
On Sun, 31 Aug 2014 22:53:01 +0100, MRAB wrote: >On 2014-08-31 22:02, Seymore4Head wrote: >> import math >> import random >> import sys >> >> ex='Hey buddy get away from the car' >> newex = ex.split() >> sentence="" >> >> print (newex) >> wait = input (" Wait") >> >> def pigword(test): >

Re: This could be an interesting error

2014-08-31 Thread Mark Lawrence
On 31/08/2014 23:04, Seymore4Head wrote: On Sun, 31 Aug 2014 22:38:12 +0100, Mark Lawrence This is Python so please get rid of those unnecessary brackets. Having brackets must have been required in earlier versions maybe. No :) -- My fellow Pythonistas, ask not what our language can do fo

Re: This could be an interesting error

2014-08-31 Thread Seymore4Head
On Sun, 31 Aug 2014 16:10:27 -0600, Michael Torrie wrote: >On 08/31/2014 03:02 PM, Seymore4Head wrote: >> def pigword(test): >> for x in range(len(test)): >> if test[x] in "AEIOUaeiou": >> stem = test [x:] >> prefix = test [:x] >> pigword = stem + p

Re: This could be an interesting error

2014-08-31 Thread Seymore4Head
On Sun, 31 Aug 2014 22:38:12 +0100, Mark Lawrence wrote: >On 31/08/2014 22:02, Seymore4Head wrote: >> import math >> import random >> import sys >> >> ex='Hey buddy get away from the car' >> newex = ex.split() >> sentence="" >> >> print (newex) >> wait = input (" Wait") >> >> def pigword

Re: More questions on Python strings

2014-08-31 Thread Peter Otten
MRAB wrote: > On 2014-08-31 18:37, Dennis E. Evans wrote: >> >>Hi >> >> I have a function that reads some meta data from a database and builds a >> default order by and where clause for a table. >>Is the a way to build the strings with out using the intermediate >>list? >> >>the e

Re: This could be an interesting error

2014-08-31 Thread Mark Lawrence
On 31/08/2014 23:42, Seymore4Head wrote: On Sun, 31 Aug 2014 22:38:12 +0100, Mark Lawrence Unnecessary brackets? I tried deleting the brackets and that doesn't seem to work. I tried changing the brackets to parenthesizes and that didn't work. Although I would prefer brackets to parenthesizes as

Re: Psycopg2 package installation puzzle in Pycharm - any thoughts?

2014-08-31 Thread andydtaylor
Chris- I have removed the second copy of postgres I had (postgres.app) and updated path variables in .bash_profile: export PATH=$PATH:/usr/local/share/python export PATH=$PATH:/usr/local/bin export PYTHONPATH=$PYTHONPATH:/usr/local/bin/python export PATH=$PATH:/usr/local/Cellar/postgresql/9.3.5_

Re: Psycopg2 package installation puzzle in Pycharm - any thoughts?

2014-08-31 Thread andydtaylor
Chris- I have removed the second copy of postgres I had (postgres.app) and updated path variables in .bash_profile: export PATH=$PATH:/usr/local/share/python export PATH=$PATH:/usr/local/bin export PYTHONPATH=$PYTHONPATH:/usr/local/bin/python export PATH=$PATH:/usr/local/Cellar/postgresql/9

Re: Psycopg2 package installation puzzle in Pycharm - any thoughts?

2014-08-31 Thread andydtaylor
FYI My mac version is Mavericks 10.9.4 -- https://mail.python.org/mailman/listinfo/python-list

Re: This could be an interesting error

2014-08-31 Thread Seymore4Head
On Sun, 31 Aug 2014 16:10:27 -0600, Michael Torrie wrote: >On 08/31/2014 03:02 PM, Seymore4Head wrote: >> def pigword(test): >> for x in range(len(test)): >> if test[x] in "AEIOUaeiou": >> stem = test [x:] >> prefix = test [:x] >> pigword = stem + p

Re: This could be an interesting error

2014-08-31 Thread Seymore4Head
On Mon, 01 Sep 2014 00:21:14 +0100, Mark Lawrence wrote: >On 31/08/2014 23:42, Seymore4Head wrote: >> On Sun, 31 Aug 2014 22:38:12 +0100, Mark Lawrence >> Unnecessary brackets? >> I tried deleting the brackets and that doesn't seem to work. I tried >> changing the brackets to parenthesizes and t

Re: This could be an interesting error

2014-08-31 Thread MRAB
On 2014-09-01 01:04, Seymore4Head wrote: On Sun, 31 Aug 2014 16:10:27 -0600, Michael Torrie wrote: On 08/31/2014 03:02 PM, Seymore4Head wrote: def pigword(test): for x in range(len(test)): if test[x] in "AEIOUaeiou": stem = test [x:] prefix = test [:x]

Re: Psycopg2 package installation puzzle in Pycharm - any thoughts?

2014-08-31 Thread andydtaylor
I have gone ahead and set it all up by using pip install psycopg2 but I would still like to determine why Pycharm couldn't find the $PATH variable -- https://mail.python.org/mailman/listinfo/python-list

Re: This could be an interesting error

2014-08-31 Thread Seymore4Head
On Mon, 01 Sep 2014 01:23:36 +0100, MRAB wrote: >On 2014-09-01 01:04, Seymore4Head wrote: >> On Sun, 31 Aug 2014 16:10:27 -0600, Michael Torrie >> wrote: >> >>>On 08/31/2014 03:02 PM, Seymore4Head wrote: def pigword(test): for x in range(len(test)): if test[x] in "AEIO

Re: Psycopg2 package installation puzzle in Pycharm - any thoughts?

2014-08-31 Thread Mark Lawrence
On 01/09/2014 00:57, andydtay...@gmail.com wrote: FYI My mac version is Mavericks 10.9.4 Please equip yourself with a tool that provides us with some context. There's not much that we can make out of the one line you give above. -- My fellow Pythonistas, ask not what our language can do for

Re: This could be an interesting error

2014-08-31 Thread Mark Lawrence
On 01/09/2014 01:08, Seymore4Head wrote: On Mon, 01 Sep 2014 00:21:14 +0100, Mark Lawrence wrote: On 31/08/2014 23:42, Seymore4Head wrote: On Sun, 31 Aug 2014 22:38:12 +0100, Mark Lawrence Unnecessary brackets? I tried deleting the brackets and that doesn't seem to work. I tried changing the

Re: Distinguishing between maildir, mbox, and MH files/directories?

2014-08-31 Thread Cameron Simpson
On 31Aug2014 13:45, Tim Chase wrote: Tinkering around with a little script, I found myself with the need to walk a directory tree and process mail messaged found within. Sometimes these end up being mbox files (with multiple messages within), sometimes it's a Maildir structure with messages in e

Re: This could be an interesting error

2014-08-31 Thread Ned Batchelder
On 8/31/14 8:56 PM, Mark Lawrence wrote: On 01/09/2014 01:08, Seymore4Head wrote: On Mon, 01 Sep 2014 00:21:14 +0100, Mark Lawrence wrote: On 31/08/2014 23:42, Seymore4Head wrote: On Sun, 31 Aug 2014 22:38:12 +0100, Mark Lawrence Unnecessary brackets? I tried deleting the brackets and that d

Re: This could be an interesting error

2014-08-31 Thread Steven D'Aprano
Seymore4Head wrote: >>'my' doesn't contain a vowel, therefore the condition of the 'if' >>statement in 'pigword' is never true, therefore it never binds to the >>name 'pigword'. >> > Ah.   The piglatin example says to use y as a vowel.  I forgot to > include it. Doesn't matter. What if one of the

Re: This could be an interesting error

2014-08-31 Thread Seymore4Head
On Mon, 01 Sep 2014 12:12:20 +1000, Steven D'Aprano wrote: >Seymore4Head wrote: > >>>'my' doesn't contain a vowel, therefore the condition of the 'if' >>>statement in 'pigword' is never true, therefore it never binds to the >>>name 'pigword'. >>> >> Ah.   The piglatin example says to use y as a v

Re: This could be an interesting error

2014-08-31 Thread Steven D'Aprano
Mark Lawrence wrote: >>return (pigword) >>> These^ ^ >> >> Those are parenthesis :P >> But not having to use them is a time saver. >> Thanks >> > > No they are round brackets, as opposed to square or curly. True, they are round brackets, but the word "parentheses" i

Re: This could be an interesting error

2014-08-31 Thread Seymore4Head
On Sun, 31 Aug 2014 22:12:10 -0400, Ned Batchelder wrote: >On 8/31/14 8:56 PM, Mark Lawrence wrote: >> On 01/09/2014 01:08, Seymore4Head wrote: >>> On Mon, 01 Sep 2014 00:21:14 +0100, Mark Lawrence >>> wrote: >>> On 31/08/2014 23:42, Seymore4Head wrote: > On Sun, 31 Aug 2014 22:38:12 +0

subprocess module usage

2014-08-31 Thread Earl Lapus
Hi, I made simple test program using the subprocess module (see attached: exec_cmd.py). I ran it passing variations of 'ls' command options. I encounter exceptions every time I use '-l' options. Example runs where exception occurs: # ./exec_cmd.py ls -al # ./exec_cmd.py ls -l However, if I pass

Re: subprocess module usage

2014-08-31 Thread Chris Angelico
On Mon, Sep 1, 2014 at 1:28 PM, Earl Lapus wrote: > So, what could be causing this behavior? Is this expected or is there > something wrong with how I'm using the subprocess module? The latter. Your problem is with your shell= option. Firstly, the parameter should be either shell=True or shell=F

Re: This could be an interesting error

2014-08-31 Thread Michael Torrie
On 08/31/2014 06:04 PM, Seymore4Head wrote: >>for x,letter in enumerate(word): >># x is index (position), letter is the value at that index >>if letter in "AEIOUaeiou": > I tried changing: > for x in range(len(test)): > to > for x in enumerate(test): Read my example again. You

Re: This could be an interesting error

2014-08-31 Thread Michael Torrie
On 08/31/2014 10:15 PM, Michael Torrie wrote: > On 08/31/2014 06:04 PM, Seymore4Head wrote: >>>for x,letter in enumerate(word): >>># x is index (position), letter is the value at that index >>>if letter in "AEIOUaeiou": >> I tried changing: >> for x in range(len(test)): >> to >>

Re: This could be an interesting error

2014-08-31 Thread Larry Hudson
On 08/31/2014 07:54 PM, Seymore4Head wrote: [snip] Since I don't ever expect to be able to type them without thinking about them, a standard keyboard could come with half sized keys on the sides. While this is definitely OT, I strongly suggest you take the time to learn to touch-type. (Actually

Re: This could be an interesting error

2014-08-31 Thread Chris Angelico
On Mon, Sep 1, 2014 at 2:55 PM, Larry Hudson wrote: > While this is definitely OT, I strongly suggest you take the time to learn > to touch-type. (Actually, I would recommend it for everyone.) It's true > that it will take time, effort, practice and diligence, especially time and > practice, but

Re: subprocess module usage

2014-08-31 Thread Chris Angelico
On Mon, Sep 1, 2014 at 3:24 PM, Earl Lapus wrote: > On Mon, Sep 1, 2014 at 11:55 AM, Chris Angelico wrote: >> >> But secondly, you're already splitting the argument (or rather, taking >> it from your own parameters, already split), so you don't want to go >> through the shell. In fact, going thro

Re: subprocess module usage

2014-08-31 Thread Earl Lapus
On Mon, Sep 1, 2014 at 11:55 AM, Chris Angelico wrote: > > But secondly, you're already splitting the argument (or rather, taking > it from your own parameters, already split), so you don't want to go > through the shell. In fact, going through the shell would only make > your life harder. Change

Re: subprocess module usage

2014-08-31 Thread Earl Lapus
On Mon, Sep 1, 2014 at 1:39 PM, Chris Angelico wrote: > > Glad it's working! But please, don't just take my word for it and make > a black-box change to your code. When you invoke subprocesses, be sure > you understand what's going on, and when shell=True is appropriate and > when shell=False is a

Re: This could be an interesting error

2014-08-31 Thread Mark Lawrence
On 01/09/2014 03:53, Steven D'Aprano wrote: Mark Lawrence wrote: return (pigword) These^ ^ Those are parenthesis :P But not having to use them is a time saver. Thanks No they are round brackets, as opposed to square or curly. True, they are round brackets, but

Re: This could be an interesting error

2014-08-31 Thread Rustom Mody
On Monday, September 1, 2014 10:42:46 AM UTC+5:30, Chris Angelico wrote: > On Mon, Sep 1, 2014 at 2:55 PM, Larry Hudson wrote: > > While this is definitely OT, I strongly suggest you take the time to learn > > to touch-type. (Actually, I would recommend it for everyone.) It's true > > that it will