Has anyone else had problems running the msi for Python 2.6.6 on Windows 7?
If I don't check Compile .py to byte code, the installer completes
without error.
Checking Compile .py to byte code causes the following to be displayed
There is a problem with the windows installer package. A program
I have a list of 2300 strings.
When I call max() on the list, it returned an item with 37 characters. I am
only passing 1 argument to max().
I know for a fact that the largest item has 57 characters, and when I called
mylist.index('my_57_character_string') the index was found.
Printing
I was looking at a this code which uses this code to dsiplay some hex numbers
sys.stdout.write( \r%-8s ... 0x%08X-0x%08X % ( descr,
long(startAddr), long(endAddr) )
The hex values are in this range
0x1BFFF400 to 1BFFF000
Why are these displayed with a leading negative sign (between the 0x
and
Has anyone ever measured how random (or deterministic) a given sequence of
numbers generated by rand.randint() are?
Using these arguments for rand.randint(0, 1000 )
if a program which calls rand.randint() runs for 10 hours (or a few days),
will it keep generating a repeatable set of numbers
I'm maintaining a framework of tests which are run on a diskless Linux
client, in character mode (no graphical desktop).
The tests often print out a lot of info, which scrolls off the screen.
I'd like to add a 1-2 line no-scroll-area at the top of the screen, so as to
print a message which
See the recent discussion of urwid for discussion of a similar problem.
http://thread.gmane.org/gmane.comp.python.tutor/50500/
This looks interesting.
Thanks!
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
I was just reading the PYMOTW article on the cmd module, and trying
the examples.
http://www.doughellmann.com/PyMOTW/cmd/cmd.html
Scroll down to Auto-Completion.
Does the tab key work for anyone running Windows ?
Is this an OS specific feature?
I see the bash prompts in the article, tab does
The original authors left asserts in many places and I don't want the people
using the code to see the ugly tracebacks.
want to add an unhandled exception handler to a large framework that I'm
maintaining, to make the applications behave better,
Users of a program shouldn't need to know anything
I'm maintaining a large framework of python code where the original
authors left many assert statements.
When an unhandled exception occurs, the traceback is displayed on the
screen. Ideally, I don't want the users to see the tracebacks
from unhandled exceptions, but rather a short, useful
Message: 1
Date: Sat, 5 Jul 2008 16:50:35 -0600
From: Alex Krycek [EMAIL PROTECTED]
Subject: [Tutor] Wave module
To: tutor@python.org
Message-ID:
[EMAIL PROTECTED]
Content-Type: text/plain; charset=iso-8859-1
Hello,
I'm trying to join two .wav files with the wave module. But when I try to
Message: 7
Date: Sat, 05 Jul 2008 12:23:36 -0600
From: Nathan Farrar [EMAIL PROTECTED]
Subject: [Tutor] Exploring the Standard Library
To: Python Tutor tutor@python.org
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=us-ascii
I'd like to spend some time exploring the standard
Message: 5
Date: Mon, 30 Jun 2008 11:49:59 +0200
From: Andre Engels [EMAIL PROTECTED]
Subject: Re: [Tutor] Is var = None in Python equivalent to Set var
= Nothingin VB?
To: Kelie [EMAIL PROTECTED]
Cc: tutor@python.org
Message-ID:
[EMAIL PROTECTED]
Content-Type: text/plain;
This thread got a bit off track
but in Python these statements are unnecessary.
What happened to Explicit is better than implicit?
Regarding the original poster contrasting VB with Python
setting someObject = None is perfectly fine in Python, and a good analogy
between the languages.
Message: 9
Date: Sun, 29 Jun 2008 01:20:16 -0700
From: wesley chun [EMAIL PROTECTED]
Subject: Re: [Tutor] Is var = None in Python equivalent to Set var
= Nothingin VB?
To: [EMAIL PROTECTED], Alan Gauld [EMAIL PROTECTED]
Cc: tutor@python.org
the reason why i ask is because it's not
Wes,
is this not your reply?
the reason why i ask is because it's not standard practice i see
people doing this with Python, so i'm trying to get a better
understanding of what you're trying to do.
thanks!
-- wesley
*exactly* why, other than most of the time, people let objects go
--
Message: 4
Date: Wed, 4 Jun 2008 10:00:46 -0400
From: James [EMAIL PROTECTED]
Subject: [Tutor] Grabbing data from changing website
To: tutor@python.org
Message-ID:
[EMAIL PROTECTED]
Content-Type: text/plain; charset=ISO-8859-1
urllib2 will grab the
A bit OT, but still within the realm of beginning Python...
My co-worker whom has just started learning Python, bought this book in used
condition.
http://www.courseptr.com/ptr_detail.cfm?group=Programmingsubcat=Otherisbn=978%2D1%2D59863%2D112%2D8
Unfortunately it came without the CD, and the
Message: 2
Date: Thu, 15 May 2008 20:10:05 +0200
From: Tim Michelsen [EMAIL PROTECTED]
Subject: [Tutor] Open a directory in the default file manager
To: tutor@python.org
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Hello,
is there any function/module
*Tim Michelsen* timmichelsen at gmx-topmail.de
tutor%40python.org?Subject=Re%3A%20%5BTutor%5D%20Open%20a%20directory%20in%20the%20default%20file%20managerIn-Reply-To=%3Cg0skru%24lep%241%40ger.gmane.org%3E
*Mon May 19 21:36:30 CEST 2008*
- Previous message: [Tutor] Open a directory in the
Message: 7
Date: Thu, 10 Apr 2008 01:46:49 +0100
From: Alan Gauld [EMAIL PROTECTED]
Subject: Re: [Tutor] Copy script
To: tutor@python.org
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; format=flowed; charset=iso-8859-1;
reply-type=original
I don;t see how the input file relates to
Of course they do - they can use input redirection just like Unix.
Oh,-I have forgotten about that.
But why use clunky batch language when you can use Python? After all, he did
post this to the python list.
___
Tutor maillist - Tutor@python.org
Date: Fri, 04 Apr 2008 07:12:11 -0700
From: Dick Moores [EMAIL PROTECTED]
Subject: [Tutor] Don't miss Python-by-example - new online guide to
Python Standard Library
To: Python Tutor List tutor@python.org
Message-ID: [EMAIL PROTECTED]
Dick- there was no url with your message.
Also See
Draft notes for the next Kent's Korner presentation are available at
http://personalpages.tds.net/~kent37/kk/00010.html
Comments welcome.
I vote Kent move out of the korner and into the front of the classroom!
Nice color scheme, easy to look at, good layout, font, size, and small
chunks
Another alternative is Weave
http://www.scipy.org/Weave
But mixing C/C++ with Python sort of defeats the reasons for using
Python to begin with
Message: 2
Date: Sat, 22 Mar 2008 02:44:54 +0100
From: Eike Welk [EMAIL PROTECTED]
Subject: Re: [Tutor] Python to C++
To: tutor@python.org
Message-ID:
Montag, den 24.03.2008, 23:39 -0700 schrieb Tony Cappellini:
Another alternative is Weave
http://www.scipy.org/Weave
But mixing C/C++ with Python sort of defeats the reasons for using
Python to begin with
Message: 2
Date: Sat, 22 Mar 2008 02:44:54 +0100
From: Eike Welk
Kent
Would you show the examples which show where staticmethod
classmethod are used?
I've often wondered about the usefulness of these myself. Having read
many of the popular books on python, none provide a good clear
explanation
of why or where these should be used, and what the alternatives
I don't use classmethods so I can't discuss that. For staticmethods,
suppose I have in foo.py
Where is the word staticmethod in the example below? Where is it used?
This is what I was hoping to see.
class Foo(object):
# Lots of useful stuff
In client.py I have
from foo import
Thanks very much. Not quite sure why I didn't find those earlier! I'll
have a look now.
I think this cuts more to the chase than using a game framework
http://pysonic.sourceforge.net/
___
Tutor maillist - Tutor@python.org
(object):
def __init__(self,cmd):
self.cmdline = cmd
def start(self):
self.process = subprocess.Popen([self.cmdline])
def stop(self):
win32api.TerminateProcess(int(self.process._handle), -1
--michael
On Feb 19, 2008 4:53 PM, Tony Cappellini [EMAIL
On Feb 19, 2008 2:02 PM, bob gailer [EMAIL PROTECTED] wrote:
Tony Cappellini wrote:
When I executing a program external to the main program in a thread,
and that thread hangs, can the thread be terminated?
Please define hangs.
AFAIK that could mean waiting on an external event / signal
http://www.ibiblio.org/swaroopch/byteofpython/read/self.html
Is there a typo in the contents of this web page?
Should this statement
Note for C++/Java/C# Programmers
The self in Python is equivalent to the self pointer in C++ and the
this reference in Java and C#.
Actually be
Note for
The source for copytree says, The destination directory must not
already exist. I suppose that is why you have a problem but I don't
know the specific cause. Did you get a traceback?
The source also says, Consider this example code rather than the
ultimate tool so maybe you should just copy
I'm using shutils for the first time, and I've un into a problem.
The docs for copytree are pretty sparse and don't mention any problem situations
Under WinXP, I'm trying to copy a directory tree to a USB device using
copytree, but copytree doesn't like a drive letter as a destination.
Message: 1
Date: Thu, 3 Jan 2008 08:11:05 -
From: Alan Gauld [EMAIL PROTECTED]
Subject: Re: [Tutor] Choice of GUI builders
To: tutor@python.org
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; format=flowed; charset=iso-8859-1;
reply-type=original
OK, wxPython is a fine toolkt.
Message: 1
Date: Thu, 3 Jan 2008 10:06:01 -0200
From: Tiago Saboga [EMAIL PROTECTED]
Subject: Re: [Tutor] Choice of GUI builders
To: tutor@python.org
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=us-ascii
But since 2005, according to wikipedia, the Qt Windows is also
licensed
with the
particular toolkit by the programmer.
On Jan 3, 2008 1:00 PM, Marc Tompkins [EMAIL PROTECTED] wrote:
On Jan 3, 2008 10:31 AM, Tony Cappellini [EMAIL PROTECTED] wrote:
It's like OCR and speech-to-text. At some point it becomes easier to do it
by hand than to straighten out the dog's breakfast
- Forwarded Message
From: Doug Glenn [EMAIL PROTECTED]
To: Alan Gauld [EMAIL PROTECTED]
Sent: Tuesday, 20 November, 2007 4:08:12 AM
Subject: Re: [Tutor] Wrong version of Python being executed
It is a bit odd since normally Pythons installation mechinism only
does it for the PY file on
of Python is
invoked.
How do other people deal with having multiple versions of Python on
their system, and not run into this issue??
On Nov 10, 2007 6:16 PM, Kent Johnson [EMAIL PROTECTED] wrote:
Tony Cappellini wrote:
When I run this python script, the following exception is thrown
Date: Mon, 12 Nov 2007 09:14:05 -
From: Alan Gauld [EMAIL PROTECTED]
Subject: Re: [Tutor] Wrong version of Python being executed
To: tutor@python.org
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; format=flowed; charset=iso-8859-1;
reply-type=original
Umm, have you rebooted?
Martin Walsh mwalsh at groktech.org
Sun Nov 11 06:13:10 CET 2007
That is odd.
Try using the full path to python, just to be sure: c:\python25\python
script.py -- do you get the same behavior?
This works just fine- I would expect it to.
Also, if you haven't already, you can run python with the
Message: 4
Date: Mon, 12 Nov 2007 00:16:35 -
From: Alan Gauld [EMAIL PROTECTED]
Subject: Re: [Tutor] Wrong version of Python being executed
To: tutor@python.org
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; format=flowed; charset=iso-8859-1;
reply-type=original
Message: 2
Date: Sun, 11 Nov 2007 16:57:01 -0600
From: Martin Walsh [EMAIL PROTECTED]
Subject: Re: [Tutor] Wrong version of Python being executed
To: Tutor Python tutor@python.org
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=ISO-8859-1
My initial thought based on your
I've got Python 2.3, 2.4 and 2.5 installed on a Windows XP machine..
I currently have Python 2.5 in my path, and there are no other
versions of Python in the path.
I'm trying to run a program which expects Python 2.4 or later to be
installed, because there is a call to logging.BasicConfig(arg1,
Thanks for replying Kent.
This is quite a strange mystery.
A couple of possibilities...
Is there a #! line at the start of the script that specifies Python 2.3
(I'm not sure if those work in windows though...)
No- The shebang line is for non-Windows systems (Unix variants)
How do you run the
What do you get if you print sys.path from
the interpreter?
I've printed out sys.path from inside the script as well,
and all references to Python25 are replaced with Python23
FWIW- This isn't a problem unique to this script.
I've just printed out sys.path from another script in another
Thanks.
Unfortunately,os.listdir() returns the same string as glob.glob, for
the problem file I mentioned.
When I pass that string to os.rename()
OSError: [Errno 22] Invalid argument
Sounds like it has something to do with Unicode.
Your filenames aren't being interpreted correctly. Perhaps
Using Windows XP, SP2 and Python 2.3
I've written a script which walks through a bunch of directories and
replaces characters which are typically illegals as filenames, with an
'_' character.
The directories are part of a package of software which is released by
a group of people from Japan, and
Take a look at pyHook
1. Re: Catch event's on my computer (Alan Gauld)
From: Alan Gauld [EMAIL PROTECTED]
Subject: Re: [Tutor] Catch event's on my computer
To: tutor@python.org
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; format=flowed; charset=iso-8859-1;
How do you handle a binary file?
Message: 4
Date: Tue, 13 Mar 2007 13:23:44 +0100
From: Jean-Philippe Durand [EMAIL PROTECTED]
Subject: Re: [Tutor] HTTP file download
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Cc: tutor@python.org
Message-ID:
[EMAIL PROTECTED]
Content-Type: text/plain;
Rename your file from .py to .pyw.
This will prevent the DOS window from appearing
Message: 6
Date: Mon, 5 Mar 2007 16:51:42 +0100
From: learner404 [EMAIL PROTECTED]
Subject: [Tutor] Hiding/Killing a DOS window (from a previous
os.system call)
To: Tutor Python tutor@python.org
Message-ID:
PS To import a file whose name is in a variable (string), see __import__().
I've started doing the import instead of exec/eval , but the person
who wrote the module being called, started using the logging module.
Now I can't capture the output of the module I'm calling, and display
it in a GUI.
If I understand you, you have a python cmdline app that does something
useful. You have users who aren't comfortable with the command line, so
you are writing a GUI wrapper that calls the cmdline app with popen().
That is correct
A better approach is to turn the functional part of the cmdline
The application needs to be rewritten if this is true. The author's
implementation is not logical,
regardless- I won't ask him to do this, it's just the way it is. I
don't know why it was written this way.
if I'm inferring correctly that he knows there are other apps depending
on this.
Yes
You should be able to make the logging module work with you, it is very
flexible. You should hook into the logging module. Write a custom
handler that pushes log methods into your GUI. Add the handler to the
root logger.
The cmd line app already uses the logging module- this is where the
Thanks. I'm not using wx, but that doesn't matter.
I'll see if there's some way I can get the author to let me pass in the
logging handler to his main.
On 2/7/07, Kent Johnson [EMAIL PROTECTED] wrote:
Kent Johnson wrote:
You should be able to make the logging module work with you, it is very
I saw a snippet of python which is used to execute another python
script, and I'm trying to understand the mechanism. Simple as it is, I
don't understand how it works :-)
this is the caller
##
callee=open(tester.py).read()
exec(callee)
eval(main(['', 'argument']))
Hi Danny,
Hi Tony,
Ack!
This is not safe. I would strongly recommend not to do this. There is a
much simpler way for the caller to be written:
What is not safe about doing it this way ?
import tester
tester.main([], argument)
I'm writing a python gui app that will call a python cmd line app. The gui
will take users input, pass it to the cmd line app, then display the cmd app
program output. The idea is to give users who aren't comfortable with the
cmd line a way to run the program, without having to open a shell
got it -thanks
On 1/30/07, Luke Paireepinart [EMAIL PROTECTED] wrote:
Tony Cappellini wrote:
I'm writing a python gui app that will call a python cmd line app. The
gui will take users input, pass it to the cmd line app, then display
the cmd app program output. The idea is to give users who
That would be ideal- but I'm using 2.4 now, and the people using the app
would also have to upgrade to 2.5.
I don't like upgrading unless there's a pressing need.
On 1/30/07, Danny Yoo [EMAIL PROTECTED] wrote:
The author of the cmd line app suggested I temporarily replace
sys.stdout'with a
I want to purge (empty) or delete the logfile created by the logging module,
and reopen it for a new session.
There is reference to a close function in the 2.3 docs, but I don't see how
I can purge or delete the file, since I don't have access to the file
descriptor.
*close*( ) Tidy up any
*close*( )
Tidy up any resources used by the handler. This version does nothing
and is intended to be implemented by subclasses.
How can I purge/delete reopen the logfile?
FileHandler has a close() method that presumably does something useful.
see above-
It says it does
I'm trying to help some people run a python cmd line program on OSX.
Would you email me off list if you have OSX and run python apps form the cmd
line?
thanks
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Message: 7
Date: Fri, 5 Jan 2007 08:04:23 -0800 (PST)
From: Mike Ellis [EMAIL PROTECTED]
Subject: [Tutor] Python gui for file input
To: tutor@python.org
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=iso-8859-1
Hi all,
I am looking to create a simple gui interface to a small
I can't see the forest through the trees.
I have stored 3 global variables in a dictionary, and associated each
variable with a filename.
Ideally, I want to read the contents of the text files, and store the
contents in the global variables. The globals will be used by another
function.
However,
Take a look at Movable Python.
It may not be exactly what you're looking for, but it may turn out to be a
resource to leverage from.
Message: 1
Date: Tue, 2 Jan 2007 21:14:16 -0500
From: Daniel McQuay [EMAIL PROTECTED]
Subject: Re: [Tutor] Starting python from a DOS prompt from any
I have a number of text files which need to be checked into CVS.
Each file needs a special text header/footer in order that CVS can track
changes and version numbers.
Python to the rescue.
I've written a small python program which will write the header/footer to
all files in the current
Message: 3
Date: Sun, 31 Dec 2006 00:10:39 -0500
From: Daniel McQuay [EMAIL PROTECTED]
Subject: [Tutor] Starting python from a DOS prompt from any
directory?
sorry for such a newbie question but i would like to figure this out
because
there are some situations where i need that to work
Message: 1
Date: Thu, 28 Dec 2006 17:24:41 -0800
From: Chris Hengge [EMAIL PROTECTED]
Subject: Re: [Tutor] OT: Python 2.5 (Was Re: Length of longest item in
I hope this is related enough for this thread, but I'm curious why people
didn't seem to unanimously jump into 2.5 upon release.
One
I want to use a list comp to get the length of the longest string in a list,
but can't quite get the syntax right.
l1=['abc', 'abcde', 'abcfdtea']
longest=0
[x for x in l1 if len(x) longest]
The problem is I can't add the true clause to the if statement in a list
comp as in
if len(x)
Thanks,
but I am restricted to using 2.3.4 for now, so
longest = max([len(x) for x in ll])
works for me
On 12/28/06, Andreas Kostyrka [EMAIL PROTECTED] wrote:
* Python [EMAIL PROTECTED] [061228 20:44]:
On Thu, 2006-12-28 at 11:27 -0800, Tony Cappellini wrote:
I want to use a list
Running python 2.3.4, on Windows XP
the popen2 docs show
6.8 popen2 -- Subprocesses with accessible I/O streams
This module allows you to spawn processes and connect to their
input/output/error pipes and obtain their return codes under Unix and
Windows.
Then it further goes to say
The only
Im writing a cmd line program which will automate getting some modules out
of cvs, based on some
input criteria.
Initiallly, I will do a cmd line version, but would like to make a gui
version later with QT.
I would like to find out how to structure the program so that when the gui
version is
Date: Mon, 27 Nov 2006 18:07:33 +1300
From: John Fouhy [EMAIL PROTECTED]
Subject: Re: [Tutor] moving from pack to grid in tkinter
To: tutor-python tutor@python.org
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
On 27/11/06, Tony Cappellini [EMAIL
I've got a main window which is 640 * 400.
self.root.geometry(600x400)
self.label.pack(side=BOTTOM, fill=X)
This line would put the label at the bottom of the window, and extend to
both left and right edges of the window.
I want to change to grid geometry because I have several more
I need to do some automated checkouts of CVS projects from Python scripts, and want ot be able to handle success and failure conditions.While sending the command lines to cvs isn't a problem, I could use some suggestions for how to check the cvs responses.
Parsing the text returned from CVS isn't
Date: Thu, 02 Nov 2006 20:09:59 -0500From: Bill Burns [EMAIL PROTECTED]Subject: Re: [Tutor] Print Screen
To: Chris Hengge [EMAIL PROTECTED]Cc: pythontutor
tutor@python.orgMessage-ID: [EMAIL PROTECTED]Content-Type: text/plain; charset=ISO-8859-1; format=flowed
pressed, try pyHook. Note: pyHook
>From Kent You don't say what OS you are running but under Windows it is trivial tohave multiple versions of Python installed, I have 2.3, 2.4 and 2.5.They are each in their own directories, all in the system path. I have
aliases called py23, py24 and py25 that let me launch the version Iwant. I'm
Also checkout GnuPlot http://www.gnuplot.info/and the Python bindings for ithttp://gnuplot-py.sourceforge.net/
Date: Sat, 21 Oct 2006 14:07:12 +0100From: Asrarahmed Kadri [EMAIL PROTECTED]
Subject: [Tutor] what is PIL..???To: pythontutor tutor@python.orgMessage-ID:
[EMAIL
I'm using Python 2.3.4After reading this in the docs
getrefcount(
object)
Return the reference count of the object. The count returned is
generally one higher than you might expect, because it includes the (temporary)
reference as an argument to getrefcount().I decided to try some
I've just inherited a lot of python code to maintain.The __init__ functions in many of the classes are very long- some over 100 lines.I like to keep functions/methods short readable at a glance, if possible.
1. Is it good methodology to move some code from _init__ to it's own method within the
Message: 1Date: Sat, 23 Sep 2006 08:25:13 -0400From: Kent Johnson [EMAIL PROTECTED]Subject: Re: [Tutor] Fatal error after RE-installing Python
2.3.4Cc: tutor@python.orgMessage-ID:
[EMAIL PROTECTED]Content-Type: text/plain; charset=ISO-8859-1; format=flowedWere the extra warnings legitimate
Message: 4Date: Sat, 23 Sep 2006 08:38:37 +0100From: Alan Gauld
[EMAIL PROTECTED]Subject: Re: [Tutor] Fatal error after RE-installing Python 2.3.4To: tutor@python.orgMessage-ID:
[EMAIL PROTECTED]Content-Type: text/plain; format=flowed; charset=iso-8859-1;reply-type=originalHave you installed in
I've just started a job which has a massive python2.3.4-centric tools installation and configuration.I know what you're going to say, but I can't upgrade and be the only one with a newer version. There are close to 30 engineers using this same tools configuration, and it has been working fine for
Some time ago, I had read an article on Guido's blog (I think) about ways to improve the main() functionin a Python script. There were many replies, and I thought I would try to implement some of these ideas.
I had found that in every python program I wrote I would 1. check the number of
Does anyone here have a example/demo using the MVC pattern, in a simple QT/pyQT program?thanks
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
I want to use embedded python in an html page.
However, I dont want to force the user to have python installed for the
page to work.
Is there any way to make the embedded python code be executed by the server?
I'm hoping ti use python as an alternative to vbscript and jaava
thanks
tony
After looking at the Python docs for the wave module, I'm a bit puzzled as
to how to use it.
Does anyone have an example I can browse?
If I write to a wave file, is the data I write actually audible, if I use
Winamp or some other wave player, or is it more complicated than that?
Is the data I
I'm trying to generate an HTML table, from multiple lists.
There are 4 lists total, each of which *may* have a different length from
the other lists.
Each list has been stored in a master dictionary.
North=[Bill, Bob, Sue, Mary]
South=['Tim', ''Tom', 'Jim', 'John', 'Carl', 'Evan', 'Rich']
etc
Out of curiosity, if it's not possible to run zip() directly on the lists
that you have, can you bend the lists so that zip() will fit?
It is possible, however zip() truncates the longer list, based on the size
of the smaller list, so it's just not feasible in my case.
Here's a quick function
map(None, North, South, East West) does exactly what you want:
North=['Bill', 'Bob', 'Sue', 'Mary']
South=['Tim', 'Tom', 'Jim', 'John', 'Carl', 'Evan', 'Rich']
map(None, North, South)
[('Bill', 'Tim'), ('Bob', 'Tom'), ('Sue', 'Jim'), ('Mary', 'John'), (None,
'Carl'), (None, 'Evan'),
I'm trying to get Python to automatically print a leading 0 for hex
numbers, but it only
seems to work for for decimal numbers.
print 0x%0X % 12345
displays
0x3039
instead of 0x03039
The Python docs state
The conversion will be zero padded for numeric values, when a 0 is used as
a flag
92 matches
Mail list logo