hi
what is the correct way to represent blank lines in python (while
iterating a file) without regexp? I know one way is to use
re.search((line,r'^$') to grab a blank line, but i wanna try not to use
regexp...
is it
1) if line == ''": dosomething() (this also means EOF right? )
2) if line is None:
Hi
I have a string like this
text = "abc abc and Here and there"
I want to grab the first "abc" before "Here"
import string
string.find(text, "Here") #
I am having a problem with the next step.
thanks
--
http://mail.python.org/mailman/listinfo/python-list
text[:text.find('Here')].rfind('abc')
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> what is the correct way to represent blank lines in python (while
> iterating a file) without regexp? I know one way is to use
> re.search((line,r'^$') to grab a blank line, but i wanna try not to use
> regexp...
> is it
> 1) if line == ''": dosomething() (this also mea
[EMAIL PROTECTED] wrote:
Mick, you should be a bit more patient. Allow for some time for an answer to
arrive. Minor edits of your question don't warrant a repost.
> i have a file test.dat eg
>
> abcdefgh
> ijklmn
> <-newline
> opqrs
> tuvwxyz
>
>
> I wish to print the contents of
Gary Wessle wrote:
> I have a string like this
>
> text = "abc abc and Here and there"
> I want to grab the first "abc" before "Here"
>
> import string
> string.find(text, "Here") #
>
> I am having a problem with the next step.
These days str methods are preferred over the string module's fun
[EMAIL PROTECTED] wrote:
> i have a file test.dat eg
>
> abcdefgh
> ijklmn
> <-newline
> opqrs
> tuvwxyz
>
>
> I wish to print the contents of the file such that it appears:
> abcdefgh
> ijklmn
> opqrs
> tuvwxyz
>
> here is what i did:
> f = open("test.dat")
> while 1:
> line
André wrote:
> I've started using elementtree and don't understand how to use it to
> manipulate and replace nodes. I know how to do this using a simple,
> but inefficient parser I wrote, but I'd rather learn to use a better
> tool - especially as it is to be added to the standard library.
> Now
thanks..and sorry, i am using the web version of google groups and
didn't find an option i can edit my post, so i just removed it..
thanks again for the reply..
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> hi
> i have a file test.dat eg
>
> abcdefgh
> ijklmn
> <-newline
> opqrs
> tuvwxyz
> <---newline
>
> I wish to print the contents of the file such that it appears:
> abcdefgh
> ijklmn
> opqrs
> tuvwxyz
>
> here is what i did:
> f = open("test.dat
Steve Holden wrote:
> Objects don't actually "pass references to themselves". The interpreter
> adds the bound instance as the first argument to a call on a bound method.
Sure, if you want to get technical For that matter, objects don't actually
call their methods either -- the interpreter looks
[EMAIL PROTECTED] wrote:
> For the list [1,2,3,4], I'm looking for the following for k = 2:
>
> [[1,2], [3,4]]
> [[1,3], [2,4]]
> [[1,4], [2,3]]
That's not what you asked for the first time. You said you wanted "m
non-empty, disjoint subsets", but the subsets above are clearly not all
disjoint;
On 1 May 2006 07:19:48 -0700, rumours say that [EMAIL PROTECTED] might
have written:
>I'm not sure what "falls off the end" of the function means, i searched
>online, it seems to mean that the function has reached the end
>prematurely and returned a default identifier to signal success or
>not.. C
Serge Orlov wrote:
> I. Myself wrote:
>> Suppose it is supposed to run for one minute, but it just keeps going
>> and going. Does Python have any way to kill it?
>
> On linux it's pretty easy to do, just setup alarm signal. On windows
> it's not so trivial to the point you cannot do it using pyth
[EMAIL PROTECTED] wrote:
> hi
> i have a file test.dat eg
>
> abcdefgh
> ijklmn
> <-newline
> opqrs
> tuvwxyz
> <---newline
>
> I wish to print the contents of the file such that it appears:
> abcdefgh
> ijklmn
> opqrs
> tuvwxyz
>
> here is what i did:
> f = open("test.dat
[EMAIL PROTECTED] wrote:
> Hi,
>
> I'm creating a small application in Python that uses lists and
> dictionaries to create a rudimentary database. I'd like to create some
> "fill-in-the-blanks" reports from this data, ideally by taking an RTF
> or plaintext file as a template and replacing placeho
John Machin wrote:
>
> # Doh! Looks like recursion not necessary. Google 'eliminate tail
> recursion' :-)
>
I did, and found this:
http://www.biglist.com/lists/dssslist/archives/199907/msg00389.html
which explains that the Scheme compiler optimises (obvious) tail
recursion into iterative code. I
On 30 Apr 2006 05:33:39 -0700, rumours say that "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> might have written:
>
>kpp9c wrote:
>> For a time i pick from my songs, but i only play a few of the songs in
>> that list... now my wife, Jessica Alba, comes home, and i start playing
>> from Jessica's list o
Edward Elliott wrote:
> Serge Orlov wrote:
> > I. Myself wrote:
> >> Suppose it is supposed to run for one minute, but it just keeps going
> >> and going. Does Python have any way to kill it?
> >
> > On linux it's pretty easy to do, just setup alarm signal. On windows
> > it's not so trivial to th
Fredrik Lundh wrote:
> André wrote:
>
> > I've started using elementtree and don't understand how to use it to
> > manipulate and replace nodes.
[snip]
It was mostly the following step which I couldn`t figure out...
> # 2) mutate the pre element
> pre.clear()
> pre.tag = "form"
>
On 2 May 2006 03:03:45 -0700, rumours say that "Iain King"
<[EMAIL PROTECTED]> might have written:
>John Machin wrote:
>>
>> # Doh! Looks like recursion not necessary. Google 'eliminate tail
>> recursion' :-)
>
>I did, and found this:
>http://www.biglist.com/lists/dssslist/archives/199907/msg003
[EMAIL PROTECTED] enlightened us with:
> thanks..and sorry, i am using the web version of google groups and
> didn't find an option i can edit my post
It's usenet, you can't edit posts.
> so i just removed it..
Which doesn't work at all. Stupid thing they allow you to try and
delete something o
[EMAIL PROTECTED] enlightened us with:
> I'm creating a small application in Python that uses lists and
> dictionaries to create a rudimentary database. I'd like to create
> some "fill-in-the-blanks" reports from this data, ideally by taking
> an RTF or plaintext file as a template and replacing pl
Peter Otten <[EMAIL PROTECTED]> writes:
> Gary Wessle wrote:
>
> > I have a string like this
> >
> > text = "abc abc and Here and there"
> > I want to grab the first "abc" before "Here"
> >
> > import string
> > string.find(text, "Here") #
> >
> > I am having a problem with the next step.
>
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:
print line
is simpler and easier to re
Gary Wessle wrote:
>> These days str methods are preferred over the string module's functions.
>>
>> >>> text = "abc abc and Here and there"
>> >>> here_pos = text.find("Here")
>> >>> text.rfind("abc", 0, here_pos)
>> 4
>>
>> Peter
>
> and what about when python 3.0 is released and those deprec
Edward Elliott wrote:
> Holger wrote:
>
>>oops, that was kinda embarrassing.
>
>
> It's really not. You got a completely unhelpful error message saying you
> passed 2 args when you only passed one explicitly. The fact the b is also
> an argument to b.addfile(f) is totally nonobvious until you
[EMAIL PROTECTED] wrote:
> For the list [1,2,3,4], I'm looking for the following for k = 2:
>
> [[1,2], [3,4]]
> [[1,3], [2,4]]
> [[1,4], [2,3]]
>
> for k = 3:
>
> [[1,2,3], [4]]
> [[1,2,4], [3]]
> [[1,3,4], [2]]
> [[2,3,4], [1]]
>
def pickk(k,N,m=0) :
if k==1 :
return ((n,) for
[EMAIL PROTECTED] wrote:
> hi
> i have a file test.dat eg
>
> abcdefgh
> ijklmn
> <-newline
> opqrs
> tuvwxyz
>
>
> I wish to print the contents of the file such that it appears:
> abcdefgh
> ijklmn
> opqrs
> tuvwxyz
>
> here is what i did:
> f = open("test.dat")
> while 1:
>
Hi,
Is it possible to have both versions of pyqt (in my case 3.14.1 and 4.0)?
Version 3 is built using sip 4.2.1, version 4 is built using sip 4.4.3
When I run pyqt 4.0 (but with installed sip 4.2.1) I get:
from PyQt4 import QtCore, QtGui
TypeError: invalid argument to sipBadCatcherResult()
Wh
I think that this results must be the same:
In [3]: math.atan2(-0.0,-1)
Out[3]: -3.1415926535897931
In [4]: math.atan2(-0,-1)
Out[4]: 3.1415926535897931
In [5]: -0 == -0.0
Out[5]: True
This is python 2.4.4c0 on Debian GNU/Linux.
Regards,
Vedran Furač
--
http://mail.python.org/mailman/lis
Is there any chance that Python would support the --version command line
parameter? It seems that many open source programs use this switch to
report their version number.
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
>From the wxPython list:
> Hi,
>
> Which event must I catch to be called when the user clicks on the combo
> "button" to make the drop down list to appear ?
No, there isn't a specific event for the opening of the drop-down box.
Regards,
Philippe
Philippe Martin wrote:
> Hi,
>
> I
On Tuesday 02 May 2006 1:01 pm, Skink wrote:
> Hi,
>
> Is it possible to have both versions of pyqt (in my case 3.14.1 and 4.0)?
Yes - but not that version of PyQt3.
> Version 3 is built using sip 4.2.1, version 4 is built using sip 4.4.3
>
> When I run pyqt 4.0 (but with installed sip 4.2.1) I g
Peter Otten wrote:
> Gary Wessle wrote:
>
> >> These days str methods are preferred over the string module's functions.
> >>
> >> >>> text = "abc abc and Here and there"
> >> >>> here_pos = text.find("Here")
> >> >>> text.rfind("abc", 0, here_pos)
> >> 4
> >>
> >> Peter
> >
> > and what about when
Paul Watson wrote:
> Is there any chance that Python would support the --version command line
> parameter? It seems that many open source programs use this switch to
> report their version number.
try at a command prompt:
python -V
Hope this helps.
Adonis
--
http://mail.python.org/mailman/
Serge Orlov wrote:
> Peter Otten wrote:
>> Gary Wessle wrote:
>>
>> >> These days str methods are preferred over the string module's
>> >> functions.
>> >>
>> >> >>> text = "abc abc and Here and there"
>> >> >>> here_pos = text.find("Here")
>> >> >>> text.rfind("abc", 0, here_pos)
>> >> 4
>> >>
>>
Phil Thompson wrote:
>
>
> Install the latest versions of PyQt3 and SIP.
Thanks Phil!
v4.0 & v3.16 work with sip 4.4.3 ;)
skink
--
http://mail.python.org/mailman/listinfo/python-list
Adonis wrote:
> Paul Watson wrote:
>
>> Is there any chance that Python would support the --version command
>> line parameter? It seems that many open source programs use this
>> switch to report their version number.
>
>
>
> try at a command prompt:
> python -V
>
> Hope this helps.
>
> A
Vedran Fura? wrote:
> I think that this results must be the same:
>
> In [3]: math.atan2(-0.0,-1)
> Out[3]: -3.1415926535897931
>
> In [4]: math.atan2(-0,-1)
> Out[4]: 3.1415926535897931
>
> In [5]: -0 == -0.0
> Out[5]: True
Glimpsing at the hardware formats:
>>> struct.pack("d", 0.0)
'\x00\x
Hi,
like a lot of other newbies in xml i suffer from the various ways you
can take for xml data processing in python. Here are my two major
problems:
Problem number one:
A application written in python remote controls (demands actions) a HIL
(Hardware in the loop) test stand and evaluate its actio
Hi,
I'm attempting to build a small app that uses pythoncard for a gui
layer. The intention is to use py2app to construct an .app bundle for
the Mac. I'm running OS 10.4 on an Intel MacBook Pro. I'm using the
default installed Python 2.3
The .app bundle appears to build, but when I start up it
Vedran Furač wrote:
> I think that this results must be the same:
> In [3]: math.atan2(-0.0,-1)
> Out[3]: -3.1415926535897931
> In [4]: math.atan2(-0,-1)
> Out[4]: 3.1415926535897931
-0 is converted to 0, then to 0.0 for calculation, losing the sign. You
might as well write 0.0 instead of -0
The
I agree. The "--version" option has become quite a de-facto standard
in the linux world. In my sys-admin role, I can blithely run
initiate_global_thermonuclear_war --version
to find what version we have, even if I don't know what it does...
python --version
would be a very helpful addition.
Hi all,
I'm trying to automate my web browser testing by using Pamie and
Python.
Everything is going great except for when a new window opens up. (on
the previous page, I click next, and a new window is opened up)
The focus it seems is never transferred. I suspect this because the
control is no
I wrote:
>
> def pickk(k,N,m=0) :
> if k==1 :
> return ((n,) for n in range(m,N))
> else :
> return ((n,)+more for more in pickk(k-1,N,m+1)
> for n in range(m,more[0]))
>
> def partitionN(k,N) :
> subsets = [frozenset(S) for S in pickk(k,N)]
[EMAIL PROTECTED] wrote:
> Hi,
>
> I'm attempting to build a small app that uses pythoncard for a gui
> layer. The intention is to use py2app to construct an .app bundle for
> the Mac. I'm running OS 10.4 on an Intel MacBook Pro. I'm using the
> default installed Python 2.3
>
> The .app bundle
Ben Caradoc-Davies wrote:
> Vedran Furač wrote:
>> I think that this results must be the same:
>> In [3]: math.atan2(-0.0,-1)
>> Out[3]: -3.1415926535897931
>> In [4]: math.atan2(-0,-1)
>> Out[4]: 3.1415926535897931
>
> -0 is converted to 0, then to 0.0 for calculation, losing the sign. You
> mig
Paul Watson wrote:
> I am well aware of -V. Could --version be supported as well?
http://www.python.org/dev/
http://sourceforge.net/tracker/?group_id=5470&atid=355470
--
http://mail.python.org/mailman/listinfo/python-list
Vedran Furac wrote:
> Ben Caradoc-Davies wrote:
> > Vedran Furac wrote:
> >> I think that this results must be the same:
> >> In [3]: math.atan2(-0.0,-1)
> >> Out[3]: -3.1415926535897931
> >> In [4]: math.atan2(-0,-1)
> >> Out[4]: 3.1415926535897931
> >
> > -0 is converted to 0, then to 0.0 for cal
[EMAIL PROTECTED] wrote:
> To begin with I'd like to apologize that I am not very experienced
> Python programmer so please forgive me if the following text does not
> make any sense.
>
> I have been missing constants in Python language. There are some
> workarounds available, for example the const
Hello,
since ConfigParser does not seem to support multiple times the same option
name, like:
dir="/home/florian"
dir="/home/john"
dir="/home/whoever"
(only the last one is read in)
I wonder what the best way to work around this.
I think the best solution would be to use a seperation character:
That is what I was afraid for
Thanks for answering,
Rony
> Hi,
>
> From the wxPython list:
>
>> Hi,
>>
>> Which event must I catch to be called when the user clicks on the combo
>> "button" to make the drop down list to appear ?
>
> No, there isn't a specific event for the opening of the
Serge Orlov wrote:
>> So, you can convert -0 to 0, but you must multiply the result with sign of
>> y, which is '-' (minus).
>
> But you miss the fact that 0 is an *integer*, not a float, and -0
> doesn't exist.
Yes, you are right, I completely missed that 0 is integer in python, and I
need a fl
Alle 17:06, martedì 02 maggio 2006, seeker ha scritto:
> printLine = line.rstrip("\n")
I think that nobody considered if the text has (\r) or (\r\n) or (\n) at the
end of the line(s).
--
http://mail.python.org/mailman/listinfo/python-list
Fulvio wrote:
> Alle 17:06, martedì 02 maggio 2006, seeker ha scritto:
>> printLine = line.rstrip("\n")
>
> I think that nobody considered if the text has (\r) or (\r\n) or (\n)
> at the end of the line(s).
>
You think wrongly.
The suggested code opens the file in text mode so the line end
"Christophe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> [EMAIL PROTECTED] a écrit :
> Floating point numbers just don't have the required precision to represent
> 2.0 - 1e-050. For your specific problem, if you really want the result to
> be < 2.0, the the best you can do is
Fulvio wrote:
> > printLine = line.rstrip("\n")
>
> I think that nobody considered if the text has (\r) or (\r\n) or (\n) at the
> end of the line(s).
if it's opened in text mode (the default), and is a text file, it will
always have "\n" at the end of the line.
--
http://mail.python.org/ma
"Andrew Koenig" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 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
Florian Lindner escribió:
> I think the best solution would be to use a seperation character:
>
> dir="/home/florian, /home/john, home/whoever"
RCS uses , in filenames
> What do you think? Any better ideas?
A bit ugly, but probably safer and simpler than adding arbitrary separators:
[section]
The Windows Powershell is available, fka Monad.
Any special Python tricks? Just breezing through the manual, they
seemed to have borrowed from any language they wanted in making a new
scripting language.
http://tinyurl.com/l9ghj
rd
--
http://mail.python.org/mailman/listinfo/python-list
Alexis Roda wrote:
> Florian Lindner escribió:
>> I think the best solution would be to use a seperation character:
>>
>> dir="/home/florian, /home/john, home/whoever"
>
> RCS uses , in filenames
A kommata (,) is a valid character in path names. Ok, you can use quotes.
>> What do you think? An
Florian Lindner wrote:
> Hello,
> since ConfigParser does not seem to support multiple times the same option
> name, like:
>
> dir="/home/florian"
> dir="/home/john"
> dir="/home/whoever"
>
> (only the last one is read in)
>
> I wonder what the best way to work around this.
>
> I think the best
I am trying to insert "timestamp" to the Firebird database using
standard library datetime module example given in the "KInterbasDB
Usage Guide" http://tinyurl.com/mplo4 , section "Example Programs
DATE/TIME/TIMESTAMP"
Even timestamp has the correct format before inserting to the database
(2006-26
Hello,
http://docs.python.org/lib/module-ConfigParser.html writes:
"with continuations in the style of RFC 822; "
what is meant with these continuations?
Thanks,
Florian
--
http://mail.python.org/mailman/listinfo/python-list
Is there a way to assign multiple variables to the same value, but so
that an identity test still evaluates to False?
e.g.:
>>> w = x = y = z = False
>>> w
False
>>> x
False
>>> w == x
True
>>> w is x
True # not sure if this is harmful
The first line above is the only way I know to
Steve Holden wrote:
> I. Myself wrote:
>> Serge Orlov wrote:
>>
>>> I. Myself wrote:
>>>
>>>
Suppose we spawn a child process with Popen. I'm thinking of an
executable file, like a compiled C program.
Suppose it is supposed to run for one minute, but it just keeps going
and g
Florian Lindner wrote:
> Hello,
> http://docs.python.org/lib/module-ConfigParser.html writes:
>
> "with continuations in the style of RFC 822; "
>
> what is meant with these continuations?
>
> Thanks,
>
> Florian
>From ConfigParser source code:
Continuations are represented by an embedded new
I've got an API that deals with 64 bit int values. Is there
any way of handling this smoothly? Right now I'm casting
the values into and out of strings for the API.
If not, are there any nice alternatives to XML-RPC that
support this?
Many TIA!
Mark
--
Mark Harrison
Pixar Animation Studios
--
John Salerno wrote:
> Is there a way to assign multiple variables to the same value, but so
> that an identity test still evaluates to False?
>
> e.g.:
>
> >>> w = x = y = z = False
> >>> w
> False
> >>> x
> False
> >>> w == x
> True
> >>> w is x
> True # not sure if this is harmful
John Salerno wrote:
> Is there a way to assign multiple variables to the same value, but so
> that an identity test still evaluates to False?
>
> e.g.:
>
> >>> w = x = y = z = False
> >>> w
> False
> >>> x
> False
> >>> w == x
> True
> >>> w is x
> True # not sure if this is harmful
Boris Borcic wrote:
> >>> w == x
> False
> >>> w is x
> True
> >>>
That's the opposite of what I want to happen.
--
http://mail.python.org/mailman/listinfo/python-list
Diez B. Roggisch wrote:
> I can't imagine what you're actually after here, but assuming that you
> really need this
Hard to explain because I'm still trying to figure out how to do it
myself. I'm trying to solve a little puzzle using Python, even though
I'm sure it's not necessary. Basically W,
John Salerno wrote:
> Diez B. Roggisch wrote:
>
>> I can't imagine what you're actually after here, but assuming that you
>> really need this
>
> Hard to explain because I'm still trying to figure out how to do it
> myself. I'm trying to solve a little puzzle using Python, even though
> I'm sure
bruno at modulix wrote:
>> that 1) b is an object not a module*, and 2) objects pass references to
>> themselves as the first argument to their methods.
>
> Nope. It's the MethodType object (a descriptor) that wraps the function
> that do the job. The object itself is totally unaware of this.
It'
[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
Diez B. Roggisch wrote:
> Then use a Proposition-class that holds the actual value.
>
>> Another thing I'm trying to do is write a function that tests to see if
>> a list contains exactly one true item, and the rest are false (obviously
>> this would have to be a list of boolean values, I guess)
This is way above my head. :-)
The only requirement *I* would like to see is that for floats that
exactly represent ints (or longs for that matter) the result ought of
x%y ought to have the same value as the same operation on the
corresponding ints (except if the result can't be represented exactl
"John Salerno" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is there a way to assign multiple variables to the same value, but so
> that an identity test still evaluates to False?
Make sure the value is not a singleton.
Assign them one at a time.
>>> w=1000
>>> x=1000
>>> w==x
Tr
> Hmm, classes still scare me a little, but I should consider this. The
> only thing is, it is not known in advance if the propositions are true
> or false, you have to figure that out yourself based on the combination
> of the statements given. I don't know if this changes the idea behind
> your P
John Salerno wrote:
> Is there a way to assign multiple variables to the same value,
> but so
> that an identity test still evaluates to False?
re-phrase it according to how Python works, and you'll get the answer:
"Is there a way to bind multiple names to the same object, but so the
identity of
John Salerno wrote:
> Boris Borcic wrote:
>
>> >>> w == x
>> False
>> >>> w is x
>> True
>> >>>
>
>
> That's the opposite of what I want to happen.
And that wouldn't be really helpful anyway !-)
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) fo
I am trying to find a way to poll the keyboard. In my searching, I
have found that Windows users are given the msvcrt module. Is there an
equivilant for Unix systems?
I am writing a p2p chat application, and would like to ideally approach
user input in a manner similar to the way I am using poll
Steve Holden wrote:
> John Salerno wrote:
> [...]
> >
> > So if I already have files on the server and I want to change file
> > permissions, do I need to mess with TYPE A/TYPE I commands, or are
> > those strictly for when you transfer files? Because I just did a
> > quick test of changing fil
[EMAIL PROTECTED] wrote:
> I am trying to find a way to poll the keyboard. In my searching, I
> have found that Windows users are given the msvcrt module. Is there an
> equivilant for Unix systems?
>
> I am writing a p2p chat application, and would like to ideally approach
> user input in a man
Dave Hughes wrote:
> As far as I recall your speculation is indeed correct: a TYPE command
> is only necessary before a transfer (it's only used to transform data
> passing over the secondary data connection). I'm reasonably certain you
> don't need *anything* before a SITE command (like SITE CHMO
bruno at modulix wrote:
> Now if I may ask: what is your actual problem ?
Ok, since you're so curious. :)
Here's a scan of the page from the puzzle book:
http://johnjsalerno.com/spies.png
Basically I'm reading this book to give me little things to try out in
Python. There's no guarantee that t
On Sunday 30 April 2006 21:06, Serge Orlov wrote:
> Fabiano Sidler wrote:
>> Now, when I try to resize mm to 10 byte
>> --- snip ---
>> mm.resize(10)
>> --- snap ---
>> I get an EnvironmentError:[Errno 22] Invalid argument.
>
> Just a guess: try a new size argument that is multiple of page size.
N
could i make a global variable and keep track of each tag count?
Also how would i make a list or dictionary of tags that is found?
how can i handle any tag that is given?
--
http://mail.python.org/mailman/listinfo/python-list
Edward Elliott wrote:
> bruno at modulix wrote:
>
>>>that 1) b is an object not a module*, and 2) objects pass references to
>>>themselves as the first argument to their methods.
>>
>>Nope. It's the MethodType object (a descriptor) that wraps the function
>>that do the job. The object itself is to
On Tue, 02 May 2006 17:15:05 +, John Salerno wrote:
> Basically W, X, Y and Z are propositions
> that are either true or false, and the puzzle lists a few statements
> such as "Exactly one of X, Y and Z is true", and I'm trying to work out
> a little algorithm that might test for this kind o
Steve R. Hastings wrote:
> Anyway, the major point I want you to take away from all this: it doesn't
> matter whether the "is" test succeeds or fails, if all you care about is
> the *value* of a variable. Python reuses object references to save
> memory, because this doesn't affect expressions th
Mark rainess wrote:
> Hello,
>
>
> Does Python or wxPython include any support for multiple monitors. In my
> application multiple monitors are located at a distance. It is not
> convenient to move a window from the main monitor to one of the others.
> I want to have the option to open an an appl
I am using 8 computers on a small network. I have one Main computer
which should be able to remotely start other computers. I used Wake on
LAN to start them all.
My Main computer is Linux.
Other 4 are Windows and 3 are Linux.
How can I shutdown Windows box from my Main (Linux) ?
Also, How can I
On 2006-05-02, John Salerno <[EMAIL PROTECTED]> wrote:
> Yeah, after trying some crazy things, I just wrote it this way:
>
> def truth_test(seq):
> truth = 0
> for item in seq:
> if item:
> truth += 1
> if truth == 1:
> return True
> else:
>
[EMAIL PROTECTED] wrote:
> while 1:
> line = f.readline().rstrip("\n")
> if line == '':
> break
> #if not re.findall(r'^$',line):
> print line
you want continue, not break there. but that gives you an infinite loop, so
you need a new exit condition
[EMAIL PROTECTED] wrote:
> hi
> i have a file test.dat eg
>
> abcdefgh
> ijklmn
> <-newline
> opqrs
> tuvwxyz
> <---newline
>
>
> I wish to print the contents of the file such that it appears:
> abcdefgh
> ijklmn
> opqrs
> tuvwxyz
>
> here is what i did:
> f = open("test.
Grant Edwards wrote:
> Python knows how to count. :)
>
> def countFalse(seq):
> return len([v for v in seq if not v])
>
> def countTrue(seq):
> return len([v for v in seq if v])
>
> def truth_test(seq):
> return countTrue(seq) == 1
Gosh, so much to learn! Of course, I already know
Steve R. Hastings wrote:
> So, don't test to see if something is equal to True or False:
>
> if 0 == False:
> pass # never executed; False and 0 do not directly compare
of course they do - ie isinstance(False,int) is True and False == 0
>
>
> You *could* do this, but I don't really recom
1 - 100 of 221 matches
Mail list logo