SunQuest
           Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old October 6th, 2003, 05:37 PM
Baltor's Avatar
Baltor Baltor is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 67 Baltor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 41 m
Reputation Power: 5
Question imaplib question...

Hi.
I've been messing around with imaplib some and I was wondering how to check if you are logged into a server. Does anyone know how to do this?
Thanks in advance.
__________________
Before you criticize someone, walk a mile in their shoes, that way when you do criticize them, you're a mile away and you have their shoes!

Reply With Quote
  #2  
Old October 14th, 2003, 12:49 PM
irishtek irishtek is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Tucson AZ
Posts: 29 irishtek User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to irishtek Send a message via AIM to irishtek Send a message via Yahoo to irishtek
Well, I have not messed around with imaplib but when you try to connect to a server:
m = imaplib.IMAP4(host="127.0.0.1",port=143)
Will give you a connection refused if you can't connect.

Just put the attempt to connect in a try block as in the example below...


>>> try:
... m = imaplib.IMAP4(host="127.0.0.1",port=143)
... except:
... print("You were not logged in")
...
You were not logged in
>>>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > imaplib question...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway