Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #73832 > unrolled thread
| Started by | fk26541598fk@gmail.com |
|---|---|
| First post | 2014-07-02 02:43 -0700 |
| Last post | 2014-07-02 18:27 -0700 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.lang.python
How can I catch values from other def by flask??? fk26541598fk@gmail.com - 2014-07-02 02:43 -0700
Re: How can I catch values from other def by flask??? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-02 12:20 +0000
Re: How can I catch values from other def by flask??? Frank Liou <fk26541598fk@gmail.com> - 2014-07-02 18:27 -0700
| From | fk26541598fk@gmail.com |
|---|---|
| Date | 2014-07-02 02:43 -0700 |
| Subject | How can I catch values from other def by flask??? |
| Message-ID | <79aa79d7-bd71-4635-af9d-aae489cc06e4@googlegroups.com> |
this is my code
def aa():
if request.method=='POST':
get_test(value1)
return value1
else:
get_test(value2)
return value2
return 'it does not work'
def post_test(value1):
value1='POST it works'
return value1
def get_test(value2):
value2='GET it works'
how can i catch post_test value1 to aa() return???
[toc] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2014-07-02 12:20 +0000 |
| Message-ID | <53b3f8f9$0$29985$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #73832 |
On Wed, 02 Jul 2014 02:43:28 -0700, fk26541598fk wrote:
> this is my code
Change the code as shown below:
> def aa():
> if request.method=='POST':
> get_test(value1)
> return value1
def aa():
if request.method=='POST':
value1 = post_test()
return value1
> else:
> get_test(value2)
> return value2
else:
value2 = get_test()
return value2
> return 'it does not work'
>
> def post_test(value1):
> value1='POST it works'
> return value1
def post_test():
return 'POST it works'
> def get_test(value2):
> value2='GET it works'
def get_test():
return 'GET it works'
--
Steven
[toc] | [prev] | [next] | [standalone]
| From | Frank Liou <fk26541598fk@gmail.com> |
|---|---|
| Date | 2014-07-02 18:27 -0700 |
| Message-ID | <fce701b5-c3b1-4332-ac8b-57d3f14aad6f@googlegroups.com> |
| In reply to | #73836 |
Steven Thank you!!! it's work i'm so appreciate that hava a nice day^^
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web