Re: [Tutor] Hex to Str - still an open issue

2005-02-05 Thread Ismael Garrido
Liam Clarke wrote: Just looking at this - i = 456 s = '' while i: s = str(i % 2) + s i/=2 This works, far simpler than mine, which is always infuriating, but my question is, how exactly? if I have the number 15, when it divides by 2, it will become 7. Yet no error is introduced into the bin

Re: [Tutor] Hex to Str - still an open issue

2005-02-05 Thread Sandip Bhattacharya
Liam Clarke wrote: Sandip - Just looking at this - i = 456 s = '' while i: s = str(i % 2) + s i/=2 This works, far simpler than mine, which is always infuriating, but my question is, how exactly? if I have the number 15, when it divides by 2, it will become 7. Yet no error is introduced

Re: [Tutor] Re: variation of Unique items question

2005-02-05 Thread Liam Clarke
When someone joins the list, they shoudl receive a welcome email that contains - > - a clear description of what you want to do > - sample data > - desired results > - code that attempts to solve the problem as a helpful hint of how to ask questions. I have this bookmarked - http://catb.org/~e

Re: [Tutor] Hex to Str - still an open issue

2005-02-05 Thread Liam Clarke
Oh... and while I hate to use acronyms like this, I did indeed LOL. What happened was, I was feeding the strings I got out into the Windows calculator to check it was working. And they worked if they went backwards, and I was wondering why, and I vaguely recalled something I read in a Java book a

Re: [Tutor] freeze

2005-02-05 Thread Kent Johnson
Shitiz Bansal wrote: Hi, Do exe files generated by py2run on linux???i thought it was only for windows. py2exe makes Windows executables only. http://starship.python.net/crew/theller/py2exe/ Kent Shitiz --- "Jacob S." <[EMAIL PROTECTED]> wrote: My two bits. 1) Download py2exe found here http://py2

Re: [Tutor] freeze

2005-02-05 Thread Jacob S.
Hey! Good question! I have no idea. Jacob Schmidt P.S. Here's a cool setup script for py2exe if you want to try it though. ### setup.py ### # Run the build process by entering 'setup.py py2exe' or # 'python setup.py py2exe' in a console prompt. from distutils.core import setup import py2exe impor

Re: [Tutor] A problem with a Tkinter program (using the text widget)

2005-02-05 Thread Alan Gauld
> Whats wrong here ?? : > from Tkinter import * > def p_text(): > print text.get() > root=Tk() > text=Text(root).pack() pack() retirns None, YOu *must* use two steps: text = Text() text.pack() > button=Button(root,text="Click here!!",command=p_text).pack() > root.mainloop() > > I get an

Re: [Tutor] A problem with a Tkinter program (using the text widget)

2005-02-05 Thread Kent Johnson
Mark Kels wrote: Hi all. Whats wrong here ?? : from Tkinter import * def p_text(): print text.get() root=Tk() text=Text(root).pack() pack() doesn't return a value. You have to do text = Text(root) text.pack() I've been bitten by this one more than once myself :-( Kent button=Button(root,text="C

Re: [Tutor] Hex to Str - still an open issue

2005-02-05 Thread Sandip Bhattacharya
Tamm, Heiko wrote: Ok, thank you. Does anybody know how to convert a HEX into a BINARY? Just trying my hand out on python : To convert the value of i to binary: == i = 456 s = '' while i: s = str(i % 2) + s i/=2 print s = in case you have i in the form of

[Tutor] A problem with a Tkinter program (using the text widget)

2005-02-05 Thread Mark Kels
Hi all. Whats wrong here ?? : from Tkinter import * def p_text(): print text.get() root=Tk() text=Text(root).pack() button=Button(root,text="Click here!!",command=p_text).pack() root.mainloop() I get an error that says that nontype object has no attribute 'get'... whats wrong ?? Thanks. --

Re: [Tutor] Hex to Str - still an open issue

2005-02-05 Thread Kent Johnson
Liam, I think you misunderstand what endianness is. Big-endian and little-endian refer to the way a number is stored as bytes in the underlying memory of the computer. This is not something you generally need to worry about in a Python program. For example, consider the number 0x12345678. On most

Re: [Tutor] question about expressing mathematical equations

2005-02-05 Thread Alan Gauld
> I've spent hours trying things out and I'm no better off. > I don't understand exactly what I'm supposed to do... > alieks The tutor you are using is fairly specialised. What are you trying to learn? Python or math in Python? To learn Python use one of the other tutorials that focus on Pyhon

Re: [Tutor] Hex to Str - still an open issue

2005-02-05 Thread Alan Gauld
> > unfortunately Python doesn't support binary in > > its string formatting(although it does in int()! > > Uh, question. Why not? It seems that all simple types should be included. I agree it has always seemed bizarre that inary is not included but octal is, IMHO binary is more useful as a repres

Re: [Tutor] question about expressing mathematical equations

2005-02-05 Thread Danny Yoo
On Sat, 5 Feb 2005, alieks lao wrote: > I've spent hours trying things out and I'm no better off. I don't > understand exactly what I'm supposed to do. Hi Alieks, What part of the problem are you working on? If you show us what you've tried so far; we can then try to figure out why you're get

Re: [Tutor] freeze

2005-02-05 Thread Shitiz Bansal
Hi, Do exe files generated by py2run on linux???i thought it was only for windows. Shitiz --- "Jacob S." <[EMAIL PROTECTED]> wrote: > My two bits. > > 1) Download py2exe found here > http://py2exe.sourceforge.net/ > 2) Make a setup file -- intructions can be found > through above link, I > thi

Re: [Tutor] Hex to Str - still an open issue

2005-02-05 Thread Liam Clarke
Jacob - just for you, begin your agitation for the next release please ;) binstring.py, as attached. (also pasted up - http://www.rafb.net/paste/results/5feItM57.html) Creating this, was just a brain teaser, but I was thinking 'what if I wanted to make this for the standard library.' And so you

Re: [Tutor] question about expressing mathematical equations

2005-02-05 Thread alieks lao
I've spent hours trying things out and I'm no better off. I don't understand exactly what I'm supposed to do... alieks__Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___

Re: [Tutor] Are you allowed to shoot camels? [kinda OT]

2005-02-05 Thread Alan Gauld
> Surely you jest, Alan. :-) Smiley noted but... > Both perl and awk are turing complete, hence anything perl can do, awk > can do as well. This is a popular misconception. Being Turing complete simply means you can implement any algorithm. But if the language doesn't provide I/O access for ex