Re: [Tutor] exception problems in socket programming

2006-11-15 Thread Chris Hengge
I ran this code based on yours: import socket, sys s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: s.connect(('something.com', 5000)) except socket.error, (value, message): if s: s.close() print "Could not open socket: " + message raw_input("\nPress any key") And I got

[Tutor] exception problems in socket programming

2006-11-15 Thread Vinay Reddy
Hi, I'm trying to do some simple network programming in Python, but am stuck with exception problems. Here's the relevant code snippet: self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: self.s.connect((something.com, 5000)) except socket.error, (value, message):

Re: [Tutor] Alternatives to PY2EXE

2006-11-15 Thread Chris Hengge
Just want to add to that... As of the day before yesturday I've been using pyInstaller rather then py2exe(which I've used the last few months) I've found some bug that I can't figure out and dont really care to put effort into fixing.. When I run a py.exe using py2exe from the start menu and the

Re: [Tutor] SIP-4.4 Install Borked

2006-11-15 Thread J. D. Leach
No need to answer now. I had to resort to the ole' tried-and-true method of aggressive search and destroy. After savagely excising all remnants of sip-4.4, I was able to reload the previous version and get everything back up. Sorry to have troubled you all. On Wednesday 15 November 2006 07:46 p

Re: [Tutor] free IDE for Python?

2006-11-15 Thread Chris Hengge
BTW... that also counts as my vouce for using SPE =D On 11/15/06, Chris Hengge <[EMAIL PROTECTED]> wrote: I tried it back before I tried SPE. I remember it taking several hours and being very bloated. Have you watched the showmedo video? Thats what I used... http://showmedo.com/videos/series?n

Re: [Tutor] free IDE for Python?

2006-11-15 Thread Chris Hengge
I tried it back before I tried SPE. I remember it taking several hours and being very bloated. Have you watched the showmedo video? Thats what I used... http://showmedo.com/videos/series?name=PyDevEclipseList If I personally "had" to use something that obnoxious I'd just reinstall ironpython and

Re: [Tutor] Alternatives to PY2EXE

2006-11-15 Thread Chris Hengge
Because alot of the users here at Intel dont want to admit you can write usable programs in a "scripting" language.. so when they see a .exe they feel comfy... I'm working on pushing "agile language"... I personally think its more appropriate then scripting =D On 11/15/06, Alan Gauld <[EMAIL PRO

[Tutor] SIP-4.4 Install Borked

2006-11-15 Thread J. D. Leach
To All, This is, and isn't, Python related, but thought you may be of some assisstance. Running Mandriva 2006 on a 1.8Mhz Dell GX260. Also: Python 3.4.2, ERIC3 3.8.1, etc. Problem: was going to update to ERIC3 3.9.2 and downloaded SIP-4.4, PyQT, and others. Started installation with SIP, which

Re: [Tutor] Help me with this problem relating to datetime

2006-11-15 Thread John Fouhy
On 16/11/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote: > Hi Folks, > > > I have got a date (as string), time (as string) , number of slots ( integer) > and delta ( which is in seconds). > I want to create a dictionary which has got date as the key, and the value > should be a tuple with two eleme

Re: [Tutor] numpy memory muncher

2006-11-15 Thread Kent Johnson
Alan Gauld wrote: >> I can reproduce the problem on my Linux system, so it is not Mac >> specific. Using xrange makes no difference. > > I believe that in recent Pythons (v2.3 onwards?) xrange is just > an alias for range since range was reimplementted to use > generators. So the old menory iss

Re: [Tutor] Help me with this problem relating to datetime

2006-11-15 Thread Luke Paireepinart
Asrarahmed Kadri wrote: > Hi Folks, > > > I have got a date (as string), time (as string) , number of slots ( > integer) and delta ( which is in seconds). > I want to create a dictionary which has got date as the key, and the > value should be a tuple with two elements (start_time, end_time).

Re: [Tutor] Help me with this problem relating to datetime

2006-11-15 Thread Asrarahmed Kadri
SOrry for that. I was wondering if someoen can give a hint about the implementation. I am not asking for the actual code. Regards, Asrarahmed On 11/16/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote: Asrarahmed Kadri wrote: > Hi Folks, > > > I have got a date (as string), time (as string) , nu

[Tutor] Help me with this problem relating to datetime

2006-11-15 Thread Asrarahmed Kadri
Hi Folks, I have got a date (as string), time (as string) , number of slots ( integer) and delta ( which is in seconds). I want to create a dictionary which has got date as the key, and the value should be a tuple with two elements (start_time, end_time). I will take start_time and find the end

Re: [Tutor] Alternatives to PY2EXE

2006-11-15 Thread Alan Gauld
"Etrade Griffiths" <[EMAIL PROTECTED]> wrote > just finished developing my first app with wxPython and matplotlib > and now > trying to create an EXE file using PY2EXE for distribution. > However, this > is proving to be an extremely frustrating experience and I am making > very > little progre

Re: [Tutor] removing an image from a tkinter label

2006-11-15 Thread Orri Ganel
Alan Gauld wrote: >"Orri Ganel" <[EMAIL PROTECTED]> wrote > > > >>In the end, setting lbl["image"] = "" worked >> >> > >Glad it worked. I was just about to suggest creating an image >with the "No image" text in it. You could then just display that >as the default image... > >Alan G. > > >

Re: [Tutor] removing an image from a tkinter label

2006-11-15 Thread Alan Gauld
"Orri Ganel" <[EMAIL PROTECTED]> wrote > In the end, setting lbl["image"] = "" worked Glad it worked. I was just about to suggest creating an image with the "No image" text in it. You could then just display that as the default image... Alan G.

Re: [Tutor] free IDE for Python?

2006-11-15 Thread Alan Gauld
"wesley chun" <[EMAIL PROTECTED]> wrote > Eclipse >http://pydev.sourceforge.net >http://www.eclipse.org/ Has anyone got an idiot's guide to getting Eclipse working with python? I've tried a couple of times but ran out of patience. In fact I haven't really got vanilla Eclipse working f

[Tutor] OT: Vim was: free IDE for Python?

2006-11-15 Thread Alan Gauld
>> I've used vim in the past for python and recommend it for ease of >> use and support. > > I have to chuckle when you recommend Vim for ease of use. Me too, and I've been a vi/elvis/viper/vim user for over 20 years(*). vi/vim could never be described as easy to learn, but... ... ease of

Re: [Tutor] Sloppy Code ?

2006-11-15 Thread Alan Gauld
"Matt Erasmus" <[EMAIL PROTECTED]> wrote > Yes, that does help, although it doesn't print the FQDN which is > what > I'm really after. > But thanks to you I now know about the socket module It is very rarely necessaary to use popen etc to get basic system information or to perform basic OS comma

Re: [Tutor] numpy memory muncher

2006-11-15 Thread Alan Gauld
> I can reproduce the problem on my Linux system, so it is not Mac > specific. Using xrange makes no difference. I believe that in recent Pythons (v2.3 onwards?) xrange is just an alias for range since range was reimplementted to use generators. So the old menory issues with range no longer ap

Re: [Tutor] Use of dateutil.relativedata

2006-11-15 Thread Etrade Griffiths
Sorry, problem solved import datetime import dateutil.relativedelta x=datetime.date.today() y=x+datetime.timedelta(days=366) z=y-x print x,y,z a=dateutil.relativedelta.relativedelta(x,y) print a seems to do the trick ___ Tutor maillist - Tutor@py

[Tutor] Use of dateutil.relativedata

2006-11-15 Thread Etrade Griffiths
Hi trying to use dateutil to calculate the number of months between two dates. here is the script import datetime import dateutil x=datetime.date.today() y=x+datetime.timedelta(days=366) z=y-x print x,y,z a=dateutil.relativedelta(x,y) print a and here is the output >>> 2006-11-15 2007-11