Traceback (most recent call last):
File "", line 20, in ?
File "c:\Python24\lib\encodings\zlib_codec.py", line 43, in zlib_decode
output = zlib.decompress(input)
zlib.error: Error -5 while decompressing data
The -5 error appears to be a Z_BUF_ERROR from looking at the manual at
http://www.zlib.ne
"ncf" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I don't mean this harshly, but have you tried recompressing the data to
> see if you may have had a bad data set?
>
> If it still fails, then I'm really not sure why/how zlib decides that
> there isn't enough room in the output buf
"Andy Leszczynski" wrote in message
news:[EMAIL PROTECTED]
>I have got following program:
>
> import sys
> import binascii
> from string import *
> sys.stdout.write(binascii.unhexlify("41410A4141"))
>
>
> when I run under Unix I got:
>
> $ python u.py > u.bin
> $ od -t x1 u.bin
> 000 41 41 0a
"Nikola" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm currently learning Python for my own use.
> I'm considering installing it on a work laptop, knowing that it is
> non-licensed, distributable software.
>
> However, does it access communication ports? I know the company che
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I want to scan a file byte for byte for occurences of the the four byte
> pattern 0x0100. I've tried with this:
>
> # start
> import sys
>
> numChars = 0
> startCode = 0
> count = 0
>
> inputFile = sys.stdin
>
> while True:
>ch =
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I want to scan a file byte for byte for occurences of the the four byte
> pattern 0x0100. I've tried with this:
>
> # start
> import sys
>
> numChars = 0
> startCode = 0
> count = 0
>
> inputFile = sys.stdin
>
> while True:
>ch =
"Paul Watson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>>I want to scan a file byte for byte for occurences of the the four byte
>> pattern 0x0100. I've
"Mike Meyer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "Paul Watson" <[EMAIL PROTECTED]> writes:
...
> Did you do timings on it vs. mmap? Having to copy the data multiple
> times to deal with the overlap - thanks to strings being i
"Alex Martelli" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> In today's implementations of Classic Python, yes. In other equally
> valid implementations of the language, such as Jython, IronPython, or,
> for all we know, some future implementation of Classic, that may well
> not
It is clear that just using 'print' with variable names is relatively
uncontrollable. However, I thought that using a format string would
reign the problem in and give the desired output.
Must I resort to sys.stdout.write() to control output?
$ python
Python 2.4.1 (#1, Jul 19 2005, 14:16:43)
[
Fredrik Lundh wrote:
> Paul Watson wrote:
>
>>This is Cyngwin on Windows XP.
>
> using cygwin to analyze performance characteristics of portable API:s
> is a really lousy idea.
Ok. So, I agree. That is just what I had at hand. Here are some other
numbers to which due d
Alex Martelli wrote:
...
gc.garbage
>
> [<__main__.a object at 0x64cf0>, <__main__.b object at 0x58510>]
>
> So, no big deal -- run a gc.collect() and parse through gc.garbage for
> any instances of your "wrapper of file" class, and you'll find ones that
> were forgotten as part of a cyclic g
Steve Holden wrote:
>> Since everyone needs this, how about building it in such that files
>> which are closed by the runtime, and not user code, are reported or
>> queryable? Perhaps a command line switch to either invoke or suppress
>> reporting them on exit.
>>
> This is a rather poor substi
Paul Rubin wrote:
> [EMAIL PROTECTED] (John J. Lee) writes:
>
>>Closing off this particular one would make it harder to get benefit of
>>non-C implementations of Python, so it has been judged "not worth it".
>>I think I agree with that judgement.
>
>
> The right fix is PEP 343.
I am sure you ar
Alex Martelli wrote:
> Steve Holden <[EMAIL PROTECTED]> wrote:
>...
>
>>>The runtime knows it is doing it. Please allow the runtime to tell me
>>>what it knows it is doing. Thanks.
>>
>>In point oif fact I don't believe the runtime does any such thing
>>(though I must admit I haven't checke
I cannot yet get tkinter working on 2.4.2. I have installed the tk rpms
from FC4. I have checked to see that TKPATH is available in
Modules/Setup.
How can I verify that I have tcl/tk installed correctly and it is the
correct version (8+)?
--
http://mail.python.org/mailman/listinfo/python-l
Paul Watson wrote:
> I cannot yet get tkinter working on 2.4.2. I have installed the tk rpms
> from FC4. I have checked to see that TKPATH is available in
> Modules/Setup.
>
> How can I verify that I have tcl/tk installed correctly and it is the
> correct version (8+)?
Simon Brunning wrote:
> On 14/11/05, john boy <[EMAIL PROTECTED]> wrote:
>
>>I have started out trying to learn Python for my first programming language.
>> I am starting off with the book "how to think like a computer scientist."
>>I spend about 4-5 hrs a day trying to learn this stuff. It is ce
Chad Everett wrote:
> Hello all,
>
> Have a problem here with a challenge from a book I am reading.
> Any help is much appreciated.
>
> I am trying to run a program that asks the user for a statement and then
> prints it out backwards.
> this is what I have.
> It does not print anything out. I
Chad Everett wrote:
> Hey guys,
>
> Thanks for the hint.
> I found that info last night but I could never get it to print more than
> just the last letter.
> or it would only print partially.
> I was using just a single colon, the double colon did it.
If you were using a single colon, then it w
Ksenia Marasanova wrote:
> Hi,
>
> I have python2.3, installed from port /lang/python long time ago. The
> current version is 2.4, but I'd rather have two python versions,
> instead of upgrading.
> Is there maybe a way to somehow link installed python to
> /lang/python2.3 port, and then upgrade po
Sinan Nalkaya wrote:
> hello everybody,
> how can i just get 1 character ? i`ve done a search but just found
> getch() for windows, i need same for unix and raw_input has any option
> that is not documented ?
> thanks.
Please use Google.
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/1
What are the options?
The user to hits a web page, downloads code (Python I hope), execute it,
and be able to return the results. It needs to be able to go through
standard HTTP so that it could be run from behind a corporate firewall
without any other ports being opened.
Am I stuck doing an
tim wrote:
> Hi all, I'm almost as new to this list as to python so I hope I don't
> get a "this has been answered a 100 times before" or anything...
>
> Currently I am using a program named 'Macro Scheduler' for automating
> programs that don't have a command line version.
> Its a simple script
Steve wrote:
> AJAX works because browsers can execute javascript. I don't know of a
> browser that can execute python. Basically your stuck with java or
> javascript because everything else really isn't cross platform.
Well, I guess the Grail browser could run Python, but I do not think I
can
Kent Johnson wrote:
> Stephen Kellett wrote:
>
>> In message <[EMAIL PROTECTED]>,
>> Steve <[EMAIL PROTECTED]> writes
>>
>>> AJAX works because browsers can execute javascript. I don't know of a
>>> browser that can execute python. Basically your stuck with java or
>>> javascript because everyt
David Wahler wrote:
> Steve wrote:
>
>>AJAX works because browsers can execute javascript. I don't know of a
>>browser that can execute python. Basically your stuck with java or
>>javascript because everything else really isn't cross platform
>
>
> Don't jump to conclusions...
> http://dwahler
John J. Lee wrote:
> Paul Watson <[EMAIL PROTECTED]> writes:
>
>
>>What are the options?
>>
>>The user to hits a web page, downloads code (Python I hope), execute it,
>>and be able to return the results. It needs to be able to go through
>>standa
Robin Becker wrote:
> Paul Watson wrote:
> ..
>
>>> -- David
>>
>>
>>
>> This looks interesting, but looks even more fragile than CrackAJAX.
>>
>> http://www.aminus.org/blogs/index.php/phunt/2005/10/06/subway_s_new_ajax_framework
>>
When I try to build 2.4.2 on AIX 4.3, it fails on missing thread
objects. I ran ./configure --without-threads --without-gcc.
Before using --without-threads I had several .pthread* symbols missing.
I do not have to have threading on this build, but it would be helpful
if it is possible. The
Neal Norwitz wrote:
> Paul Watson wrote:
>
>>When I try to build 2.4.2 on AIX 4.3, it fails on missing thread
>>objects. I ran ./configure --without-threads --without-gcc.
>>
>>Before using --without-threads I had several .pthread* symbols missing.
>
>
&g
Any ideas why ./Modules/cjkcodecs/_codecs_cn.c fails to compile? It
appears that the CODEC_STATELESS macro is concatenating 'hz' with a
number and text.
building '_codecs_cn' extension
cc -DNDEBUG -O -I. -I/home/pwatson/src/python/Python-2.4.2/./Include
-I/home/pwatson/src/python/Python-2.4.2
Martin v. Löwis wrote:
> Paul Watson wrote:
>
>> Any ideas why ./Modules/cjkcodecs/_codecs_cn.c fails to compile? It
>> appears that the CODEC_STATELESS macro is concatenating 'hz' with a
>> number and text.
>
>
> More likely, hz is already defined
Martin v. Löwis wrote:
> Paul Watson wrote:
>
>> Any ideas why ./Modules/cjkcodecs/_codecs_cn.c fails to compile? It
>> appears that the CODEC_STATELESS macro is concatenating 'hz' with a
>> number and text.
>
>
> More likely, hz is already defined
Martin v. Löwis wrote:
> Paul Watson wrote:
>
>> Can we #undef _ALL_SOURCE for _codecs_cn.c compilation?
>
>
> Where does _ALL_SOURCE come from? Why is it defined?
> What is its effect on hz?
>
> Regards,
> Martin
Martin v. Löwis wrote:
> Paul Watson wro
Martin v. Löwis wrote:
> Paul Watson wrote:
>
>> It appears that _ALL_SOURCE gets defined in the
>> /usr/include/standards.h file. If we could #define _ANSI_C_SOURCE or
>> _POSIX_SOURCE, it appears that it would eleminate _ALL_SOURCE.
>
>
> Ah, ok - this sh
mojosam wrote:
> I've been watching the flame war about licenses with some interest.
> There are many motivations for those who participate in this sector, so
> disagreements over licenses reflect those agendas.
>
> I don't have an agenda, at least not right now. I do plan on writing a
> few prog
[EMAIL PROTECTED] wrote:
> I want to write to the pins of an RS232 without using the serial
> protocol. The use would be every pin could act to complete a circuit
> in customized hardware. I could use python to communicate serially to
> a BASIC stamp or a Javelin stamp and then use the stamp to s
[EMAIL PROTECTED] wrote:
> I'm not what you'd call a "programmer" of any sort, so perhaps this
> question may seem arcane and result in a plethora of "you idiot"
> threads, but here goes:
>
> ArcGIS 9.1 has a neat interface with python (2.1-2.4), allowing me to
> do all sorts of spatial operations
#!/usr/bin/env python
# Using a print statement to stdout results in an
# unwanted space character being generated at the
# end of each print output. Same results on
# DOS/Windows and AIX.
#
# I need precise control over the bytes that are
# produced. Why is print doing this?
#
impor
character written to standard output is "\n", or (3) when the last write
> operation on standard output was not a print statement."
>
> As you can see a space char is written and is correct as per the docs.
>
> Rgds
>
> Tim
>
> Paul Watson wrote:
>> #!/usr/
"Aziz McTang" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi Paul,
>
> Thanks for your input.
>
> As usual, hearing some answers helps formulate the question...
>
> What I'm looking for is more to learn one good, comprehensive
> programming language well than several approximatel
"Charles Krug" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> The target of the problems (my daughter) would prefer that the thousands
> be delimited. Is there a string function that does this?
Be sure to use the locale approach and avoid rolling your own.
--
http://mail.py
"Gregory Piñero" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi guys,
I'm trying to run this statement:
os.system(r'"C:\Program Files\Mozilla Firefox\firefox.exe"' + '
"www.blendedtechnologies.com"')
The goal is to have firefox open to that website.
When I type r'"C:\Program Fi
I see the list of standard encodings in Python 2.4.1 documentation
section 4.9.2.
Is there a method to enumerate the registered codecs at runtime?
--
http://mail.python.org/mailman/listinfo/python-list
John Machin wrote:
> Paul Watson wrote:
>
>> I see the list of standard encodings in Python 2.4.1 documentation
>> section 4.9.2.
>>
>> Is there a method to enumerate the registered codecs at runtime?
>
> This has been asked before, within the last coup
[EMAIL PROTECTED] wrote:
> Hi,
> My company is involved in the development of many data marts and
> data-warehouses, and I currently looking into migrating our old set of
> tools (written in Korn) to a new, more dynamic and robust one. I am
> looking into python as I have heard that it could be a g
$ python
Python 2.4.1 (#1, May 16 2005, 15:19:29)
[GCC 4.0.0 20050512 (Red Hat 4.0.0-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import codecs
>>> codecs.lookup('ascii')
(, ,
, )
>>> codecs.lookup('mbcs')
Traceback (most recent call last):
File ""
Sells, Fred wrote:
> We are in the process of standardizing ~10 Linux servers on Lineox 4.x,
> which is a variant of RedHat Enterprise server I'm told. Part of that
> process is to standardize python.
>
> The baseline install includes python 2.3 which is adequate, but I would like
> to standardiz
[EMAIL PROTECTED] wrote:
> Can someone explain to me the output of this simple script? I wonder
> why ['test1.txt'] is printed before "files in c:\", and also why None
> shows up?
>
>
> in file test.py:
>
> def main():
>
> print "files in c:\ :%s" % ListFiles("c:\")
>
> de
cantabile wrote:
> Hi, being a newbie in Python, I'm a bit lost with the '-*- coding : -*-'
> directive.
>
> I'm using an accented characters language. Some of them are correctly
> displayed while one doesn't. I've written :
> -*- coding: utf-8 -*-
>
> Is this wrong ?
>
> Where can I find a pr
Dan Sommers wrote:
> On Sun, 14 Aug 2005 01:04:04 GMT,
> Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
>
>
>>On 13 Aug 2005 13:18:21 -0700, [EMAIL PROTECTED] declaimed the following
>>in comp.lang.python:
>
>
>>>Are you kidding? You are going to MANDATE spaces?
>>>
>>
>> After the backlash,
John Machin wrote:
> Paul Watson wrote:
>
>> Dan Sommers wrote:
>>
>>> On Sun, 14 Aug 2005 01:04:04 GMT,
>>> Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
>>>
>>>
>>>> On 13 Aug 2005 13:18:21 -0700, [EMAIL PROTECTED] declaimed
Can a for loop be used in a one-liner? What am I missing?
$ python -c "import sys;print ''.join([line for line in
sys.stdin.readlines()]),"
now is
the time
now is
the time
$ python -c "import sys;for line in sys.stdin.readlines(): print line,"
File "", line 1
import sys;for line in sys.
[EMAIL PROTECTED] wrote:
> to me it seems the ',' is superfluous, this works: python -c "import
> sys;print ''.join([l for l in sys.stdin.readlines()])" in 2.4.1 - with
> the comma it works as well but it looks weird, as if you want to
> un-pack a tuple.
Without the comma, an additional newline i
BranoZ wrote:
> Paul Watson wrote:
>
>>Can a for loop be used in a one-liner? What am I missing?
>>
>>$ python -c "import sys;for i in range(5): print i,"
>> File "", line 1
>> import sys;for i in range(5): print i,
>>
BranoZ wrote:
> In "man python"
> "Here command may contain multiple statements separated by
> newlines. Leading whitespace is significant in Python statements!"
>
> In "man bash" search for \n (/\\n)
> Frankly, I know bash for 10 years, but this has surprised me, too.
>
> BranoZ
Using a '$' be
mhenry1384 wrote:
> On WinXP, I am doing this
>
> nant.exe | python MyFilter.py
>
> This command always returns 0 (success) because MyFilter.py always
> succeeds.
>
> MyFilter.py looks like this
>
> while 1:
> line = sys.stdin.readline()
> if not line:
> break
> ...
> sy
steve morin wrote:
> http://www.python.org/doc/2.4.1/lib/node110.html
>
> These methods are being deprecated. What are they being replaced
> with? Does anyone know?
>
> Steve
It might be helpful to compare the following lists.
Python 2.1 (#1, May 23 2003, 11:43:56) [C] on aix4
Type "copyright
Sorry, the previous post was based on Python 2.1. That is probably not
of much interest. How about 2.4.1?
Python 2.4.1 (#1, Jul 19 2005, 14:16:43)
[GCC 4.0.0 20050519 (Red Hat 4.0.0-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import string
>>> dir
Mohammed Altaj wrote:
> Hi All
>
> Thanks for your reply , what i am doing is , i am reading from file ,
> using readlines() , I would like to check in these lines , if there is
> line belong to another one or not , if it is , then i would like to
> delete it
>
> ['0132442\n', '13\n', '24\n']
>
Has anyone done or worked on a port of Python to the Treo?
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
> Rick Wotnaz wrote:
>
>> Michael Hoffman <[EMAIL PROTECTED]> wrote in
>> news:[EMAIL PROTECTED]:
>>
>>> What would people think about adding sys to __builtins__ so that
>>> "import sys" is no longer necessary? This is something I must
>>> add to every script I write that's not
"Gregor" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> There's a DOS console application I am trying to script (in Python), but
> it
> doesn't seem to use stdout or stderr... For example, if I redirect output
> to a file ("cmd > file.txt"), the output still appears on screen.
> Si
"Earl Eiland" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> os.path.getsize(Inputdirectory + '\\' + Filename) works, but
> os.path.getsize(Inputdirectory + '\\' + Filename.split('.') + '.ext')
> Fails reporting "no such file or directory
> InputDirectory\\Filename.ext".
> os.path.g
"Peter Hansen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Simon John wrote:
>> If you're using a GUI, then that may help you decode the platform too -
>> for example wxPython has wx.Platform, there's also platform.platform()
>> , sys.platform and os.name
>>
>> You could try impo
"George Jempty" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm undergoing a phone interview for a Jython job today. Anybody have
> practical advice for me? I haven't worked with Python in years, but I
> have been working with Java in the meantime (resume at
> http://scriptify.
I have read some of the talk around these two frameworks.
Would you say that web2py is more geared toward the enterprise?
Which one do you believe will be on Python 3 more quickly?
--
http://mail.python.org/mailman/listinfo/python-list
I need to call some Windows APIs. Is the only way to download ctypes or
the win32 interfaces? Is there any plan to get ctypes batteries into
the standard Python build?
--
http://mail.python.org/mailman/listinfo/python-list
Neil Hodgson wrote:
> Paul Watson:
>
>> Is there any plan to get ctypes batteries into the standard Python build?
>
>
>It is unlikely that ctypes will be included in the standard Python
> build as it allows unsafe memory access making it much easier to crash
&
Martin v. Löwis wrote:
> Paul Watson wrote:
>
>>I need to call some Windows APIs. Is the only way to download ctypes or
>>the win32 interfaces?
>
>
> That depends on the specific win32 interface you want to call.
> Typically, the answer is "yes".
I hav
Cuyler wrote:
> I would like to display a file in its binary form (1s and 0s), but I'm
> having no luck... Any thoughts would be most appreciated.
If you are on a UNIX system, or on Windows with Cygwin, you can use the
'od' command to dump a file in hex or octal.
man od
od -Ax -t
Martin v. Löwis wrote:
> Paul Watson wrote:
>
>>I need to call GetVersionInfo() and handle VERSIONINFO information. I
>>thought that distutils might have something, but I do not see it yet.
>>Any suggestions?
>
> You could write this specific API in VB, and then r
Neil Hodgson wrote:
> Paul Watson:
>
>> I cannot find any way to get to GetVersionInfo in VBScript (cscript).
>
>
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> Wscript.Echo objFSO.GetFileVersion("c:\bin\SciLexer.dll")
Many thanks. Ju
rbt wrote:
> Is it safe to say that any value returned by os.system() other than 0 is
> an error?
>
> if os.system('winver') != 0:
> print "Winver failed!"
> else:
> print "Winver Worked."
>
> Thanks!
What are you really seeking to do? Are you wanting to detect if your
code is running
Ron Griswold wrote:
> Hi Dennis,
>
> Yes, I am equating a unix soft link to a windows shortcut. Both act as
> links to a file or directory.
>
> I have found that windows shortcuts do appear in linux dir listings with
> a .lnk extension, however the file is meaningless to linux. On the other
> ha
Martin P. Hellwig wrote:
> [EMAIL PROTECTED] wrote:
>
>> Does anybody know how to get the:
>>
>> Free hard disk space
>> Amount of CPU load
>> and Amount of RAM used
>>
>> on windows? I am making an artificial intelligence program that has
>> "moods" based on how much stress the sys
ankit wrote:
> Hi All,
> I want to remove a substring from a string without any additional
> tabs/returns in the output string. Is there any method availaible or
> how can I do it. For the ease, I am giving an example:
>
> [code]
> mainstr ="""
> ${if:isLeaf}
> Dont include this isLeaf=True
> ${
pycraze wrote:
> Hi guys,
>
> I Need to know how do i create a dictionary... eg:
> n = pali_hash
> n={}
> n={1:{ } } -> i need to know how to make a key of a dictionary, to a
> dictionary using Python/C API's
It looks like you are asking how to create a dictionary (hash). If it
is more t
GHUM wrote:
> I stumbled apon a paragraph in python-dev about "reducing the size of
> Python" for an embedded device:
>
> """
> In my experience, the biggest gain can be obtained by dropping the
> rarely-used
> CJK codecs (for Asian languages). That should sum up to almost 800K
> (uncompressed), I
Fredrik Lundh wrote:
> Danny Scalenotti wrote:
>
>> I'm not able to get out of this ...
>>
>> from xml.dom.minidom import getDOMImplementation
>>
>> impl = getDOMImplementation() // default UTF-8
>> doc = impl.createDocument(None, "test",None)
>> root = doc.documentElement
>> root.setAttribu
David Isaac wrote:
> I have no experience with database applications.
> This database will likely hold only a few hundred items,
> including both textfiles and binary files.
>
> I would like a pure Python solution to the extent reasonable.
>
> Suggestions?
>
> Thank you,
> Alan Isaac
If you wan
It would appear that xml.dom.minidom or xml.sax.* might be the best
thing to use since PyXML is going without support. Best of all it is
included in the base Python distribution, so no addition hunting required.
Is this right thinking? Is there a better solution?
--
http://mail.python.org/mai
Andrew Sackville-West wrote:
> Hi list,
>
> I am new to python and old to coding (as in I did it a long time
> ago). I've got a task that cries out for a scripted solution --
> importing chunks of ASCII data dumps from a point-of-sale system into
> an openoffice.org spreadsheet. What a great chan
Ian F. Hood wrote:
> Hi
> In typically windows environments I have used:
> if 'Windows' in os.environ['OS']...
> to prove it, but now I need to properly support different environments.
> To do so I must accurately determine what system the python instance is
> running on (linux, win, mac, etc)
Stefan Antonelli wrote:
> Hi,
>
> i have to convert several timestamps. The given format, eg "-mm-dd
> hh:mm:ss"
> has to be converted to an epoch string. Is there any proper way to do this?
>
> If not, i have to split the given string and resolve this by a calculation?
>
> Thanks for help.
smartbei wrote:
> Felix Benner wrote:
>> smartbei schrieb:
>>> Hello, I am a newbie with python, though I am having a lot of fun using
>>> it. Here is one of the excersizes I am trying to complete:
>>> the program is supposed to find the coin combination so that with 10
>>> coins you can reach a ce
Better alternative.
cointype = (100, 10, 5, 1, 0.5)
def coins(fin):
needed = {}
for c in cointypes:
v, r = divmod(fin, c)
if v > 0:
needed[c] = v
fin = r
return needed
if __name__ == '__main__
Tim Roberts wrote:
> [EMAIL PROTECTED] wrote:
>> Interesting impl in Python! I am wondering what if the requirement is
>> to find the minimum number of coins which added to the "fin" sum...
>
> Given the set of coins in the original problem (100, 10, 5, 1, 0.5), the
> solution it provides will alw
JTree wrote:
> Thanks everyone!
>
> Sorry for my ambiguous question.
> I changed the codes and now it works fine.
>
>
>
> JTree wrote:
>> Hi,all
>> I encountered a problem when using unicode() function to fetch a
>> webpage, I don't know why this happenned.
>> My codes and error messa
./configure
make
make test
The result appears to hang after the test_tkl... line. I had to kill
the 'make test' process which terminated it. Any suggestions?
280 tests OK.
4 tests failed:
test_optparse test_socket test_socket_ssl test_urllib2
35 tests skipped:
test_aepack test_al te
Martin v. Löwis wrote:
> Paul Watson schrieb:
>> ./configure
>> make
>> make test
>>
>> The result appears to hang after the test_tkl... line. I had to kill
>> the 'make test' process which terminated it. Any suggestions?
>
> There isn
Eric Price wrote:
> Hello;
> I'm studying some code examples from the python cookbook site. I came
> across this:
>
> def colsplit(l, cols):
>rows = len(l) / cols
>if len(l) % cols:
>rows += 1
>m = []
>for i in range(rows):
>m.append(l[i::rows])
>return m
>
>
Paul Watson wrote:
> Eric Price wrote:
>> Hello;
>> I'm studying some code examples from the python cookbook site. I came
>> across this:
>>
>> def colsplit(l, cols):
>>rows = len(l) / cols
>>if len(l) % cols:
>>rows += 1
>
jbchua wrote:
> Hello everybody.
>
> I am an Electrical Engineering major and have dabbled in several
> languages such as Python, C, and Java in my spare time because of my
> interest in programming. However, I have not done any practical
> programming because I have no idea where to get started.
Christoph Zwerschke wrote:
> On the page http://wiki.python.org/moin/Python3%2e0Suggestions
> I noticed an interesting suggestion:
>
> "These operators ≤ ≥ ≠ should be added to the language having the
> following meaning:
>
> <= >= !=
>
> this should improve readibility (and make language
Lawrence Oluyede wrote:
> "eels" <[EMAIL PROTECTED]> writes:
>
>
>>With yyy = ftp.retrlines('LIST') I get this listing at stdout, but I
>>need this information at variable yyy.
>>How can I resolve this problem?
>
>
> As written in the doc retrlines has an optional parameter (a callback
> funct
"Sara Khalatbari" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> There are a lot of commands that I need to use in my
> code & I don't know how to do it
>
> Is there a way to use shell commands in Python code?
Yes, there are many popen() forms that you may wish to investigate. Bel
"len" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I am an old time
> cobol programmer from the IBM 360/370 eria and this ingrained idea of
> file processing using file definition (FD's) I believe is causing me
> problems because I think python requires a different way of looking
Tequila wrote:
> I'm having some trouble starting PythonCard on my PC.
>
> I've downloaded and ran python-2.5.msi to install Python on my
> machine. And PythonCard-0.8.2.win32.exe to install PythonCard.
>
> When I try to run the program I get the following error:
> =
1 - 100 of 133 matches
Mail list logo