> I need to write a program which reads an external text file. Each time
> it reads, then it needs to delete some lines, for instance from second
> line to 55th line. The file is really big, so what do you think is the
> fastest method to delete specific lines in a text file ?
Generally, with file
> i am new to python guys.
>i have a list of numbers
>
> say a = [1,-1,3,-2,4,-6]
>
> how should i check for negative values in the list
I'm not sure if this is a homework problem, as it seems to be a
fairly simple programming problem whether you know Python or not.
If you're using
Dan wrote:
> On Dec 17, 11:07 am, Stef Mientki <[EMAIL PROTECTED]>
> wrote:
>> hello,
>>
>> I'm currently using Python 2.4,
>> and I don't dare to switch to 2.5,
>> because I depend heavily on Scipy, which is based on 2.4
>>
>> To test some other Python programs I need Python version 2.5.
>> I've t
> Define a small function with each test+action, and iterate over them
> until a match is found:
>
> def check1(input):
> match = re.search(pattern1, input)
> if match:
> return input[:match.end(1)]
>
> def check2(input):
> match = re.search(pattern2, input)
> if match:
> return .
. not sure that
they're up for putting it on other operating systems .. but you may want
to email Bill G and ask him ..
Tim
Stef Mientki wrote:
> hello,
>
> having a lot of trouble installing 2.5 (without affecting my stable 2.4),
> I wonder why there's only a msi installer
input.py module, this will eventually call
FileInput.next(), which eventually calls FileInput.readline(), which
eventually calls stdin.readlines(_bufsize). The default buffer size is
8,192 bytes.
--
Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
Benoit wrote:
> I understand that the Win32 has been said to be itself poorly
> documented, so perhaps that the documentation that comes with the
> modules is of similar quality is no coincidence. Maybe I'm still too
> young in my programming to grasp the good of that documentation, but
> for myse
On 21/12/2007, Benedict Verheyen <[EMAIL PROTECTED]> wrote:
> Hi,
>
> i get an "Unable to relay for" when trying to send an email from within
> my network to an email address not on my domain.
> I don't understand why it says "relaying" as i'm sending from an
> internal domain user to an external u
-rw-r--r-- 1 pofuk pofuk 105 2007-12-19 21:59 login.py
Do you want to KNOW the permissions, or do you really want to get the
output of "ls -l"?
What you probably want is os.walk. You can call stat or os.path.isdir to
get information about the files you discover.
--
Tim R
> def print_tabela(tabela):
> print "Tabela 1 | Tabela 2"
> for linha in tabela:
> tmp = linha.split(":")
in here, insert this:
print len(tmp),
> print tmp[0] + " | " + tmp[1],
I also think you may not want the tra
iew, what disqualifies python24.dll as a "system file"? The fact
that it wasn't produced by Microsoft?
>Installing application DLLs in the system directory is something that
>should only be done for backwards compatiblity.
Deployment of Python applications is much easier wh
Lawrence D'Oliveiro wrote:
> In article <[EMAIL PROTECTED]>, Kun <[EMAIL PROTECTED]>
> wrote:
>
>
>>... but i am
>>wondering if there is a way to create a button which would automatically
>>insert today's date in the date form field if the user chooses to use
>>today's date.
>
>
> If you're
> I have a python-cgi file that pulls data from an sql
> database, i am wondering what is the easiest way to
> remove all instances of '00:00:00.00' in my date column.
>
> how would i write a python script to scan the entire page
> and delete all instances of '00:00:00.00', would i use
> regular e
> for col in range(0, numcols):
> print "", record[col], ""
This is the point at which you want to intercept the column
data and make your change:
print "", str(record[col]).replace("00:00:00.0", ""), "%s" % foo
or alternatively
DATECOLUMNS = [3, 14]
for col
t all
that clear, I admit, but had you read the subsequent followups, it would
have been clear that I wasn't arguing against the utility of the
statement (nor was I arguing for it), I was arguing against complicating
it for a useless use case. In particular making the namespace associated
wit
Carl Banks wrote:
> Tim Hochberg wrote:
>
>>Carl Banks wrote:
>>
>>>Mike Orr wrote:
>>>
>>>
>>>>>I think this PEP is going off the rails. It's primary virtue was that it
>>>>
>>>>was a simpler, clea
> Since there have been python limmericks, are there any
> Python lullabies that I can sing to my newborn son
> (actually, born yesterday)? I tried to murmur some
> select parts from the tutorial, but he somehow wasn't
> very interested :)
Well, you might start with "Twinkle, Twinkle, Little
Ast
Is there an obvious/pythonic way to remove duplicates from a
list (resulting order doesn't matter, or can be sorted
postfacto)? My first-pass hack was something of the form
>>> myList = [3,1,4,1,5,9,2,6,5,3,5]
>>> uniq = dict([k,None for k in myList).keys()
or alternatively
>>> uniq = list
cording to the Pipex web page, if you got their low-end hosting package
based on Linux, you get PHP4, PHP5, or Perl. No Python.
Perhaps you should have checked your requirements before you spent money on
a web host. There are many good, inexpensive web hosting companies that do
allow Python
darned well
better figure out where they're coming from! Did you add any fields? Did you add an image map?
On the other hand, why do you want to remove them?
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
t a tuple containing just the one string (which it
strangely seems like your example is doing), you can do
one_string_tuple = (",".join(list_array),)
(note the peculiar "trailing comma in parens creates a
one-element tuple" syntax...it often catches new Python
programmers off-guard)
HTH,
-tim
--
http://mail.python.org/mailman/listinfo/python-list
=)
I tried to follow the thread backwards and find out what proposed change in
the "class" construct would render "make" unnecessary, but I couldn't find
it. Can you summarize, Steven?
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
sibility is to parse your .bat files by hand, and make the
changes to your os.environ. Your subprocesses inherit that.
.BAT files are easy to parse, especially if they're just a bunch of 'set'
statements.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
> If I want to create a list of the form [100, 99, 99, 98, 98, 97, 97...]
> (where each item is repeated twice after the first one), how might I do
> that most efficiently?
>
> Right now I have this:
>
> series = [100]
> for x in range(10): # just for testing
> series.append(series[-1] -
> Interesting. I tried the *2 method twice, but I kept
> getting weird results, I guess because I was using append
> and not extend. I thought extend added lists to lists,
> but obviously that's not the case here.
In the above example, it *is* "add[ing] lists to lists".
Note the set of brackets:
g is one of
> the parts that disturbs me.
>
They're freindly snakes at a tadpole fancy dress competition having a
'cuddle'. Where do you think Python eggs come from...
Tim Parkin
p.s. the logo is actually based on mayan representations of snakes which
very often represent only t
version of the logo?
>
An alternate 'collectors' rendition of the new logo as used by Guido Van
Rossum in his recent New York Google presentations and also as on
t-shirts, mugs and flags handed out during EuroPython 2005!
Tim Parkin
p.s. was that good enough spin for you ;-)
--
http://mail.python.org/mailman/listinfo/python-list
> Actually, I can't think off the top of my head, any
> feature in the Java language (and I am making no
> assertions about the implementation of specific
> instances) that was truly innovative.
Let's see...it has bytecode compliation. Oh...not original.
Okay, howsabout cross-platform neutra
> for a,b,c,d in line.split() :
>
[snip]
>
> The output (when given the data I want to parse) is:
> ['0.0','1','0.04','0']
You'll notice that you're not passing any parameters to
split(). By default, it splits on whitespace, and your
input doesn't have any whitespace in it. Thus, you'
[Robert Kern]
> ...
> ph3 = math.atan( ac3.imag / ac3.real )
> ...
Don't do that: atan2 is the correct way to compute the angle, because
the signs of both inputs are needed to determine the correct quadrant.
So do:
ph3 = math.atan2(ac3.imag, ac3.real)
instead.
--
http://mail.python.o
[Roy Smith]
> I certainly agree about using atan2() instead of atan(), but I'm surprised
> there's not an easier way to get the phase of a complex, just like abs()
> gives you the modulus. I can see why you wouldn't want to pollute the
> global namespace with another built-in just for this purpose
[Michal Kwiatkowski]
> I was just wondering...
>
> Python 2.3.5 (#2, Mar 6 2006, 10:12:24)
> [GCC 4.0.3 20060304 (prerelease) (Debian 4.0.2-10)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import timeit
> >>> a = timeit.Timer('2**1')
> >>> b = t
[EMAIL PROTECTED]
> I think there might be something wrong with the implementation of
> modulus.
>
> Negative float values close to 0.0 break the identity "0 <= abs(a % b) <
> abs(b)".
While that's a mathematical identity, floating point has finite
precision. Many mathematical identities can fai
[Alex Martelli]
>> ...
>> You can compute the requested answer exactly with no random number
>> generation whatsoever: compute the probability of each result from
>> 0 to 1000, then sum the probabilities of entries that are exactly 390
>> apart.
[Elliot Temple]
> That was the plan, but how do I ge
riting it? Without an imagination you pretty much stagnate your whole
> learning process. Thanks in advance.
>
How about writing a standalone wiki markup parser? I know a *lot* of
people who would find this useful..
Tim
--
http://mail.python.org/mailman/listinfo/python-list
[Elliot Temple]
> I think I got it. I noticed my code is essentially the same as Tim
> Peter's (plus the part of the problem he skipped). I read his code 20
> minutes before recreating mine from Alex's hints. Thanks!
>
> def main():
> ways = ways_to_roll()
>
[Jeffrey Barish]
> Several methods in Queue.Queue have warnings in their doc strings that they
> are not reliable (e.g., qsize). I note that the code in all these methods
> is bracketed with lock acquire/release. These locks are intended to
> protect the enclosed code from collisions with other t
[EMAIL PROTECTED]
| I'm a long-time lurker and (I think) first time poster.
| Only relatively new to python, and I'm trying to get pysqlite to work
| with binary data, and having a tough time of it.
| I want to set up a table with:
| - a URL,
| - some filenames related to that URL,
| - and some si
pyfileobj
>implementation of hacking through the file and writing a new one is
>significantly faster... any clue as to why this is? I figure I'm
>missing something here.
>
>Does os.system launch a cmd shell every time?
Yes. That's in the documentation.
--
- Tim Roberts
ould have worked:
event_list = [f1, f2, etc]
As it is, event_list is a list of strings, not a list of functions.
Then, when you want to call it, remember that it has to be treated like a
function:
for ev in event_list:
if ev(t):
pass
If you REALLY need the list of functions to
[Russell Warren]
| I just did a comparison of the copying speed of shutil.copy
| against the
| speed of a direct windows copy using os.system. I copied a file that
| was 1083 KB.
|
| I'm very interested to see that the shutil.copy copyfileobj
| implementation of hacking through the file and wri
[Caleb Hattingh]
> My big problem, being in South Africa, is
> that I have to get any distros on cover CDs or order from
> distro-resellers, and they never have Testing or Unstable. Broadband
> hasn't exactly hit the local market, although things might be looking
> up in a few years or so.
I ha
[Roger Upole]
| You can use win32file.DeviceIoControl to link directories.
| I can post some code to do so if anyone's interested.
I'd certainly be interested...
Thanks
TJG
This e-mail has been scanned for all viruses by S
KnownFilesResult:
(pickled_result,) = row
unpickled_result = cPickle.loads (pickled_result)
# do things with unpickled result
| ps. Tim: Your clean take on my code made me realise that I
| had stupidly included quotes in the URL argument passed to
| sqlite ... It's the little things that
[EMAIL PROTECTED]
> I see a C/python program that we're using spending a lot of time in
> this function, far more than we think it should. What is it?
PyEval_EvalFrame is the heart of the CPython interpreter: it's a very
large function that _implements_ the interpreter, marching through the
byte
[kyo guan]
> Python version 2.4.3
>
> >>> l=range(50*1024*100)
>
> after this code, you can see the python nearly using about 80MB.
>
> then I do this
>
> >>> del l
>
> after this, the python still using more then 60MB, Why the python don't free
> my
> memory?
It's that you've created 5 million i
[Roger Upole]
| [... snipped ugly code ...]
Thanks; I'll have to find the time to experiment
with that a bit.
TJG
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more inform
[bruno at modulix]
| Duncan Booth wrote:
| > That will show him the attributes of the Python wrapper
| around the COM
| > object, it won't show him the attributes of the underlying
| COM object
| > itself.
|
| I stand corrected - and shouldn't answer questions about MS technos :(
In fact, i
[Stefan Schukat]
| You can only build a proxy module if you have the typelibrary
| information which not all programs provide, since it prohibits
| changes in the interface the easy way. E.g., MFC application
| will normally not provide a typelibrary but support dynamic
| dispatch.
Oh. Thanks.
[BartlebyScrivener]
| Can any Windows user give a working example of adding a "command verb"
| to os.startfile()?
I'm afraid the core Python version of this
command has only grown the command verb
since 2.5a1.
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on
win32
Type "h
> Does anyone have an easier/faster/better way of popping from the middle
> of a deque than this?
>
> class mydeque(deque):
> def popmiddle(self, pos):
> self.rotate(-pos)
> ret = self.popleft()
> self.rotate(pos)
> return ret
My first thought would just be to use indexing:
>
> a = ['spam!', 1, ['Brie', 'Roquefort', 'Pol le Veq'], [1, 2, 3]]
>
> As an exercise, write a loop that traverses the previous list and
> prints the length of each element. What happens if you send an
> integer to len?
[Russell Warren]
|> Does anyone have an easier/faster/better way of popping from the middle
> of a deque than this?
>
> class mydeque(deque):
> def popmiddle(self, pos):
> self.rotate(-pos)
> ret = self.popleft()
> self.rotate(pos)
> return ret
As Tim
t is
inevitable that people move on to new projects (such as pySQLite), but
it would be a shame if pyPgSQL just rotted, because it has several
things in its favour, such as some unit tests (which were conspicuously
absent from any of the alternatives when we evaluated them in 2003 -
perhaps
ng system, the environment variable you need
might have a different name. For example, I think in Windows you
might try
>>> os.getenv('COMPUTERNAME')
You can see all of the environment variables currently available with
>>> os.environ
I hope this helps,
Tim
--
http://mail.python.org/mailman/listinfo/python-list
"There" being, in reality, seperate?
>>> print " ".join(xyz)Hello There
HTH :)
-- Tim Williams
--
http://mail.python.org/mailman/listinfo/python-list
example code also didn't
>turn up anything.
The native Windows radio button cannot do multiline labels. You'll have to
do the first line in the radio button, and the second line as a
wx.StaticText.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http
On 1 May 2006 08:28:12 -0700, BBands <[EMAIL PROTECTED]> wrote:
There must be a better way to multiply the elements of one list byanother:a = [1,2,3]b = [1,2,3]c = []for i in range(len(a)):c.append(a[i]*b[i])a = cprint a[1, 4, 9]
Something like:
>>> [ x * y for x,y in zip(a,b) ]
[1, 4, 9
tter addressed by NumPy?
a = [1,2,3]
b = [1,2,3]
c = [q*r for q,r in zip(a,b)]
seems to do the trick for me.
-tim
--
http://mail.python.org/mailman/listinfo/python-list
[Russell Warren]
> ...
> As to indexing into a deque being O(index)... I didn't realize that.
> It is certainly something to keep in mind, though... looping through
> the contents of a deque would obviously be a bad idea with this being
> the case! I wonder if the generator for the deque helps red
On 1 May 2006 23:20:56 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]
> wrote:hii have a file test.dat egabcdefghijklmn <-newline
opqrstuvwxyz <---newlineI wish to print the contents of the file such that it appears:abcdefghijklmnopqrstuvwxyzhere is what i did:f = open("test.dat")
On 02/05/06, Tim Williams <[EMAIL PROTECTED]> wrote:
On 1 May 2006 23:20:56 -0700,
[EMAIL PROTECTED] <[EMAIL PROTECTED]
> wrote:hii have a file test.dat eg
f = open("test.dat")
while 1:
line = f.readline().rstrip("\n")
if line:
prin
[Andrew Koenig, on the counter intuitive -1e-050 % 2.0 == 2.0 example]
>> I disagree. For any two floating-point numbers a and b, with b != 0, it
>> is always possible to represent the exact value of a mod b as a
>> floating-point number--at least on every floating-point system I have ever
>> enco
> The following code to search a file for tabs does not
> work, at least on Windows XP. Could someone please tell
> me what's wrong? Thanks.
>
> xfile = "file_with_tabs.txt"
> for text in open(xfile,"r"):
> text = text.strip()
> if ("\t" in text):
> print text
Well, are the tabs e
[Vedran Furač]
> I think that this results must be the same:
>
> In [3]: math.atan2(-0.0,-1)
> Out[3]: -3.1415926535897931
Whether -0.0 and 0.0 are different floats internally depends on your
hardware floating-point; on most machines today, they are different
floats, but _compare_ equal to each ot
nd a
timestamp, then scan backwards from the end of the file until you find a
timestamp, and subtract.
You can also try to extract the bitrate from an early header and use
arithmetic to get a good estimate.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.pytho
> assuming that DateTime returns something that compares correctly, you can
> do something like:
>
> def sortkey(item):
> return item.get("from_datetime")
>
> data.sort(key=sortkey)
>
> (assuming Python 2.4 or later)
Building on Fredrik's solution, for 2.3 (or earlier?), you
ca
[EMAIL PROTECTED]
> Below are 2 files that isolate the problem. Note, both programs hang
> (stop responding)
What does "stop responding" mean?
> with hyper-threading turned on (a BIOS setting), but
> work as expected with hyper-threading turned off.
>
> Note, the Windows task manager shows 2 CPU
[EMAIL PROTECTED]
> Because of multithreading semantics, this is not reliable. This
> sentence is found in the Python documentation for "7.8.1 Queue
> Objects".
>
> This scares me! Why would Queue.qsize(), Queue.empty( ), and a
> Queue.full() not be reliable?
Because they may not be telling the
>> What do you mean "stop responding"?
[EMAIL PROTECTED]
> Both threads print their thread numbers (either 1 or 2) approximately
> every 10 seconds. However, after a while (minutes to hours) both
> programs (see above) hang!
Where "hang" means they stop printing.
> Pressing ctrl-c (after the pr
- Original Message -
From: DevWebProUK [EMAIL PROTECTED]
To:
Sent: Wednesday, May 03, 2006 10:14 PM
Subject: Swaying A Coder Away From Python
Swaying A Coder Away From Python
By David A. Utter
One programmer blogged about the powerful attraction he is feeling to
C# programming, and
> p = re.compile("(\*\)",re.IGNORECASE | re.DOTALL)
> m = p.search(data)
First, I presume you didn't copy & paste your expression, as
it looks like you're missing a period before the second
asterisk. Otherwise, all you'd get is any number of
greater-than signs followed by a closing "" tag.
Se
> (and why do you
> seem to think that this matters, btw ?)
I actually think it is complete twaddle, for the same reasons as you.
It was forwarded to me by someone who knows I use Python, and I
thought it might be of interest to a balanced list, especially as it
shows an external perspectiv
> Tim - you're a legend. Thanks.
A leg-end? I always knew something was a-foot. Sorry to
make myself the butt of such joking. :)
My pleasure...glad it seems to be working for you.
-tkc (not much of a legend at all...just a regexp wonk)
--
http://mail.python.org/mailman/listinf
> In Python, there does not seem to be an easy way to have
> functions return multiple values except it can return a
> list such as: strHostname, nPortNumber, status =
> get_network_info (strIpAddress, strHostname, nPortNumber)
> Am I missing something obvious? Is there a better, or
> more standar
On 04/05/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> nope, but if we were to post to the list every time some random blogger says
> something about Python, we wouldn't have room for much other stuff.
>
It wasn't from a random blogger, it was from an email newsletter for
this site:
http://www.
On 4 May 2006 05:24:40 -0700, BartlebyScrivener <[EMAIL PROTECTED]> wrote:
> I'm picking this up via clp on Google Groups. I can't tell what Mr.
> Lundh is referring to. The first line of his post is: "Tim Williams
> wrote" but there's nothing that comes be
Just as a pedantic exercise to try and understand Python a
bit better, I decided to try to make a generator or class
that would allow me to unpack an arbitrary number of
calculatible values. In this case, just zeros (though I
just to prove whatever ends up working, having a counting
generator
[David C.Ullrich]
> Would there be issues (registry settings, environment
> variables, whatever) if a person tried to install
> versions 1.x and 2.x simultaneously on one Windows
> system? Windows 98, if it matters.
>
> (I can handle the file associations with no problem.)
There are generally no i
> I don't think he was explicitly wanting to initialize
> things to zero, but rather unpack an arbitrary sequence
> into a tuple (could perhaps be the fibonnacci sequence
> for example).
Ant is correct here...Fibonnaci, digits of pi, the constant
42, an incrementing counter, a series of squares, w
[Tim Peters]
>> I didn't run it for hours ;-)
[EMAIL PROTECTED]
> Please try.
OK, I let the first test program run for over 24 hours by now. It
never hung. Overnight, the box did go into sleep mode, but the test
woke itself up after sleep mode ended, and the threads reported they
> but when a and b have many elements. such as:
>
a=range(10)
b=range(5)
for x in b:
>
> ... a.remove(x)
> ...
> it will very slowly.
Well, your problem is rather ambiguous. In your examples,
you're removing contiguous ranges. Thus, you should be able
to do something
On 06 May 2006 16:41:45 +1000, Gary Wessle <[EMAIL PROTECTED]> wrote:
> is there a module to do things like concatenate all files in a given
> directory into a big file, where all the files have the same data
> formate?
If you want to combine text files file1 and file2 into a combined file1
>>>
On 06/05/06, Eric <[EMAIL PROTECTED]> wrote:
> I have a string...
>
> str = "tyrtrbd =ffgtyuf == =tyryr =u=p ff"
>
> I want to replace the characters after each '=', what I ended up doing is
> somthing like this...
>
> buf = list(str)
> newchr = '#'
>
> count = 0
> for i in range(len(buf)):
>
at your VGA font happens to display them as the same glyph.
>6) Would it be correct to infer that the print statement is aware of
>characters beyond the 128 characters in the ascii character set?
Certainly. It knows about whatever the current character set is.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
[Michele Petrazzo]
> I'm doing some tests on my debian testing and I see a very strange
> memory problem with py 2.5a2 (just downloaded) and compiled with gcc
> 4.1.0, but not with the gcc 3.3.5:
>
> My test are:
>
> #--test.py
> import sys
> if sys.version.startswith("2.3"):
> from sets import S
compboy wrote:
> How do you print elements of the list in one line?
>
> alist = [1, 2, 5, 10, 15]
>
> so it will be like this:
> 1, 2, 5, 10, 15
>>> print ', '.join(alist)
1, 2, 5, 10, 15
-tkc
--
http://mail.python.org/mailman/listinfo/python-list
On 7 May 2006 09:15:10 -0700, compboy <[EMAIL PROTECTED]> wrote:
> How do you print elements of the list in one line?
>
> alist = [1, 2, 5, 10, 15]
>
> so it will be like this:
> 1, 2, 5, 10, 15
>
> because if I use this code
>
> for i in alist:
> print i
>
> the result would be like this
>
> 1
[C Saha]
| I am looking for a py script which will send me email when
| ever my disk becomes more than 90% full. By the way my OS is Win XP.
|
| If anybody have already has written same type of script or
| something very similar kind of script will also be great.
You can certainly do this wi
On 08/05/06, Diez B. Roggisch <[EMAIL PROTECTED]> wrote:
>
> Make it a webapp. That will guarantee to make it runnable on the list of
> OSses you gave. Use Django/TurboGears/ZOPE for the application itself-
> whichever suits you best.
based on the comment:
> I'm not a programmer and have only don
> The code below works fine, but it is less than nice to
> look at and somewhat long winded. Is there a better way
> to do the docstring task? This is the first working
> version, and can proabably be "compacted" a bit (list
> comprehensions etc) but I am looking for a better basic
> approach. Any
> Argh, embarassment on my part due to incomplete spec.
> movelist is used to store a list of chess moves and
> splitting it up in this way is so it can be printed in a
> space that is 3 lines high but quite wide. Thus the way
> the list grows as it is appended to in chopupmoves is
> intended.
Per
[EMAIL PROTECTED]
> Below are 2 files. The first is a Python program that isolates the
> problem within less than 1 hour (often just a few minutes).
It does not on my box. I ran that program, from a DOS shell, using
the released Windows Python 2.4.3. After an hour, it was still
printing. I lef
Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
>On Sun, 07 May 2006 00:09:06 GMT, Tim Roberts <[EMAIL PROTECTED]> declaimed
>the following in comp.lang.python:
>
>> [EMAIL PROTECTED] wrote:
>>
>> >6) Would it be correct to infer that the print statement
[Dale Strickland-Clark]
| from win32com.client import GetObject, constants
|
| def GetExcelData(self, strFilePath):
| """ Extract the data from the Excel sheet.
| Returns tuple of tuples representing the rows and cells."""
| # The following line extracts
| # all the data from she
> Why are people getting stuck on infinite regular
> languages? I've made it quite clear that I'm only really
> interested in doing this for finite languages, but that
> shouldn't matter anyway.
The power of regular expressions is that they define a
consice means to encapsulate an infinite numb
[EMAIL PROTECTED] wrote:
> This article is dedicated to:
>
But I am still confused: Is this a statement or an expression?
--
http://mail.python.org/mailman/listinfo/python-list
'tdir' Version 1.69 is released and available at:
http://www.tundraware.com/Software/tdir/
A FreeBSD port update has also been submitted.
What's New
--
This version introduces the -D option which supresses "dotfile/dir" display.
What Is 'tdir'?
---
'tdir' is a reimple
"help", "copyright", "credits" or "license" for more information.
>>> round(2.99543322,3)
2.9951
>>> print round(2.99543322,3)
2.995
>>>
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
Lorenzo Thurman wrote:
> This is what I have so far:
>
> //
> #!/usr/bin/python
>
> import os
>
> cmd = 'ntpq -p'
>
> output = os.popen(cmd).read()
> //
>
> The output is saved in the variable 'output'. What I need to do next is
> select the line from that output that starts with the '*'
Wel
4501 - 4600 of 7650 matches
Mail list logo