On 02/12/2011 05:20 AM, Abhishek Gulyani wrote:
When I write binary files in windows:
file = open(r'D:\Data.bin','wb')
file.write('Random text')
file.close()
and then open the file it just shows up as normal text. There is
nothing binary about it. Why is that?
Sorry if this is too much of a
On 07/29/2010 09:12 PM, wheres pythonmonks wrote:
How do I build an "int1" type that has a default value of 1?
You mean something like:
>>> x = int()
>>> x
0
>>> def myint(value=1):
... return int(value)
...
>>> myint()
1
>>>
That's ugly on so many levels..
Anyway, basic types (and almost
Ep, that missing line should be:
On 07/28/2010 04:27 PM, Nick Raptis wrote:
On 07/28/2010 04:15 PM, wheres pythonmonks wrote:
f( *map(lambda x: int(x), struct.unpack('2s2s2s','123456')))
102
But this seems too complicated.
Well, you don't need the lambda at all
i
On 07/28/2010 04:15 PM, wheres pythonmonks wrote:
f( *map(lambda x: int(x), struct.unpack('2s2s2s','123456')))
102
But this seems too complicated.
Well, you don't need the lambda at all
int ===lambda x: int(x)
So just write
It's like writing:
def myint(x):
return int(x)
Nic
Hi Richard!
I have downloaded iptcinfo and placed it in python27\Lib\site-packages
\iptcinfo
I guessed that was the right place, because that is where PIL ended
up, but that had a fancy installer with it.
You did place it in the right path, but the "fancy installer" does one
more thing, it
Hello Dani!
IDLE is very friendly for new users and has got me a long way when I was
starting. You also can't beat that it comes bundled with Python.
I'd also like to suggest the Python-Tutor list
http://mail.python.org/mailman/listinfo/tutor for your "new-user" questions.
Lots of helpful fo
I know I have more radical options, such as starting
a new IDLE window. That would save me time, but
I'd like to take the opportunity to understand what
is happening. Surely someone out there knows.
Frederic
Or you can restart the IDLE shell with CTRL+F6.
If you can't restart it, you're