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
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
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
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
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
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
> 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
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
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
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.
--
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
> 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
> > 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
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
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
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
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 ___
> 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
18 matches
Mail list logo