Re: [Tutor] Alternatives to PY2EXE

2006-11-16 Thread Tim Golden
[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... One option which could help there -- although your other considerations might outweigh it -- is Fredrik Lundh's e

Re: [Tutor] exception problems in socket programming

2006-11-16 Thread Kent Johnson
Vinay Reddy wrote: > 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)) > exce

Re: [Tutor] Alternatives to PY2EXE

2006-11-16 Thread Chris Hengge
I'm personally not to picky... I just want the tool to work, and like I said, for some reason I'm having trouble running very simple scripts from py2exe, which I dont seem to have while using pyInstaller. I've even written a drag and drop front-end for it (had one for py2exe too) to make using it

Re: [Tutor] Alternatives to PY2EXE

2006-11-16 Thread Tim Golden
[Chris Hengge] | It really does boggle my mind how people can be so wierd when | asked to run something that isn't a .exe... Guess its a | side-effect of the windows generation. I know exactly what you mean. I had to convince a project manager once to use Python (in some small, out-of-the-way

Re: [Tutor] Alternatives to PY2EXE

2006-11-16 Thread etrade . griffiths
Thanks for the various advice(s) re PY2EXE alternatives. I considered installing Python on the target machines but though it would be simpler to install the EXE as I has done with C++ apps. Boy, how naive was that? Using PY2EXE is not straightforward and the documentation is fairly poor IMHO.

[Tutor] A strange problem--Django

2006-11-16 Thread Asrarahmed Kadri
Hi , I am trying to view this URL: http://www.developeriq.com/aboutus.php3. But my browser (IE 7) is giving me the following message; It worked! Congratulations on your first Django-powered page. Of course, you haven't actually done any work yet. Here's what to do next: If you plan to use a d

Re: [Tutor] A strange problem--Django

2006-11-16 Thread Simon Brunning
On 11/16/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote: > I am trying to view this URL: > http://www.developeriq.com/aboutus.php3. > > But my browser (IE 7) is giving me the following message; > > > It worked! > Congratulations on your first Django-powered page. > Of course, you haven't actually d

Re: [Tutor] A strange problem--Django

2006-11-16 Thread Asrarahmed Kadri
Its not me and I dont know what is Django. :)- Asrarahmed On 11/16/06, Simon Brunning <[EMAIL PROTECTED]> wrote: On 11/16/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote: > I am trying to view this URL: > http://www.developeriq.com/aboutus.php3. > > But my browser (IE 7) is giving me the fo

Re: [Tutor] A strange problem--Django

2006-11-16 Thread Simon Brunning
On 11/16/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote: > Its not me and I dont know what is Django. :)- Google does: . ;-) But anyway, it looks like there's a problem at developeriq's end, so you'll have to contact them to get it fixed. -- Cheers, Simon

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

2006-11-16 Thread Asrarahmed Kadri
Thanks for your reply, John. I'll get back to you if I get stuck. Regards, Asrarahmmed On 11/16/06, John Fouhy <[EMAIL PROTECTED]> wrote: 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) > a

Re: [Tutor] free IDE for Python?

2006-11-16 Thread doug shawhan
I know it's merely a text editor, but for any non-gui stuff I use SciTE. The little execution pane is gawgeous, gawgeous, gawgeous. (Though I find it best to use at least a 19" monitor! ) On 11/15/06, Chris Hengge <[EMAIL PROTECTED]> wrote: BTW... that also counts as my vouce for using SPE =D

Re: [Tutor] free IDE for Python?

2006-11-16 Thread Mike Hansen
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Alan Gauld > Sent: Wednesday, November 15, 2006 4:49 PM > To: tutor@python.org > Subject: Re: [Tutor] free IDE for Python? > > > "wesley chun" <[EMAIL PROTECTED]> wrote > > Eclipse > >http://p

[Tutor] Recursive functions and the windows registry

2006-11-16 Thread Todd Dahl
I have been fighting with this for a couple of days and am getting frustrated with it. I am trying to figure out a way to walk through the windows registry and to capture all nodes under the HKEY_CLASSES_ROOT\CLSID key and then put it into a list. I have been trying to do it with a recursive fu

[Tutor] how to extract time from datetime.date.time()

2006-11-16 Thread Asrarahmed Kadri
Hi, I want to extract hh:mm:ss from below mentioned code: import datetime t = datetime.datetime.now() print t 2006-11-16 16:59:02.843000 How to do it? TIA. Regards, Asrarahmed -- To HIM you shall return. ___ Tutor maillist - Tutor@python.org htt

Re: [Tutor] how to extract time from datetime.date.time()

2006-11-16 Thread Mike Hansen
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Asrarahmed Kadri > Sent: Thursday, November 16, 2006 10:29 AM > To: tutor-python > Subject: [Tutor] how to extract time from datetime.date.time() > > Hi, > > I want to extract hh:mm:ss from below

Re: [Tutor] how to extract time from datetime.date.time()

2006-11-16 Thread Jason Massey
How about two different ways: import datetime t = datetime.datetime.now() t datetime.datetime(2006, 11, 16, 11, 28, 15, 75) t.hour 11 t.minute 28 t.second 15 a = "%d:%d:%d" % (t.hour,t.minute,t.second) a '11:28:15' or, a bit more succinctly: t.strftime('%H:%M:%S') '11:28:15'

Re: [Tutor] how to extract time from datetime.date.time()

2006-11-16 Thread Noufal Ibrahim
Asrarahmed Kadri wrote: > Hi, > > I want to extract hh:mm:ss from below mentioned code: > > import datetime t = datetime.datetime.now() print t > 2006-11-16 16:59:02.843000 > > How to do it? Did you read the documentation and try something out before posting this question on the li

Re: [Tutor] how to extract time from datetime.date.time()

2006-11-16 Thread Python
On Thu, 2006-11-16 at 17:28 +, Asrarahmed Kadri wrote: > Hi, > > I want to extract hh:mm:ss from below mentioned code: > > import datetime > >>> t = datetime.datetime.now() > >>> print t > 2006-11-16 16:59:02.843000 > > How to do it? The python interpreter can be pretty helpful for this

Re: [Tutor] how to extract time from datetime.date.time()

2006-11-16 Thread Terry Carroll
On Thu, 16 Nov 2006, Asrarahmed Kadri wrote: > I want to extract hh:mm:ss from below mentioned code: > > import datetime > >>> t = datetime.datetime.now() > >>> print t > 2006-11-16 16:59:02.843000 > > How to do it? In addition to the suggestions you've seen, now() returns a datetime object, a

Re: [Tutor] free IDE for Python?

2006-11-16 Thread William O'Higgins Witteman
On Thu, Nov 16, 2006 at 08:36:25AM -0700, Mike Hansen wrote: >I found the getting started docs got me going with Eclipse and Pydev. > >http://www.fabioz.com/pydev/manual_101_root.html > >I still find myself using VIM more than Eclipse. I'll need to play with >Eclipse some more to make a decision i

Re: [Tutor] exception problems in socket programming

2006-11-16 Thread Vinay Reddy
> in other words you are tuple-unpacking the exception. Since it is not a > tuple, but a single value, you get an error. Try this: >except socket.error, e: > if self.s: > self.s.close() > print "Could not open socket: " + e.message Thanks a lot! I had to ma

Re: [Tutor] how to extract time from datetime.date.time()

2006-11-16 Thread Kent Johnson
Terry Carroll wrote: > If you don't want the fractional part of the seconds, you can use the > ordinary string methods to find the dot and slice off only the part you > want to keep. For example: > s[0:s.find('.')] > '10:56:04' or s.split('.')[0] which you can put into your one-liner. Ke

Re: [Tutor] how to extract time from datetime.date.time()

2006-11-16 Thread Terry Carroll
On Thu, 16 Nov 2006, Kent Johnson wrote: > or s.split('.')[0] which you can put into your one-liner. Yes, but that would not have given me the opportunity to write that extravagantly run-on sentence. ___ Tutor maillist - Tutor@python.org http://mail

Re: [Tutor] Tutor Digest, Vol 33, Issue 64

2006-11-16 Thread Danny Yoo
> I have been fighting with this for a couple of days and am getting > frustrated with it. I am trying to figure out a way to walk through the > windows registry and to capture all nodes under the > HKEY_CLASSES_ROOT\CLSID key and then put it into a list. Ok, let's do this carefully. Let's fir

Re: [Tutor] free IDE for Python?

2006-11-16 Thread Mike Hansen
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of William > O'Higgins Witteman > Sent: Thursday, November 16, 2006 12:08 PM > To: tutor@python.org > Subject: Re: [Tutor] free IDE for Python? > > On Thu, Nov 16, 2006 at 08:36:25AM -0700, Mike Hanse

[Tutor] email content-type: text/plain

2006-11-16 Thread shawn bright
hey there all, i am using the email package and the phone provider i am trying to get a text message thru has sent me an email that says that they are looking for a tag that says 'content-type text/plain' i have tried about everything i can think of to get it in there, but everything i have tried

Re: [Tutor] email content-type: text/plain

2006-11-16 Thread Chris Hengge
Not sure if I'm really helping, but I want to try for all the help I've gotten... I took this from: http://docs.python.org/lib/module-email.message.html ## *class MIMEText*( _text[, _subtype[, _charset]]) Module: email.mim

Re: [Tutor] email content-type: text/plain

2006-11-16 Thread Chris Hengge
I just re-read your email, and I dont think I answered it accurately since you apparently want plain... so maybe you can still use my example for "force" the type? On 11/16/06, Chris Hengge <[EMAIL PROTECTED]> wrote: Not sure if I'm really helping, but I want to try for all the help I've gotten

Re: [Tutor] email content-type: text/plain

2006-11-16 Thread shawn bright
use MIMEText(message, 'someTypeThatIsn'tPlain') ? but type/plain is what i am after. i am a bit confused here. It defaults to plain, but there is not anything in the message headers that say what type it is. Should i use MIMEText(message, 'text/plain') ? thanks sk On 11/16/06, Chris Hengge <[E

Re: [Tutor] email content-type: text/plain

2006-11-16 Thread Chris Hengge
I would start by "forcing" 'text/plain'. If that doesn't work maybe take a look at: *set_type*( type[, header][, requote]) Set the main type and subtype for the Content-Type: header. type must be a string in the form maintype/subtype, otherwise a ValueError is raised. This method replaces the Con

Re: [Tutor] email content-type: text/plain

2006-11-16 Thread Chris Hengge
Just so you can compare... msg = MIMEText.MIMEText("How are you!?") email.Message.Message.get_content_type(msg) 'text/plain' On 11/16/06, Chris Hengge <[EMAIL PROTECTED]> wrote: I would start by "forcing" 'text/plain'. If that doesn't work maybe take a look at: * set_type*( type[, header][,

Re: [Tutor] free IDE for Python?

2006-11-16 Thread Dave S
On Monday 13 November 2006 23:03, Vadhri, Srinivas wrote: > Hi > > > > A newbie to Python. What is the free IDE for Python development > activities? ActiveState's Komodo IDE needs a license and a fee. > > > > Any recommendations? Eric3/4 works for me :) http://www.die-offenbachs.de/detlev/eric3-s

[Tutor] .sort(key = ???)

2006-11-16 Thread Dave S
Hi, I have a bunch of lists within lists that I need to sort ref item [4], I can't access my code at the moment but I basically ... a = [[...], [...], ] a.sort(item4) def item4(a,b): return a[4], b[4] Having googled I think there is a better way of doing this with the key attrib

Re: [Tutor] email content-type: text/plain

2006-11-16 Thread Python
On Thu, 2006-11-16 at 15:57 -0600, shawn bright wrote: > use MIMEText(message, 'someTypeThatIsn'tPlain') ? but type/plain is > what i am after. > i am a bit confused here. It defaults to plain, but there is not > anything in the message headers that say what type it is. Should i use > MIMEText(me

Re: [Tutor] .sort(key = ???)

2006-11-16 Thread John Fouhy
On 17/11/06, Dave S <[EMAIL PROTECTED]> wrote: > Hi, > > I have a bunch of lists within lists that I need to sort ref item [4], I can't > access my code at the moment but I basically ... > [...] > > Having googled I think there is a better way of doing this with the key > attribute > > a.sort(key=

Re: [Tutor] Recursive functions and the windows registry

2006-11-16 Thread Alan Gauld
"Todd Dahl" <[EMAIL PROTECTED]> wrote > By the way I don't understand why it seems to work inside the > ListRegistryKeys function but it doesn't pass all the information > back to > the parseRegistry function. > def ListRegistryKeys(path): > ... >name = [] > >try: >while 1: >

Re: [Tutor] .sort(key = ???)

2006-11-16 Thread Dave S
On Thursday 16 November 2006 22:35, John Fouhy wrote: > On 17/11/06, Dave S <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I have a bunch of lists within lists that I need to sort ref item [4], I > > can't access my code at the moment but I basically ... > > [...] > > > Having googled I think there is

Re: [Tutor] .sort(key = ???)

2006-11-16 Thread Alan Gauld
"Dave S" <[EMAIL PROTECTED]> wrote > I have a bunch of lists within lists that I need to sort ref item > [4], I can't > access my code at the moment but I basically ... > > a = [[...], [...], ] > a.sort(item4) > > def item4(a,b): > return a[4], b[4] > > > Having googled I think there is a be

[Tutor] Returning compound objects?

2006-11-16 Thread Danny Yoo
On Thu, 16 Nov 2006, Chris Hengge wrote: > I didn't send this to the list because I didn't want to go off-topic. [Meta] Then let's start a new topical thread. Let's call this one "Returning compound objects?" and work from there. But please let's keep this on Tutor; I'm serious when I say

Re: [Tutor] .sort(key = ???)

2006-11-16 Thread John Fouhy
Incidentally, I was wondering what the value of using operator.itemgetter is. So I ran some tests. Morpork:~/offlode repton$ python -m timeit -s 'import math' -s 'a = [(i, math.sin(i)) for i in range(1)]' -s 'f = lambda e: e[1]' 'sorted(a, key=f)' 10 loops, best of 3: 22.4 msec per loop Morp

Re: [Tutor] email content-type: text/plain

2006-11-16 Thread shawn bright
ok, will try this out tomorrow at work. thanks. sk On 11/16/06, Python <[EMAIL PROTECTED]> wrote: On Thu, 2006-11-16 at 15:57 -0600, shawn bright wrote: > use MIMEText(message, 'someTypeThatIsn'tPlain') ? but type/plain is > what i am after. > i am a bit confused here. It defaults to plain,

Re: [Tutor] Tutor Digest, Vol 33, Issue 67

2006-11-16 Thread Danny Yoo
> > while True: # use the boolean value, its clearer IMHO :-) >try: > name.append(...) > print name[-1] > i += 1 >except WindowsError: pass > [some comments cut] > > Note that this call will create a new name list inside the recursive > call. You probably need to do: > >

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

2006-11-16 Thread Senthil_OR
Hi Alan, Greetings. Alan Gauld wrote: >> 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... I too use vim for a variety of editing tasks. From xml,

[Tutor] problem with defining a global class instance

2006-11-16 Thread sharath B N
hi, i am sort of newbie to python. I am trying to do a super Market simulation with OOP in python. I have problems with using a class instance as global... def generate (... ,,...) " in this function i define the global variables " global stock,stockManager, manager etc. class Manager ... .