Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Global Variable Not Updating
Post: RE: Global Variable Not Updating

Thanks jefsummers, that did the trick. I guess if I'm going to do goofy things with globals, I should pay closer attention to the order I'm calling and returning the variables. It works fine now.
joew General Coding Help 2 7,845 Jan-26-2020, 04:15 PM
    Thread: Global Variable Not Updating
Post: Global Variable Not Updating

Based on responses I got from previously posting a question about global variables, the following code should work. But it's not. Clearly, my understanding of how to use global variables in Python is ...
joew General Coding Help 2 7,845 Jan-26-2020, 01:05 PM
    Thread: Is There a Better Way to Truncate Variables?
Post: RE: Is There a Better Way to Truncate Variables?

ichabod801, I hadn't heard of 'integer division' before now. I used your code and it worked beautifully. So I did some reading on the topic and it's very cool. Thank you very much, again! More reputat...
joew General Coding Help 2 1,887 Jan-05-2020, 11:44 PM
    Thread: Is There a Better Way to Truncate Variables?
Post: Is There a Better Way to Truncate Variables?

Hello everyone, Newbie here, and I want to drop the decimal values on a calculated number in my application then multiply it by an integer and end up with an integer with no decimal. But for the life...
joew General Coding Help 2 1,887 Jan-05-2020, 10:32 PM
    Thread: Please help me understand how to use global variables
Post: RE: Please help me understand how to use global va...

Yes, that's a typo. It prints each time through the loop. I don't know if I can edit that code block to correct the mistake for future readers of this thread. It's only there for debugging purposes an...
joew General Coding Help 6 3,603 Jan-05-2020, 06:03 PM
    Thread: Please help me understand how to use global variables
Post: RE: Please help me understand how to use global va...

Thanks again for responding ichabod801. And thank you for doctoring my post. I've read the instructions in the link you sent me and I'll do it properly in the future. Meanwhile, your recommendations ...
joew General Coding Help 6 3,603 Jan-05-2020, 02:18 PM
    Thread: Please help me understand how to use global variables
Post: RE: Please help me understand how to use global va...

Thank you for your response, ichabod801. I understand about the conditional 'If' statement. That was an oversight on my part. I added an 'elif' and 'else', then I moved the return statement to the end...
joew General Coding Help 6 3,603 Jan-04-2020, 10:45 PM
    Thread: Please help me understand how to use global variables
Post: Please help me understand how to use global variab...

I'm new to Python as of 1 week ago and I'm trying to write a simple stock market backtester. In my program, I want to change a global variable called 'prev_entry_price' within a function I've defined ...
joew General Coding Help 6 3,603 Jan-04-2020, 05:08 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020