hich order the data has to be written.
>>>
>> [snip]
>> Or have a `Queue.Queue` for each source thread and make the writer
>> thread read from each in turn.
>>
>
>
> I'll try Queue.Queue, thank you. I didn't expect that multithread
> write a file is so troublesome
>
As a general rule, *ALL* multithread operations are at least that
troublesome, and most are far more so.
Pessimistically-yours,
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
;
Yes. The builtin function zip does just that: merging separate lists
into a list of tuples.
See: http://docs.python.org/lib/built-in-funcs.html#l2h-81
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
g is
immutable, nothing you do inside the function can change the string
outside the function.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
gt;> x = re.search("[0-9.]+", "(3.12345)")
>>> print x.group(0)
3.12345
There's a lot more to the re module, of course. I'd suggest reading the
manual, but this should get you started.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Cesar G. Miguel wrote:
> I've been studying python for 2 weeks now and got stucked in the
> following problem:
>
> for j in range(10):
> print j
> if(True):
>j=j+2
>print 'interno',j
>
> What happens is that "j=j+2" inside IF does not change the loop
> counter ("j") as it would
t; title="Send an Email to selected
... employee">'''
>>> print s
'D132258','',
'status=no,location=no,width=630,height=550,left=200,top=100')"
target="_blank" class="dvLink" title="Send an Email to selected
employee">
>>> s.find('\\')
-1
So the question now becomes: Where do you really want to split it? If
at the comma then one of these will work for you:
>>> print s.split(',')[0]
'D132258'
>>> i = s.index(',')
>>> print s[:i]
'D132258'
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Hi,
> Suppose i have a list v which collects some numbers,how do i
> remove the common elements from it ,without using the set() opeartor.
> Thanks
>
>
Several ways, but probably not as efficient as using a set
an event when the
keyboard is used. )
Yes, every GUI I've ever used from Python (Tk/Tcl, wxPython, Gtk++,
Win32 API, ...) has a way to catch keyboard events. But you're going to
have to tell us which OS and which GUI you're interested in before you
get a more detailed a
everal better options:
For instance:
for arg in moreargs: # Loop through each arg
or
for i in range(len(moreargs)):
# Extract ith arg
or
argslist = list(moreargs)
while argslist:
firstarg = argslist.pop(0) # Extract first arg
Gary Herron
> Second, is there any good r
AttributeError = SyntaxError
Then your code will be will produce a real AttributeError, but miss it
because (despite the spelling) it checks for a SyntaxError,
Question... I don't know what contract.py is, but could it be doing
something that *bad*?
You could check py printing Attribut
4407369744.000
>>> print '%12.5e' % x
1.84467e+19
>>> print '%12.5g' % x
1.8447e+19
See http://docs.python.org/lib/typesseq-strings.html for all he details.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
import module_a
from module_a import change_value
but that's probably confusing and generally considered a bad idea.
Ideas:
1 If you want module_a to manage such a global variable, you could
include functions for getting, and setting it, as well as your function
for changing it's value.
2. You could also dispense with use of global values -- various OOP
techniques could help there.
Gary Herron
> Thanks!
>
> Cheers,
> Valia
>
>
--
http://mail.python.org/mailman/listinfo/python-list
it probably has some special meaning.
>
> thanks,
> Stef Mientki
>
The $ is not used in any Python syntax. Neither in variable names nor
any syntactical construct.
Of course, like any character, it can be used in strings. (And some
packages, like re, will make special use of a $ i
ou. It fails to across the internet (sometimes) and
when (at least some) wireless cards are involved.
You may be better off using a package that knows all this and handles it
properly. Modules asyncore and asynchat are one possibility.
Gary Herron
>
> the sample code is as follows
>
may also want to checkout the dictionary method setdefault which has
the functionality of get PLUS if the key is not found, it adds the
key,value pair to the dictionary.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
rt 8080 with url's that
look like this:
http://localhost:8080/what/ever/..., or
http://machine-name:8080/what/ever/...,
Gary Herron
>
>
> import os, sys
>
> from BaseHTTPServer import HTTPServer
>
> from CGIHTTPServer import CGIHTTPRequestHandler
#x27;)
If you want to turn a string representation of an object back into an
object, you must eval the string.
Moreover, if the tuple contains things other than simple integers (float
of strings of whatever) the string represtnataion of the object may not
be able to recover the original object accu
Oğuz Yarımtepe wrote:
> On Thursday 16 August 2007 11:20:38 Gary Herron wrote:
>
>> If you really want to send any Python object through a socket, look up
>> the Pickle and cPickle modules. These will marshal (as it's called) any
>> Python object of any type and
ays date?
>
> Thank You
>
> Dominic
>
>
>
Here's how I'd do it:
>>> import time
>>> secondsPerDay = 24*60*60
>>> today = time.time()
>>> yesterday = today - secondsPerDay
>>> print time.strftime("%d%m%Y",time.lo
CANNOT sort a (standard Python) dictionary. You CAN find some
alternative implements of dictionaries on the web that allow ordering,
and you CAN extract the key,value pairs from a dictionary into a list,
and sort that list (by any criteria you want).
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
"self.%s = '%s'" % (item, plist[item])
>
Yuck! Not at all necessary. Use setattr instead:
setattr(self, item, plist[item])
That's much cleaner then an exec or eval. You may also find getattr and
hasattr useful.
Gary Herron
> A more simple example for setting a variable outside of a class...
>
> exec '%s = '%s'" % ('variableName', 'variable value')
>
> Cheers!
> Mike
>
>
--
http://mail.python.org/mailman/listinfo/python-list
imple (nice,
very small, well featured and consistent) widget toolkit with OpenGL
support. Once the window is open, PyOpenGL (versions 2xx or 3xx) work
perfectly on the window.
See http://www.fltk.org/
Gary Herron
>> However, it doesn't (easily) work with common GUIs like GTK and Wx.
[EMAIL PROTECTED] wrote:
> Hi,
>
> Do the Python Paths come in the form of a dictionary where I can
> access a particular path my its key in the registry?
>
> For example, in PythonWin Tools>>Edit Python Paths shows the name as
> well of the address of each path
>
> Thanks,
>
> Aine
>
>
If by "P
ot Python. It never even sees those quotes. Whatever system you are
using for entering the text is stripping them. Is it the command prompt
(cmd.exe)? If so then you can escape the quote by preceding it with a
backslash. (This is true of the DOS prompt and all the unix shells, and
their window
darren kirby wrote:
> Hi all,
>
> I have a strange error here and I am unsure how to further investigate it:
>
> Python 2.4.4 (#1, Aug 23 2007, 10:51:29)
> [GCC 4.1.2 (Gentoo 4.1.2)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>
import time
n empty string. And that would seem to mean you have an empty line in
your input.
So... Either remove the empty lines, or test my_line before calling
float on it.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Ginger wrote:
> like format function in Visual Basic,
> format("##.##%",0.3456) ==>> 34.56%
>
"%5.2f%%" % (0.3456*100)
'34.56%'
See this section of the manual:
http://docs.python.org/lib/typesseq-strings.html
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
() returns the current working directory. Call this before you
change things with os.chdir().
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
you
saying you *CAN'T* call getcwd and save the value before you call chdir,
and that you *MUST* recover the original working directory *AFTER* you
change it. I don't believe it... and won't waste my time trying to
solve such a silly problem until you demonstrate that you ca
tonyr1988 wrote:
> I'm a complete python n00b writing my first program (or attempting to,
> anyway). I'm trying to make the transition from Java, so if you could
> help me, it would be greatly appreciated. Here's the code I'm stuck on
> (It's very basic):
>
> class DemoClass:
> def __init__(s
t; a different
> "set"
>
Of course. Try this:
class document:
def __init__(self, string):
self.titre = string
self.haveWords = set()
Each instance creation will call __init__ with the instance
accessible through self, and that code will create two instance
specific attribute
procedure go is defined in a.py, the global blah it refers to
is global to that module.
So import a (instead of importing * from a) and try this:
>>> import a
>>> a.blah
>>> a.go()
>>> a.blah
5
>>>
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
behaviour isn't desired; if
the RE <.*> is matched against |'title'|, it will match the
entire string, and not just |''|. Adding "?" after the qualifier
makes it perform the match in /non-greedy/ or /minimal/ fashion; as
/few/ characters as possi
ther's be reported as the errors they are:
try:
myList[index]
except IndexError:
...whatever...
Gary Herron
> Is it ok to use try...except for the test or is it bad coding style? Or
> is there another, more elegant method than these two?
>
> Regards,
> Rehceb
>
--
http://mail.python.org/mailman/listinfo/python-list
Richard Thomas wrote:
> On 27/09/2007, Casey <[EMAIL PROTECTED]> wrote:
>
>> On Sep 27, 12:48 pm, "Simon Brunning" <[EMAIL PROTECTED]>
>> wrote:
>>
>>> On 9/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>>>
>>>
I tried writing a true and false If statement and didn't get
>
t the module uses. Version 0 is the
historical format, version 1 (added in Python 2.4) shares interned
strings and version 2 (added in Python 2.5) uses a binary format for
floating point numbers. The current version is 2
Gary Herron.
--
http://mail.python.org/mailman/listinfo/python-list
lit()
>>> print f
['1', '1', '10:55:14', '2', '65', '8.5']
>>> ','.join(f)
'1,1,10:55:14,2,65,8.5'
or
>>> ', '.join(f)
'1, 1, 10:55:14, 2, 65, 8.5'
>>>
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
sed copy of either a string or a
list
Your recursion stops when xs == [], but when you're stripping characters
off a string, like 'abc', the remaining portion will be 'bc', then 'c',
than '', but never [] so you 'll never stop.
Try:
if xs == []:
return []
elif xs == '':
return ''
else:
...
Gary Herron
>
> Thanks,
> Dima
--
http://mail.python.org/mailman/listinfo/python-list
ings in common. In particular xs[::-1] will reverse both types of
objects. And even if you roll you own reversal function, you don't need
two. One will do.
Gary Herron
>
> def reverseList(xs):
> if xs == []:
> return xs
> else:
> return (reverseList (
of Python while executing fn_outer, the
def of fn_inner looks just like an assignment with fn_inner as the
variable name and a code object as the value.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
perator named in:
>>> bigstring="python anaconda boa cobra"
>>> smallone="boa"
>>> smallone in bigstring
True
Often used in if statements like this:
>>> if smallone in bigstring:
... print 'contained'
... else:
... print '
tation of that object. Use str for a human friendlier
representation, and repr for a more explicit representation.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
and both its input and output.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
off if you can use Python's list data structure rather than try to emulate an
outdated concept in a modern language.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
#x27;t seem to figure out how to get the basic
> components of the traceback message into strings. Here's what I want
> to do:
>
The traceback module provides a wealth of ways to get at the exception
information, formated and usable in various ways.
See: http://docs
dictionary of all objects in the module, from which you
can access and iterate through the names (keys) and values.
If you want more capabilities, you should also look at the inspect module.
Gary Herron
--
Gary Herron, PhD.
Department of Computer Science
DigiPen Institute of Tech
plete Web Services
> http://www.datafly.net
>
>
Like this:
info_I_need = 'name'
print getattr(person, info_I_need)
Related to getattr are setattr and hasattr.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
ibutes
that can be used like function level static variables.
However, I usually use module level attributes for such things.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
ibutes
that can be used like function level static variables.
However, I usually use module level attributes for such things.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
returns a new string which you must assign to
something:
new_data = r.sub(ur"", data)
Then do something with the new string.
Also I fear your regular expression is incorrect.
Cheers,
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
to be able to be used in Python Win. Is there a ZIP utilty
> already stored with a basic PYTHON download?
>
> Thanks all.
>
>
The module you want is called zipfile, and its part of the standard library.
See: http://docs.python.org/lib/module-zipfile.html for documentation.
Gary Her
vithi wrote:
> Hi
> Any one tell me where I can get (or download) python modules win32com
> or win32com.client because I have to use "Dispatch" thanks
>
>
You want the "python for windows" extension, available from
http://sourceforge.net/proje
's got far more feature than you're likely to get into any Python
scripts in the near future. (Plus it's scritable from Python so you can
automate some tasks if you wish.
Gary Herron
> Thank you very much for every hint.
>
> Andrea.
>
> "Imagination Is T
tring sub is found,
4 such that sub is contained within s[start,end]. Optional
5 arguments start and end are interpreted as in slice notation.
6
7 Return -1 on failure.
So put your find in a loop, starting the search one past the previously
found occurrence.
i = string.find(mystring, i+1)
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
parsing user input.
>
> Regards,
> Deniz Dogan
>
Not only *can* it be done, but it *has* been done and well: See IPython at:
http://ipython.scipy.org/moin/
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
tabs for the indentation, so that the code
Python sees is not as we see it printed? (Don't ever do that.)
Do you have several copies of sampdict.py (or even sampdict.pyc) so that
the copy being imported is not the one you printed? (Run Python with a
-v switch to test for this possibility.)
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
h.split(path0)[0] # Up one
path2 = os.path.split(path1)[0] # Up two
sys.append(path2)
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
is highly optimized and
probably not noticeable. The number of methods/functions may slow things
up, but it will affect either name space equally.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
colorIndex
colorIndex=123 # changes the value of the global
Better yet, restructure your code to not rely on the global statement. Do
something like this if you can:
def test():
return 123
colorIndex = test()
Gary Herron
> My question is why do I have to explicit declari
ever, if you tell us how you would disable a card from outside
of Python, we'll see if we can find a way to do it from within Python.
Things you might want to tell us:
What OS.
What device(s)
Exactly what "disable" means for each.
How the OS allows you to enable/disable each.
Anythi
s have pointed out, circular imports are
often a sign that your software design is not very well thought out.
It's usually better to have your thought process, your design and your
imports organized in a hierarchal fashion.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
e reason enough for some to want to keep it out.) But this is an all
volunteer community. Your feature is not in the language because no one
has cared enough to implement it. Or if some one has implemented it, no
one has found it useful enough to lobby it into the language.
Are
[EMAIL PROTECTED] wrote:
> Hello everybody,
>
> I've banged my ahead around for a while trying to figure out why
> multiple instances of a class share the same instance variable. I've
> stripped down my code to the following, which reproduces my problem.
>
This is a *feature* of Python tha
Russ P. wrote:
> On Dec 3, 8:22 am, [EMAIL PROTECTED] wrote:
>
>> The only reason to change the name would be because of some serious
>> bad PR that came onto Python, thus causing its branding name to be
>> catagorized as something bad.
>>
>> However this is not the case, presently, and the bran
If you *really* wanted two class members *AND* two instance members
with the same names, (WHY???) then example 1 will do so, but you'll have
to access the instance members as self.member1 and the class members as
Foo.member1.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
e time, when making such an announcement, to tell
us *what* it is you are releasing. Just a sentence or two and a URL
would be only common courtesy.
Thanks,
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
ans "save"? What is "randomletters"?
The error you are getting is usually gotten by code that tries to treat
a variable containing a list as a function. Example:
someList = [1,2,3]
someList(99)
Traceback (most recent call last):
File "", line 1, in
TypeError:
h
values from each iterator respectively, and loop on that:
>>> for i,j in zip(range(10),range(10,20)):
... print i,j
...
0 10
1 11
2 12
3 13
4 14
5 15
6 16
7 17
8 18
9 19
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
and use join on a
space to the the space delimited string.
>>> theList = ['./whatever', 'a', 'b', 'c']
>>> print ' '.join([repr(i) for i in theList])
'./whatever' 'a' 'b' 'c'
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
nks,
> igor
>
But it *does* exist, and its named list.append, and it works as you wanted.
>>> list.append
>>> a = [[],[]]
>>> map(list.append, a, (1,2))
[None, None]
>>> a
[[1], [2]]
>>> map(list.append, a, (3,4))
[None, None]
>>&
[EMAIL PROTECTED] wrote:
> Hi folks,
>
> Thanks, for all the help. I tried running the various options, and
> here is what I found:
>
>
> from array import array
> from time import time
>
> def f1(recs, cols):
> for r in recs:
> for i,v in enumerate(r):
> cols[i].append(v)
>
ot;activate.tmpl", "rb")
template = "\r\n" + f.read()
f.close()
for fname in glob.glob('*.frm'):
inf = open(fname, "rb")
content = inf.read()
inf.close()
if 'Form_Activate' not in content:
print "Not in", fname
outf = open(fname, 'wb')
outf.write(content)
outf.write(template)
outf.close()
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
look* like a
declaration, but in fact it may be executed anywhere. The import
statements does, however, hard code its module's name. For a plugin
system, you'll probably want to import a module given a string
containing its name. The "imp" module provides this as w
quot;a53bc_([0-9]*).txt")
>>>
>>> s = "a53bc_531.txt"
>>> match = pattern.match(s)
>>> if match:
... print int(match.group(1))
... else:
... print "No match"
...
531
>>>
Hope that helps,
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
t.
open can be used to open a file
The open file has several methods to read bytes from the file:
read() gets the whole file at once
readline() return a line at a time
other possibilities exist
You can test to see if a string s is in another string t with
if s in t: ...
Hope that
nd ' + ComputerName + ' "' + Message + '"')
where the +'s build the command string up from pieces.
You might try invoking Python interactively and try typing some of these
expressions by hand to see that happens:
python
>>> ComputerName = 'Fred'
>>> Message = 'HI'
>>> print 'net send ComputerName "Message"'
net send ComputerName "Message"
>>> print 'net send %s "%s"' % (ComputerName, Message)
net send Fred "HI"
>>>
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
don't),
then you have to find a different way to create three separate objects.
The copy module helps with this in some cases, but for your simple
example, you just want to create the three inner objects by evaluating
the expression [0]*3 three times. Here's several ways:
a = []
for i in range(3):
a.append([0]*3)
or
a = [ [0]*3 for i in range(3)]
Clear?
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
by reading larger chunks than single lines,
and could be more accurate by closing both input and output files when
done, but you get the point I hope.
On the other hand, if you've got the right OS, you might try something like:
os.system("cat * > combined")
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
It was trying -- it just didn't have enough time.)
If you don't want the program to quit that quickly, you need to put in
something to keep it from running off the bottom and exiting. I'd
suggest something like this after the view line:
raw_input("Type ENTER when done viewing: ")
Gary Herron
>thanks
>
>
--
http://mail.python.org/mailman/listinfo/python-list
>10
>15
>
>Thanks.
>
>
Well, first, if you just print alist you'll get
[1, 2, 5, 10, 15]
which may be good enough. If that's not what you want then you can suppress
the automatic RETURN that follows a print's output by adding a trailing comma
to
iformly removed from the left of
every line in text.
This is typically used to make triple-quoted strings
line up with the left edge of screen/whatever, while still
presenting it in the source code in indented form.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Michael Yanowitz wrote:
>Hello:
>
> Many times, people are warning things like
>"Don't use 'str' as a variable name as it will shadow the
>built in str function."
> Is there some way to determine if a string is already
>defined in some higher scope?
>Maybe something like
>
>
>if isdefined ('st
ng)]
[10, 31]
And so on
Of course, if you wish, the re module can work with vastly more complex
patterns than just a constant string like your '1234'.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin wrote:
>[EMAIL PROTECTED] writes:
>
>
>>say i have string like this
>>astring = 'abcd efgd 1234 fsdf gfds abcde 1234'
>>if i want to find which postion is 1234, how can i achieve this...? i
>>want to use index() but it only give me the first occurence. I want to
>>know the positions o
appreciated.
>
>Thanks
>
>
The "subprocess" module gives a (mostly) platform independent way for
one process to start another. It provides a number of bells and
whistles, and is the latest module on a long history of older modules to
provide such functionality.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
igger monitor.
>
>
The windows CreateProcess call has many of the same semantics as the
Unix fork, i.e., a new process is created sharing all the resources of
the original process. The "subprocess" modules uses CreateProcess, but
if that does not give you sufficient control ove
that functionality.
So, putting them together, you could expect
eval(repr(a))
to reproduce a, and in fact it does so.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
>hello,
>
>i have a problem. i would like to import python files above and below
>my current directory.
>
>i'm working on /home/foo/bar/jar.py
>
>i would like to import /home/foo/car.py and
> /home/foo/bar/far.py
>
>how can i do this?
>
>thank you,
>
tried to solve, your solution
attempt, and what failed, you will likely get lots of useful answers here.
But you have to take the first step. P.S. The re module is really not
all *that* difficult.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
via ctypes.
If you can be more specific about your problem and how it fails, then
perhaps you'll get more specific answers.
Also, please read this: http://www.catb.org/~esr/faqs/smart-questions.html
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
der) C/C++ days -- ya, that's it.
Thankfully, this is Python and the modern era -- we don't use no
stinking POINTERS here.
Seriously, this group deals with Python. There are no pointers in
Python. Now please, what did you *really* mean to ask?
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
:
>
This sounds very much like a homework assignment, and so should probably
not be answered here. (Neither should it have been asked here.) If,
in your attempt to write this program, you have some questions about
Python, then I encourage to ask those questions here.
Gary Herron
> If n is
larger sublist.
>>> x = [1,2,3,4,5,6,7,8,9,10]
>>> y = 3
>>> s = len(x)/y
>>> s# size of normal sublists
3
>>> e = len(x) - y*s # extra elements for last sublist
>>> e
1
>>> z = [x[s*i:s*i+s] for i in
access an sqlite installation, but it does not include the
sqlite installation itself. That should be installed separately. (I
suppose a distro of Linux could package them together, but I don't know
of one that does, and such is not the intent of Python.)
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
row
into the hundreds or thousands or higher. If you want to try one of the
floating point formats, then your first number must be large enough to
account for digits (before and after) the decimal point, the 'E', and
any digits in the exponent, as well as signs for both the number and th
27;s
it not yet implemented, and mistakenly tries to call it, an error will
be raised.
It's not so useful in a small application, or a single person project,
but it does become useful if several people are writing different parts
(say a library and an application) at the same time.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
ach won't scale very well since the whole string would be
re-created anew for each stop_list entry. In that case, I'd look into
the regular expression (re) module. You may be able to finagle a way to
find and replace all stop_list entries in one pass. (Finding them all
is easy -- not so sure you could replace them all at once though. )
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
Karthik wrote:
> How about -
>
> for s in stoplist:
> string.replace(mystr, s, "")
>
That will work, but the string module is long outdated. Better to use
string methods:
for s in stoplist:
mystr.replace(s, "")
Gary Herron
> Hope this s
icit (defined) limit. The amount of available address
space forms a practical limit.
Gary Herron
--
http://mail.python.org/mailman/listinfo/python-list
second produces an int
value, but since one is a subclass of the other, you'd have to write
quite perverse code care about the difference.
Gary Herron
> I hope, I made clear, what I want...
>
Quite.
> CU
>
> Kristian
>
--
http://mail.python.org/mailman/listinfo/python-list
301 - 400 of 779 matches
Mail list logo