Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 25 Oct 2014, 11:39
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Python : Changing Global Variable's Value from a function
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
suttiwit

Joined: 11 Jul 2013
Posts: 27
Location: Chiang Mai, Thailand

PostPosted: Fri 06 Sep 2013, 00:45    Post_subject:  Python : Changing Global Variable's Value from a function
Sub_title: How do I do it?
 

How do I change Global Variable's Value (that is situated outside of any functions) from within a function?

Is it possible? How can I do it?

One thing: Don't show me better practices.

Thanks
Back to top
View user's profile Send_private_message Visit_website 
suttiwit

Joined: 11 Jul 2013
Posts: 27
Location: Chiang Mai, Thailand

PostPosted: Fri 06 Sep 2013, 01:54    Post_subject: Got it solved.  

Got it solved now.
What I did is declare the global variable (eg. gvar) like this in a function:
Code:
global gvar


Pretty cool.
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0432s ][ Queries: 11 (0.0074s) ][ GZIP on ]