Francesco Pietra wrote:
>
> Please, how to adapt the following script (to delete blank lines) to
> delete
> lines containing a specific word, or words?
>
> f=open("output.pdb", "r")
> for line in f:
> line=line.rstrip()
> if line:
> print line
> f.close()
>
> If pytho
On Jan 6, 11:01 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > Interfaces are a extremly smart Design Principle in static typed
> > languages like Java and C++.
>
> that's somewhat questionable in itself, and even more questionable as an
> argument for interfaces in Pyt
On Jan 5, 11:07 pm, [EMAIL PROTECTED] wrote:
> Paddy:
>
> > Not really, it seems to me to be going the exact opposite way with
> > languages with automatic type conversions being seen as not suited for
> > larger programs.
>
> In Java you can add the number 1 to a string, and have it
> automaticall
I'm trying to rum gmmtrain within my pthon program like this:
os.system(gmmtrain -o output -i Input -l List -t inittype -e traintype -m
mixture -d dimension -v vfloor -n number -p percent -r results -c cycle)
But i keep on getting an error.
-
Looking for
As I said I am no expert in OS and commands, except on what concerns mechanical
statistical and quantum mechanical calculations. Therefore, better for me (and
for all guys here) if I stop on this matter. My reply is only to say that I did
the job with:
f=open("prod1-3_no_wat_pop.pdb", "r")
for lin
--- Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> On Sun, 06 Jan 2008 13:33:52 -0800, Francesco Pietra wrote:
>
> > Steven:
> > Thanks. See below please (of very marginal interest)
> >
> > --- Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> >
> >> On Sun, 06 Jan 2008 09:21:33 -0800, Francesco Piet
On Mon, 07 Jan 2008 00:42:01 +, Grant Edwards wrote:
>> If you want to delete them, you still have to do the rest of the job
>> yourself.
>
> Nonsense.
>
> How is this not doing what the OP asks?
>
>grep -v pattern infile >outfile; mv outfile infile
It isn't deleting lines. As abstract
On Mon, 07 Jan 2008 12:25:07 +1100, Ben Finney wrote:
> John Nagle <[EMAIL PROTECTED]> writes:
>
>> For our own purposes, I rewrote "htmldecode" to require a sequence
>> ending in ";", which means some bogus HTML escapes won't be recognized,
>> but correct HTML will be processed correctly. What's
On Mon, 07 Jan 2008 00:33:36 +0100, Bjoern Schliessmann wrote:
> Steven D'Aprano wrote:
>
>> grep doesn't delete lines. grep matches lines. If you want to delete
>> them, you still have to do the rest of the job yourself.
>
> In which way does "grep -v mypattern myfile > myfile" not delete the
>
you need wx-c.so from wxnet.sourceforge.net on linux
My source uses wx-c.dll, because I am in ms win2k
On Jan 4, 10:30 pm, Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
> oyster <[EMAIL PROTECTED]> wrote:
> > The following is my pure-python wxwidgets test.
>
> It is hardly pure python since it depend
[EMAIL PROTECTED] wrote:
> I am having trouble with ctypes: i can load the third party dll, and
> gain access to the function but the function calls do not actually
> perform their intended purpose. I have tried this in both interactive
> mode and from a saved script. I know that is a somewhat va
John Nagle <[EMAIL PROTECTED]> writes:
> For our own purposes, I rewrote "htmldecode" to require a sequence
> ending in ";", which means some bogus HTML escapes won't be
> recognized, but correct HTML will be processed correctly. What's
> general opinion of this behavior? Too strict, or OK?
I thi
I am having trouble with ctypes: i can load the third party dll, and
gain access to the function but the function calls do not actually
perform their intended purpose. I have tried this in both interactive
mode and from a saved script. I know that is a somewhat vague
description but any help woul
Another in our ongoing series on "Parsing Real-World HTML".
It's wrong, of course. But Firefox will accept as HTML escapes
&
>
<
as well as the correct forms
&
>
<
To be "compatible", a Python screen scraper at
http://zesty.ca/python/scra
On 2008-01-06, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> On Sun, 06 Jan 2008 13:33:52 -0800, Francesco Pietra wrote:
>
>> Steven:
>> Thanks. See below please (of very marginal interest)
>>
>> --- Steven D'Aprano <[EMAIL PROTECTED]> wrote:
>>
>>> On Sun, 06 Jan 2008 09:21:33 -0800, Francesco Pi
On Jan 6, 2008 6:59 PM, Dan Bishop <[EMAIL PROTECTED]> wrote:
>
> My employer has us use the "m_" convention.
>
> I wonder why Bjarne made "this->" optional in the first place.
> --
> http://mail.python.org/mailman/listinfo/python-list
>
I think implicit this-> is somewhat more defensible. If 'th
On Jan 5, 4:53 am, Bjoern Schliessmann wrote:
> [EMAIL PROTECTED] wrote:
> > Jeroen Ruigrok van der Werven wrote:
> >> self.startLoc = start
> >> self.stopLoc = stop
>
> > Thanks! Of course it should. Old Java habits die slowly.
>
> That's not really a Java habit. In Java and C++, personally I lik
On Jan 6, 3:33 pm, Bjoern Schliessmann wrote:
> Steven D'Aprano wrote:
> > grep doesn't delete lines. grep matches lines. If you want to
> > delete them, you still have to do the rest of the job yourself.
>
> In which way does "grep -v mypattern myfile > myfile" not delete the
> lines matching myp
On Jan 6, 8:56 am, [EMAIL PROTECTED] wrote:
> some more doubts in this area,,forgive the ignorance of a beginner
>
> i have
>
> class MyError(Exception):
>def __init__(self,msg)
> self.msg=msg
>
> now my method that can raise this is
>
> class SomeClass:
> ...
>def mymetho
Steven D'Aprano wrote:
> grep doesn't delete lines. grep matches lines. If you want to
> delete them, you still have to do the rest of the job yourself.
In which way does "grep -v mypattern myfile > myfile" not delete the
lines matching mypattern?
Regards,
Björn
--
BOFH excuse #184:
loop fo
Had the same issue. What you want is: reload()
--
http://mail.python.org/mailman/listinfo/python-list
Tinkering with Python I find myself often writing scripts and then
experimenting with the interactive interpreter, which is really a cool
way to learn a language. However, when, after loading a module with
import
or
from module import *
and using it, I make a change to the module file, the cha
I was just looking through the 2.5.1 source code. I noticed a few
mis-spellings in the comments. No big deal really. Can patches be
submitted that correct the spelling errors or should they just be
pointed out to some mailing list?
Thanks,
Brad
--
http://mail.python.org/mailman/listinfo/python
On Jan 5, 5:36 pm, [EMAIL PROTECTED] wrote:
> On Jan 5, 9:50 pm, Paul Hankin <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Jan 5, 5:12 pm, Paul Hankin <[EMAIL PROTECTED]> wrote:
>
> > > On Jan 5, 4:14 pm, [EMAIL PROTECTED] wrote:
>
> > > > On Jan 5, 5:07 pm, [EMAIL PROTECTED] wrote:
>
> > > > > Hello, Pa
Dear List
I would like to know is it possible to use VS (Visual Studio) as a python
IDE! It's a great IDE for C# and i would like to be able to use it for
python also!
Thanks
James
--
http://search.goldwatches.com/?Search=Movado+Watches
http://www.jewelerslounge.com
http://www.goldwatches.com
-
On Sun, 06 Jan 2008 13:33:52 -0800, Francesco Pietra wrote:
> Steven:
> Thanks. See below please (of very marginal interest)
>
> --- Steven D'Aprano <[EMAIL PROTECTED]> wrote:
>
>> On Sun, 06 Jan 2008 09:21:33 -0800, Francesco Pietra wrote:
>>
>> > Please, how to adapt the following script (to
On Jan 5, 2008 11:31 AM, <[EMAIL PROTECTED]> wrote:
> import tok
>
> class code:
> def __init__( self, start, stop ):
> startLoc = start
> stopLoc = stop
>
> class token(code):
> pass
>
Apart from the missing self, remember that the __init__(...) of the
base classes is no
On Sunday 06 January 2008 21:25 Francesco Pietra wrote:
>> yes lines starting with a "#" are comments in python but that shouldn't
>> be of concern for your input data. I don't quite get what you want
>> here...
>
> Leaving the lines commented out would permit to resume them or at least
> remeber
Steven:
Thanks. See below please (of very marginal interest)
--- Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> On Sun, 06 Jan 2008 09:21:33 -0800, Francesco Pietra wrote:
>
> > Please, how to adapt the following script (to delete blank lines) to
> > delete lines containing a specific word, or wor
On Sun, 06 Jan 2008 09:21:33 -0800, Francesco Pietra wrote:
> Please, how to adapt the following script (to delete blank lines) to
> delete lines containing a specific word, or words?
That's tricky, because deleting lines from a file isn't a simple
operation. No operating system I know of (Windo
--- Martin Marcher <[EMAIL PROTECTED]> wrote:
> On Sunday 06 January 2008 18:21 Francesco Pietra wrote:
>
> > Please, how to adapt the following script (to delete blank lines) to
> > delete lines containing a specific word, or words?
> >
> > f=open("output.pdb", "r")
> > for line in f:
> > line
On Sunday 06 January 2008 18:21 Francesco Pietra wrote:
> Please, how to adapt the following script (to delete blank lines) to
> delete lines containing a specific word, or words?
>
> f=open("output.pdb", "r")
> for line in f:
> line=line.rstrip()
> if line:
> print line
> f.close()
>>> import r
Lie a écrit :
> On Jan 5, 5:40 pm, [EMAIL PROTECTED] wrote:
>
>>Jeroen Ruigrok van der Werven wrote:
>>
>>
>>>Shouldn't this be:
>>
>>>self.startLoc = start
>>>self.stopLoc = stop
>>
>>Thanks! Of course it should. Old Java habits die slowly.
>
>
> No, seriously it isn't Java habits only, most ot
Sion Arrowsmith a écrit :
> hyperboreean <[EMAIL PROTECTED]> wrote:
>
>>Why doesn't python provide interfaces trough its standard library?
>
>
> Because they're pointless.
(snip rant about Java's "interfaces")
Hem... Zope3's "interface" system is not exactly the same thing as
Java's one.
--
>
> ...where the image data is loaded into a numpy array
> (1600x1200x3)...
One comment: that is a big array, too big for the cache memory. I know
that in these cases it makes a difference how many times the slices of
the array are loaded and unloaded from RAM onto cache. One issue is
that a 2D a
On 2008-01-06, Matt Nordhoff <[EMAIL PROTECTED]> wrote:
>> Please, how to adapt the following script (to delete blank lines) to delete
>> lines containing a specific word, or words?
> If you're on Linux, why not just use grep?
>
> $ grep -v theword output.pdb
And if you're on Windows, install Cy
je m'interroge si ceci est ta nouvelle adresse...
je te cherchais a tout hazard sur internet...
bises
marion battentier de la rochette, tu te souviens??--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> ...if another method in the same class calls this method but wants to
> pass the error to a gui code which calls it,,can i do like this
>
> def callingmethode(self):
> try:
> mymethod()
> except MyError,myerr:
> raise myerr
>
> so that I
[EMAIL PROTECTED] a écrit :
> Well, you see, I have some database functions that deal with "things"
> which are either classes or instances thereof. I though polymorphism
> would be a nice way to handle them identically, like:
>
> def do(thing): thing.Foo()
> do(t)
> do(Test)
>
> But never mind,
Pete:
> Translate the hexadecimal form
> into decimal and confirm that they match.
No need to convert the IDs...
Soviut:
> You shouldn't have to compare the hex IDs. Just a simple comparison
> operator will work:
>
> firstPoint = Point()
> secondPoint = Point()
> print(firstPoint == secondPoint
In article <[EMAIL PROTECTED]>,
JKPeck <[EMAIL PROTECTED]> wrote:
>
u = u"abc"
uu = unicode(u)
u is uu
>True
s = "abc"
ss = unicode(s)
s is ss
>False
You uuencode Unicode?
--
Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/
Sorry, couldn't
I forgot to add that the lines to strip are in present case of the type of the
following block
HETATM 7007 O WAT 446 27.622 34.356 55.205 1.00 0.00 O
HETATM 7008 H1 WAT 446 27.436 34.037 56.145 1.00 0.00 H
HETATM 7009 H2 WAT 446 27.049 33.82
Francesco Pietra wrote:
> Please, how to adapt the following script (to delete blank lines) to delete
> lines containing a specific word, or words?
>
> f=open("output.pdb", "r")
> for line in f:
> line=line.rstrip()
> if line:
> print line
> f.close()
>
> If python in Li
Please, how to adapt the following script (to delete blank lines) to delete
lines containing a specific word, or words?
f=open("output.pdb", "r")
for line in f:
line=line.rstrip()
if line:
print line
f.close()
If python in Linux accepts lines beginning with # as co
forget about syntax err.. sorry ..but still would like to know if
raising exception inside an except clause the right way?
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 05 Jan 2008 23:31:02 -0800, r.grimm wrote:
> They force the user of a framework to use it in a defined way.
This is the arrogance of the provider thinking that he can anticipate all
the needs of the user.
Even when interfaces exist, they should be there to guide the user rather
than to
On Sun, 06 Jan 2008 00:31:13 -0800, Soviut wrote:
> I figured that an append would be treated as a set since I'm adding to
> the list. But what you say makes sense, although I can't say I'm happy
> with the behaviour. Is there any way I can get the append to fire a
> set? I'm thinking of propert
some more doubts in this area,,forgive the ignorance of a beginner
i have
class MyError(Exception):
def __init__(self,msg)
self.msg=msg
now my method that can raise this is
class SomeClass:
...
def mymethod(self):
if (somecondition):
raise MyError("somec
On Jan 6, 9:06 am, John Nagle <[EMAIL PROTECTED]> wrote:
>Does
>
> text = unicode(text)
>
> make a copy of a Unicode string, or is that essentially a
> free operation if the input is already Unicode?
>
> John Nagle
>>> u = u"abc"
>>> uu = unicode(u)
>>>
John Nagle wrote:
>Does
>
> text = unicode(text)
>
> make a copy of a Unicode string, or is that essentially a
> free operation if the input is already Unicode?
>>> u = u"some long unicode object"
>>> unicode(u) is u
True
--
http://mail.python.org/mailman/listinfo/python-list
John Nagle wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
>Does
>
> text = unicode(text)
>
> make a copy of a Unicode string, or is that essentially a
> free operation if the input is already Unicode?
>
> John Nagle
>
http://docs.python.org/lib/built-in-fun
Does
text = unicode(text)
make a copy of a Unicode string, or is that essentially a
free operation if the input is already Unicode?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 4, 2008 1:39 AM, <[EMAIL PROTECTED]> wrote:
> Hopefully this isn't too OT.
>
> One thing I like about comp.lang.python is the breadth of topics
> discussed here. People can ask about Python installation and
> configuration issues on specific platforms, compare third party
> libraries, ask
James Matthews wrote:
> You can use the stop method!
You can?
>>> import threading
>>> t = threading.Thread()
>>> t.stop()
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'Thread' object has no attribute 'stop'
>>>
What Python version are you using?
--
http://
tarun wrote:
> Can anyone help me with a simple code through which the main thread can
> kill the worker thread it started.
it cannot. threads cannot be killed from the "outside".
--
http://mail.python.org/mailman/listinfo/python-list
You can use the stop method!
On Jan 6, 2008 2:04 PM, tarun <[EMAIL PROTECTED]> wrote:
> Hello All,
>
> Can anyone help me with a simple code through which the main thread can
> kill the worker thread it started.
>
> Thanks & Regards,
> Tarun Devnani
>
> --
> http://mail.python.org/mailman/listinf
On Jan 3, 3:49 pm, [EMAIL PROTECTED] wrote:
> hi, i have some code where i set a bool type variable and if the value
> is false i would like to return from the method with an error msg..
> being a beginner I wd like some help here
>
> class myclass:
> .
> def mymethod(self):
>
On Jan 5, 11:36 pm, [EMAIL PROTECTED] wrote:
>
> This one is good. Someone commented that you destroy the list, but
> that can be fixed:
>
> def pick_random(seq, prop):
> L = len(seq)
> for i in xrange(L):
> r = random.randrange(L - i)
> if prop(seq[r]):
>
Hello All,
Can anyone help me with a simple code through which the main thread can kill
the worker thread it started.
Thanks & Regards,
Tarun Devnani
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 5, 4:16 am, [EMAIL PROTECTED] wrote:
> The warning "The group you are posting to is a Usenet group. Messages
> posted to this group will make your email address visible to anyone on
> the Internet." means a person, but not a bot, may see my email
> address, so it is safe to use my real addre
Soviut schrieb:
> On Jan 6, 3:03 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
>> [EMAIL PROTECTED] wrote:
>>> I've created a class that has a property which points at a private
>>> list. When I try to use the append() function on this list property,
>>> the fget method is fired rather than the fse
On Jan 5, 6:37 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I am nes to python and need some help. Can anyone lead me in the
> right direction to create and print a Point object, and then use id to
> print the object's unique identifier. Translate the hexadecimal form
> into decimal and co
[EMAIL PROTECTED] wrote:
> Interfaces are a extremly smart Design Principle in static typed
> languages like Java and C++.
that's somewhat questionable in itself, and even more questionable as an
argument for interfaces in Python.
I'd recommend anyone who thinks that they cannot program without
On Jan 6, 3:03 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > I've created a class that has a property which points at a private
> > list. When I try to use the append() function on this list property,
> > the fget method is fired rather than the fset method. If I dir
**ssex with needs**
* u like mee**
* uuu lilke boobs***
***
http://www.geocities.com/gurus68/
**
--
http://mail.python.org/mailman/list
[EMAIL PROTECTED] wrote:
> I've created a class that has a property which points at a private
> list. When I try to use the append() function on this list property,
> the fget method is fired rather than the fset method. If I directly
> set my property to a literal list, the set method fires.
>
hi bukzor & everyone who replied
thanks for the detailed replies
will try to write that way
thanx a lot
jim
bukzor wrote:
> On Jan 4, 8:51 am, bukzor <[EMAIL PROTECTED]> wrote:
>
> #exercise of the class and error handling
> m = myclass()
> try:
> m.mymethod()
> print "Completed success
67 matches
Mail list logo