js escribió:
On 9/15/07, Summercool [EMAIL PROTECTED] wrote:
in Python... is the method to use ,.join() ? but then it must take
a list of strings... not integers...
any fast method?
print ''.join([str(i) for i in [1,2,3]])
It's better to use generator comprehension instead of LC:
J. Cliff Dyer escribió:
Dotan Cohen wrote:
FIrst of all, how is the % symbol (as in 70%6=4) called in English?
Second, in Turbo C -111%10=-1 however in python -111%10=9. Is one or
the other in error? Is this a known gotcha? I tried to google the
subject however one cannot google the symbol
[EMAIL PROTECTED] escribió:
I am still wondering how to do this efficiently in Python (being kind
of new to it... and it's not for homework).
You should post some code anyway, it would be easier to give useful advice (it
would also demonstrate that you put some effort on it).
Anyway, here is
[EMAIL PROTECTED] escribió:
I have a text source file of about 20.000 lines.
From this file, I like to write the first 5 lines to a new file. Close
that file, grab the next 5 lines write these to a new file... grabbing
5 lines and creating new files until processing of all 20.000 lines is
Chris Allen escribió:
action key=value key=value...
Where action is a required string (ie. 'backup', 'init', 'restore',
etc) and the program can accept one or more key value pairs. I know
this syntax isn't standard, but I think it works great for my program
as each key can override an
Lamonte Harris escribió:
Say I start i click on a python file on my desktop, how could I return
the path of the current python file thats running?
http://docs.python.org/lib/module-sys.html
--
http://mail.python.org/mailman/listinfo/python-list
dorje tarap escribió:
2.
{8: (99, 99), 9: [(55, 67), (77, 66), (67, 88)], 4: [(45, 78),
(56, 78), (99, 78)], 5: (67, 77)}
I want to sort the entire dictionary based on the last values in each
line. First for [-1][0] and then[-1][0]
Each line means each value in the
Steven Harms escribió:
In python it is quite easy:
import commands
status, output = commands.getstatusoutput(my command)
Uhm, this module has a big issue:
(http://docs.python.org/lib/module-commands.html)
8.17 commands -- Utilities for running commands
Availability: Unix.
Any
[EMAIL PROTECTED] escribió:
Any non cross-platform module should be avoided unless absolutely necessary.
Subprocess is the right module to use.
arnau
You forgot to mention that subprocess replaces commands, so in effect,
commands is deprecated anyway.
It was implicit :-)
Anyway, these
[EMAIL PROTECTED] escribió:
That's just the exit status or run status, if I recall correctly. I
think 0 (i.e. False) means it didn't run properly and anything else is
True, or ok. Something like that.
The other way: 0 means ok while everything else means error (at least in
UNIX). The reason
On Jul 30, 5:48 pm, beginner zyzhu2... at gmail.com wrote:
def f(n):
l=[]
while n0:
l.append(n%26)
n /=26
return l
I am wondering what is the 'functional' way to do the same.
I see. It is interesting (and not surprisingly) that recursion or
yield
11 matches
Mail list logo