Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 16th, 2008, 3:44 PM   #1
bevardis
Newbie
 
Join Date: Jun 2008
Posts: 2
Rep Power: 0 bevardis is on a distinguished road
Few questions.

Yes, the title is inaccurate, but I just couldn't think of better.
Questions..
1. How can I save the current, well, 'a'
a = 5
input = input("enter a number: ")
a = a+input
So, how can I save the latest a to another file and use it later. Like a file that contains:
a = 20
b = 464
c = 4644
like main.py and save.py
In main.py I have the thing like a = 5 and the enter a number thing and a=a+number. And when I am using the main script, it auto saves current values, like if I change the a, save.py gets it's current value.


And for the second question: Can I define functions and do other stuff in random.py and somehow import it to main.py and I could use sum(a,b) in the main.py, which is defined in random.py.
I hope you get it.

Thank's in advance,
Bevardis.
bevardis is offline   Reply With Quote
Old Jun 16th, 2008, 4:22 PM   #2
bevardis
Newbie
 
Join Date: Jun 2008
Posts: 2
Rep Power: 0 bevardis is on a distinguished road
Re: Few questions.

I couldn't find edit..
One more question. Is there a way to randomize, something like make it up-to X
or A or B?
bevardis is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
hardware questions programmingnoob Coder's Corner Lounge 28 Aug 8th, 2006 8:04 PM
Novice questions. snafu Python 3 Oct 5th, 2005 5:03 PM
ucf cs student has some questions raspberryh Coder's Corner Lounge 33 Sep 12th, 2005 2:49 PM
Emergency: Confusing C Programming assignment questions silvia C 3 Jul 13th, 2005 3:39 AM
n00b questions..A thread on dumb questions. Cipher Coder's Corner Lounge 12 Apr 12th, 2005 9:42 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:24 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC