473,395 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Re Iptscrae Python and While

While:
This repeatedly tests the expression and, if it is true, executes the first
suite; if the expression is false (which may be the first time it is tested)
the suite of the else clause, if present, is executed and the loop terminates.

The problem with using While as a scanner loop is the loop cycle is carried out
at the natural cycle rate and is fixed, also one would have to define a
function that contained a while loop in order to control it remotely,?

What i want is a loop in which the the cycle rate is a variable, so it can be
controlled globally from other functions, I also need to set a variable to
start and stop the loop so i can call it and set it globally from other
functions and i can see that is possible, by containing the While loop in a
function.
The purpose of the loop is to scan for events, these are the #body, and the
result of those function calls may require a change in the scan rate or for the
scan to stop and command to pass elswhere.. ie another function. While can be
exited using break i know and it can resume using continue. but it seems an
unwieldy and ugly way to do it.
I will study it further though.. perhaps there is a clean way i havent seen
yet.
Thanks. Incony
Jul 18 '05 #1
1 1280

"Bluexcell" <bl*******@aol.com> wrote in message
news:20***************************@mb-m13.aol.com...
What i want is a loop in which the the cycle rate is a variable, so it can be controlled globally from other functions, I also need to set a variable to start and stop the loop so i can call it and set it globally from other
functions and i can see that is possible, by containing the While loop in a function.


I do not quite understand what you want to do. However, when a while loop
inside a function contains a yield statement, then cycling is controlled by
calling .next on the resulting gen-iterator. This can be done from
multiple places, by any function with a reference to the iterator. Hope
this at least gives you more ideas.

Terry J. Reedy


Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Irmen de Jong | last post by:
QOTW: "I'll claim without proof that how mixed-type comparisons work with Python classes is also beyond wizard prediction in all cases: the implementation of comparison in Python is crushingly...
220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
54
by: Brandon J. Van Every | last post by:
I'm realizing I didn't frame my question well. What's ***TOTALLY COMPELLING*** about Ruby over Python? What makes you jump up in your chair and scream "Wow! Ruby has *that*? That is SO...
699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
1
by: Bluexcell | last post by:
I want to create the Python equivalent of an endless loop that i use in Iptscrae: In Iptscrae one creates a dummy spotstate loop and places the calls to routines inside that.. like this: ON...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.