Re: from a module return a class

2016-03-20 Thread kevind0718
On Thursday, March 17, 2016 at 12:19:39 PM UTC-4, kevin...@gmail.com wrote: > Hello: > > Working with python 2.7. > > I have a module promptUser_PWord that will prompt a user for their user name > and pword. Works fine stand alone. > I also have a module, genXLS that does a bunch of processing

from a module return a class

2016-03-20 Thread kevind0718
Hello: Working with python 2.7. I have a module promptUser_PWord that will prompt a user for their user name and pword. Works fine stand alone. I also have a module, genXLS that does a bunch of processing it has worked fine for months. And a class Unamepword define as follows: class Unamepwo

Re: from a module return a class

2016-03-19 Thread Laurent Pointal
John Gordon wrote: > In > kevind0...@gmail.com writes: > >> ## prompt the user for a User name a& pWord >> user_pword = promptUser_PWord() > >> I get the error >> File "H:\dev\eclipse\workspace\genXls\src\genXls\promptUser_PWord.py", >> line 58 >> return user_pword >> SyntaxErr

Re: from a module return a class

2016-03-19 Thread kevind0718
On Thursday, March 17, 2016 at 1:21:16 PM UTC-4, John Gordon wrote: > In > kevind0...@gmail.com writes: > > > ## prompt the user for a User name a& pWord > > user_pword = promptUser_PWord() > > > I get the error > > File "H:\dev\eclipse\workspace\genXls\src\genXls\promptUser_PWor

Re: from a module return a class

2016-03-19 Thread John Gordon
In <56eaecc8$0$3658$426a7...@news.free.fr> Laurent Pointal writes: > >> user_pword = promptUser_PWord() > > > > Show us the complete definition of promptUser_PWord(). > AFAIU It looks to be the module… If it were a module, it wouldn't be callable. It has to be a function or a class. -

Re: from a module return a class

2016-03-19 Thread Rick Johnson
On Thursday, March 17, 2016 at 1:24:10 PM UTC-5, Laurent Pointal wrote: > So the error: SyntaxError: 'return' outside function My suspicion is the the OP misunderstands how modules work. He is assuming that he can return a value from them. But without the source, who knows??? I think John has th

Re: from a module return a class

2016-03-19 Thread kevind0718
On Friday, March 18, 2016 at 12:16:13 PM UTC-4, John Gordon wrote: > In Wolfgang Maier > writes: > > > > So promptUser_PWord is a module? Well, I'm confused. You gave us this > > > bit of code: > > > > > > user_pword = promptUser_PWord() > > > > > > But that can't work if promptUser_PWor

Re: from a module return a class

2016-03-19 Thread Laurent Pointal
kevind0...@gmail.com wrote: > Hello: > > Working with python 2.7. > > I have a module promptUser_PWord that will prompt a user for their user > name and pword. Works fine stand alone. > I also have a module, genXLS that does a bunch of processing it has worked > fine for months. And a class U

Re: from a module return a class

2016-03-19 Thread Rick Johnson
On Thursday, March 17, 2016 at 1:24:10 PM UTC-5, Laurent Pointal wrote: > So the error: SyntaxError: 'return' outside function >>> return SyntaxError: 'return' outside function -- https://mail.python.org/mailman/listinfo/python-list

Re: from a module return a class

2016-03-19 Thread Wolfgang Maier
On 18.03.2016 16:08, John Gordon wrote: In kevind0...@gmail.com writes: As requested , full code for promptUser_PWord So promptUser_PWord is a module? Well, I'm confused. You gave us this bit of code: user_pword = promptUser_PWord() But that can't work if promptUser_PWord is a mo

Re: from a module return a class

2016-03-19 Thread John Gordon
In kevind0...@gmail.com writes: > ## prompt the user for a User name a& pWord > user_pword = promptUser_PWord() > I get the error > File "H:\dev\eclipse\workspace\genXls\src\genXls\promptUser_PWord.py", line > 58 > return user_pword > SyntaxError: 'return' outside function

Re: from a module return a class

2016-03-18 Thread John Gordon
In kevind0...@gmail.com writes: > As requested , full code for promptUser_PWord So promptUser_PWord is a module? Well, I'm confused. You gave us this bit of code: user_pword = promptUser_PWord() But that can't work if promptUser_PWord is a module; modules aren't callable. promptUs

Re: from a module return a class

2016-03-18 Thread Laurent Pointal
John Gordon wrote: > In <56eaecc8$0$3658$426a7...@news.free.fr> Laurent Pointal > writes: > >> >> user_pword = promptUser_PWord() >> > >> > Show us the complete definition of promptUser_PWord(). > >> AFAIU It looks to be the module… > > If it were a module, it wouldn't be callable. It ha

Re: from a module return a class

2016-03-18 Thread Wolfgang Maier
On 3/18/2016 20:19, kevind0...@gmail.com wrote: so what I get from the various postings is promptUser_PWord must be converted to a class. True? A simple function would also do. Just make sure that the return is inside a callable block. -- https://mail.python.org/mailman/listinfo/python-li

Re: from a module return a class

2016-03-18 Thread John Gordon
In Wolfgang Maier writes: > > So promptUser_PWord is a module? Well, I'm confused. You gave us this > > bit of code: > > > > user_pword = promptUser_PWord() > > > > But that can't work if promptUser_PWord is a module; modules aren't > > callable. promptUser_PWord() has to be a function

Re: from a module return a class

2016-03-18 Thread kevind0718
On Thursday, March 17, 2016 at 4:59:32 PM UTC-4, Rick Johnson wrote: > On Thursday, March 17, 2016 at 1:24:10 PM UTC-5, Laurent Pointal wrote: > > So the error: SyntaxError: 'return' outside function > > My suspicion is the the OP misunderstands how modules work. He is assuming > that he can retu