473,387 Members | 1,493 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,387 software developers and data experts.

looped if's stop working

After figuring out how to have a threaded frontend to pass varibles
I've run into a problem. The 'quit' command works as long as issue it
fast enough as soon as the if's start looping. If I wait about 5
seconds, the commands will close the frontend thread but leave the main
loop running. This seems to be becuase the looped ifs stopped
evaluating at all. Is there a better way to do this (events)? If not
how could I keep the if's running?

Thanks

Note- the 'join' command has no effect either.
Code:
#!usr/bin/python
#Filename: NIRC Core

import sys
import irc
import threading

def giveop(user):
pass

def ip():
pass

def uptime():
pass

def auth(user,password,ip):
pass

def kill(user):
pass

def mute(user):
pass

def servertest():
pass

class receiver(threading.Thread):
def run(self):
while 1:
n = raw_input('Enter Bot Commands : ')
if n == 'quit':
funcvars.breaker = True
break
if n == 'join':
funcvars.join = raw_input('Enter Chan Name : ')

class funcvars:
breaker = False
join = ''

NIRC=irc.IRC_Object( )
conn=NIRC.new_connection( )
s = raw_input('Enter Commands : ')
if s == 'quit':
sys.exit()
if s == 'version':
print 'Version Alpha 0.1'
if s == 'ircstart':
conn.nick='Nilzirc'
conn.ident='nilzirc'
conn.server=('irc.deltaanime.net', 6667)
conn.realname='Noobwrangler McNeal'
print 'Connection Started'
receiver().start()
while 1:
NIRC.main_loop( )
if funcvars.breaker == True:
break
if funcvars.join != '':
conn.send_string('JOIN '+funcvars.join)
print 'Ending IRC communication'

Jul 18 '05 #1
0 1005

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

Similar topics

0
by: Adrian Stovold | last post by:
I've written an ASP.NET application in VB.NET. It works fine on all Windows platforms and browsers, but there's a problem on the Mac version of IE (v5.1.5) running on Mac OS 9.2. I can reproduce...
0
by: alec maclean | last post by:
Hi, I'm trying to write a set of charts (as bitmap objects) out to a memory stream so that a variable number of charts can be displayed using just one <img> html tag in a holder page. I have...
5
by: ivaylo.hristov | last post by:
Hi, I am developing application in VB and I it seems that the Outlining option is not working. On the same studio writing a C# application the Stop Outlining option is working just fine, but in...
15
by: rod.weir | last post by:
Fellow database developers, I would like to draw on your experience with views. I have a database that includes many views. Sometimes, views contains other views, and those views in turn may...
10
by: Nik | last post by:
Hello! Thanks for reading my question first! I have many divs with an numeral id ,for example <div id="999">...</div>, <div id="1000">...</div> and I wish to do something like this, for(...
4
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, We have many forms on our site that users can fill out and ask questions, request information etc. but somehow, we receive a lot of junk mails (more than two hundreds) within two weeks...
16
by: haft | last post by:
I have posted this question on a javascript forum as it contains javascript code however it was believed to be an asp issue. The following head section javascript code contains the function...
4
by: paulsaravanan | last post by:
hi all, code is working for IE6 and other browser but its not working in IE7. document.execCommand('Stop') - IE6 code window.stop() - Netscape code can anyone help to stop browser code...
6
by: MrDeej | last post by:
Hello! I have code wich scans the through 10 computers on a LAN for files and import them into different tabels. This code aproximitly imports 10 000 files (with 1 to 20 rows of info) a day and is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.