Tom wrote:
I have a webfaction server (highly recommended btw) and I'm trying to
use automate some tasks over ssh but I'm not having much luck with
pyssh http://pyssh.sourceforge.net/ .
Some of the docs mention methods that don't exist in the version I
downloaded, such as pyssh.run.
I'm
Alan Gauld wrote:
"bob gailer" [EMAIL PROTECTED] wrote
i don't really understand that. you are trying to say that the
tests
from the online judge are not "exactly good" ?
Yes that's exactly what I'm saying. At least one test case has a
non-decimal
Eric Walstad wrote:
Eric Brunson wrote:
Tom wrote:
I have a webfaction server (highly recommended btw) and I'm trying to
use automate some tasks over ssh but I'm not having much luck with
pyssh http://pyssh.sourceforge.net/ .
Some of the docs mention methods
Alan Gauld wrote:
Eric Brunson [EMAIL PROTECTED] wrote
Alan Gauld wrote:
Glad we both noted the smileys. :-)
However, there is a bit of a serious point here too in that
users never ask for data validation (at least mine never do!)
they just expect it. So I still maintain that any
bhaaluu wrote:
What is the equivalent of JUnit in Python? The article says that JUnit is
used for unit tests, or you can write your own. Since I don't have a clue,
writing my own is probably out the question. Also I'm not familiar with
Java, and am just learning Python OOP, so I'm not getting
Greg Lindstrom wrote:
Hello,
I'm trying to help out a friend and am stumped. Can you help me out?
Thanks,
--greg
Hi Greg,
I fought with this for a long, long time when I was trying to get
cx_Oracle to work with the latest Oracle Instant Client (which I like to
call Oracle Instant Crap)
Aditya Lal wrote:
On 04/02/08 10:42 PM, Eric Brunson [EMAIL PROTECTED] wrote:
dave selby wrote:
Hi all,
I am not sure if this is a Python or bash issue :).
In bash if I execute 'motion' with the following ...
[EMAIL PROTECTED]:~/.kde/share/apps/kmotion$ motion /dev/null
[1
Dotan Cohen wrote:
On 03/02/2008, Kent Johnson [EMAIL PROTECTED] wrote:
I did a little research on the question of running the same script
unmodified in Python 2.6 and 3.0. It seems that there is no consensus
opinion and it may depend on your personal tolerance for compatibility
cruft.
dave selby wrote:
Hi all,
I am not sure if this is a Python or bash issue :).
In bash if I execute 'motion' with the following ...
[EMAIL PROTECTED]:~/.kde/share/apps/kmotion$ motion /dev/null
[1] 10734
[EMAIL PROTECTED]:~/.kde/share/apps/kmotion$
I get what I expect, a background
Michael Langford wrote:
OT Aside:
Anyone ever used PSP pages? Seems like a good substitute for PHPish
tasks, but I've not seen many users.
I have, but I find generating my HTML with classes I wrote to be more to
my tastes. I did PHP for years and I'm just not a fan of the way it
mixes
I think the page is a little busy, but relatively clean overall. I
don't like the popup that makes me interact with the page when I load it.
Is that what you were looking for or would you like to be a little more
specific?
pee one wrote:
Please comment on
washakie wrote:
Hello, I'm trying to write a script which will allow me to create a reverse
tunnel from a remote machine using SSH -R
I know the reverse tunnel script works on it's own run from the shell, but I
don't want to leave it open always... does anyone have any ideas on how to
make
Ole Jensen wrote:
Hi
I made a small python program at home and tried to send by email
attachments to my studymates.
The attachment however shows up as a strange text
the first lines look like this:
M1F]R_AG(#(@+2 R(=E;F5R871OF5R([EMAIL PROTECTED]R#0H@5!I[EMAIL
PROTECTED])4!O
There is at least on client library that the mysql package needs to link
against. You either need to install the libraries on the client machine
or else build the package statically linked on the server machine and
move it over prebuilt.
John wrote:
Hello,
Does anyone know how to
Did you read the entire discussion at
http://www.ibiblio.org/g2swap/byteofpython/read/local-variables.html?
What did you understand and not understand?
Sincerely,
e.
bill.wu wrote:
i am new guy.
i ask a easy question.
why the first one havex,the second one doesn't have x. what is
Olivier Lefevre wrote:
Are you talking about the prompt?
Yes.
But if you refer to a loop when would you ever be evaluating
expressions inside a loop without assigning them?
Some method calls return a value that you may not be interested
in but which will still be
Olivier Lefevre wrote:
Then assign the return value to a variable and never use it.
That feels obfuscated; definitely not an elegant solution.
When I'm done with interactive development and save the
substance to a script I'd have to chase these bogus
assignments to junk variables and
Allen Fowler wrote:
Thank you for all the great tips... I'll try a few and see what works.
I must say that I'm a bit surprised that the Python Std library does not have
a module for this. Are all python scripts expected to be small user-mode
utilities?
I really agree with you on that.
Tim's pretty spot on in his ruminations below, I just wanted to add a
few comments. Read inline.
Tim Golden wrote:
Tim Michelsen wrote:
I have a mbox file locally on my notebook.
I would like to send this file to my IMAP account using python.
Ummm. There seem to be two possible
doug shawhan wrote:
*sigh* Ignore folks. I had forgotten about .has_key().
Actually, you don't even need that, simply write:
if record[0] in dict:
# Do your thing.
But don't use dict as a variable name, it's a builtin function name.
On Dec 28, 2007 11:22 AM, doug shawhan [EMAIL
lechtlr wrote:
Hi there,
I would like to know what is the best way to create a string object
from two different lists using 'join' function. For example, I have X
= ['a', 'b', 'c', 'd', 'e'] and Y = [1, 2, 3, 4, 5]. From X and Y, I
want to create a string Z = 'a:1, b:2, c:3, d:4, e:5'.
Jim Morcombe wrote:
Below, student_seats is a list of the class student.
Why does this code set every student.row to zero when there is only one
student in the list with row 5?
It still sets them all to zero if I change the test to 200 when there are
no student.rows 200.
But if I change
Bryan Fodness wrote:
I am trying to parse a DICOMRT file, which is a radiation therapy
DICOM file.
I'm a little late to the party, but you may want to take a look at this:
http://mypage.iu.edu/~mmiller3/python/#dycom
First, I get different outputs from the two methods below.
for
Hi Amit,
This is fairly inefficient. Because strings in python are immutable
this approach causes a new string to be created every iteration. While
it may not be an issue with just 3 strings, it is much better to create
your list and use .join() to create the concatenation after the list
earlylight publishing wrote:
Is it tuh-ple (rhymes with supple)
or is it two-ple (rhymes with nothing that I can think of)?
As a mathematician, I've always heard it pronounced toople, even
though when you put a prefix on it (quintuple, sextuple, octuple) it
becomes tuhple. We're
Yes, import sys, then sys.stdout.flush() when you need it.
Ricardo Aráoz wrote:
Hi, I have this code :
import time
L = [i for i in xrange(20)]
for n, i in enumerate(L) :
if n%3 == 0 and n 0 :
print 'waiting 3 seconds'
time.sleep(3)
print i
I'm using Py 2.51
Alan Gauld wrote:
Eric Brunson [EMAIL PROTECTED] wrote
Yes, import sys, then sys.stdout.flush() when you need it.
This was my initial idea but it doesn't work in the IDE because
it is not really using sys.stdout. In fact the normal print works
fine from the command prompt
Andre Walker-Loud wrote:
Hi there,
Hi Andre,
First of all, please don't start a new thread by replying to an existing
thread, RFC compliant email readers will thread your post along with the
original posting based on headers other than the Subject. :-)
I don't think you'll ever get
Mahesh N wrote:
I dun understand the mistake. My aim is to accept an integer number.
The python lookup in IDLE asks for a string object but the interpreter
returns with the following error message. Some one pls explain.
Thank You
PS : I understand that i can do type conversion after
Ricardo Aráoz wrote:
Danny Yoo wrote:
Hello:
I'm seeing some strange behavior with lstrip operating
on string representations of *nix-style file paths
Example:
s = '/home/test/'
s1 = s.lstrip('/home')
s1
'test/' ## '/test/' was expected! '/' was unexpectedly
Tim Johnson wrote:
Hello:
I'm seeing some strange behavior with lstrip operating
on string representations of *nix-style file paths
Example:
s = '/home/test/'
s1 = s.lstrip('/home')
s1
'test/' ## '/test/' was expected! '/' was unexpectedly removed
Hi Tim,
I believe
Tiago Saboga wrote:
First, I just noticed I sent a non-working version of the code. The line
print (The same if Aux.mystring==Aux.mystring2 else Different)
should be
print (The same if Aux.mystring==Aux.compare else Different)
Sorry for that.
This comboboxsegfault.py doesn't seem to
Kent Johnson wrote:
Don Taylor wrote:
Alan Gauld wrote:
What are you using for the XML-RPC server? Doesn't that need to be a
web server of some sort anyhow? XML-RPC communicates using http...
I am using simpleXMLRPCServer. Yes, XML-RPC does use http as its
transport
Don Taylor wrote:
Eric Brunson wrote:
Definitely, or even just CGIHTTPServer.
No, I don't think so. I am not a RESTafarian. :-)
Forgive my inexperience with the SimpleXMLRPCServer, but I didn't think
it provided state any more than any other connection oriented server
dave selby wrote:
Is there a way for a Python script to intercept a HUP signal sent to it ?
Cheers
Dave
Yes, using a signal handler:
http://docs.python.org/lib/module-signal.html
Let us know if you need clarification on anything after you read the
section.
I can't get the python 2.5.1 logging module to use your logging.conf,
can you create a simpler example?
dave selby wrote:
I am trying to use the python logging module. At first glance it looks
pretty complicated but having Ggooled a lot I have come up with a
trial script of ...
Kent Johnson wrote:
dave selby wrote:
I was trying to get logging to report to Syslog, that failed so I
changed it to write to a file 'python.log' . When I execute my test
script 'python.log' appears but contains no messages and no error
messages are generated.
Anybody any ideas as to
I'm sorry, but a Reuben with no 'kraut is just a corned beef sandwich. :-)
Marc Tompkins wrote:
And here's another reason to use new-style: I forgot the sauerkraut!
Oh, the horror!
On Nov 15, 2007 1:42 PM, Marc Tompkins [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
I thought
Kent Johnson wrote:
Dinesh B Vadhia [EMAIL PROTECTED] wrote:
Consider a data structure (say, an array) that is operated on by a bunch of
functions
The described way is to place the statement 'global' in line 1 of each
function. On the other hand, wiser heads say that the use of
Trey Keown wrote:
Hey all...
I'm creating a module for my program, and I need to call a function.
Here's how it's set up:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
class DoStuff:
def Thing1(self):
def ThingToCall(self):
print It worked!
def
Marc Tompkins wrote:
This question has probably been asked and answered many times, but I
can't figure out how to word my question to get relevant results from
Google. So I thought I'd try some human beings, eh?
I'm working with delimited files (ANSI X12 EDI nonsense, to be
precise.)
Kent Johnson wrote:
Marc Tompkins wrote:
I'm working with delimited files (ANSI X12 EDI nonsense, to be
precise.) First I load the records to a list:
tmpSegs = inString.split(self.SegTerm)
Now, I want to replace each string in that list with a string:
for seg in
John Fouhy wrote:
On 08/11/2007, Marc Tompkins [EMAIL PROTECTED] wrote:
Now, I did already (intellectually) understand this:
A list is an array of pointers to objects, what you've done here is
create a new name referencing an item in the list, then making that new
name point to
Michael H. Goldwasser wrote:
Thanks to the many voices supporting our decision to post to Tutor.
We only posted to the most directly relevant mailing lists (announce,
tutor, edusig). As an introductory book, it seemed quite appropriate
for tutor.
In fact, the topic of our (developing) book
Ricardo Aráoz wrote:
Kent Johnson wrote:
I am building a list like this:
tree = []
for top in tops:
l2 = level2(top)
if l2:
tree.append((top, l2))
I would really like to turn this into a list comprehension:
tree = [ (top, level2(top)) for
jay wrote:
Hello,
If I have multiple Popen calls I need to make, how can I turn these
into a function?
Since you're only interested in the output of the last command on the
pipeline, I don't see a reason to keep track of them all. I'd do
something like this:
def pipeline( *commandlist ):
Orest Kozyar wrote:
Please post the entire traceback (omitting duplicate lines).
Sorry, I should have included the traceback. I've revised the sample script
so that it generates the traceback when run. The sample script is at the
very bottom of this email.
### SCRIPT OUTPUT
Orest Kozyar wrote:
Please post the entire traceback (omitting duplicate lines).
Sorry, I should have included the traceback. I've revised the sample script
so that it generates the traceback when run. The sample script is at the
very bottom of this email.
It appears you have a
Dick Moores wrote:
At 05:03 AM 10/29/2007, bhaaluu wrote:
On 10/29/07, Dick Moores [EMAIL PROTECTED] wrote:
Seems I should clarify that. I'm not looking for a script that echoes
the key pressed. So I'll change that last line to Could you show a
script using it that, say, prints
Dick Moores wrote:
At 07:54 AM 10/29/2007, Eric Brunson wrote:
Dick Moores wrote:
At 05:03 AM 10/29/2007, bhaaluu wrote:
On 10/29/07, Dick Moores [EMAIL PROTECTED] wrote:
Seems I should clarify that. I'm not looking for a script that echoes
the key pressed. So
John wrote:
No, mostly just playing around with scripting and I have a problem
sometimes with cygwin where logging out from bash session
Hi John,
This is a known bug. The fix is to install a real operating system.
For more info, please see one of the following:
http://distrowatch.com
Bryan Fodness wrote:
Is there a built-in function that will round to the nearest 0.5?
Not that I know of, but round( 2 * n ) / 2 will give you what you're
looking for.
___
bob gailer wrote:
Alex Ezell wrote:
I am working on building a SOAP client. Unfortunately, one of the
methods the SOAP server provides is named import. The SOAP server is
written in PHP.
So, my problem is that Python really doesn't like me using the word
import to call the SOAP method.
linda.s wrote:
How can I know where a function such as abc is from (from which module)?
abc
built-in function abc
You could:
1. look it up in the index of the library reference
(http://www.python.org/doc/current/lib/genindex.html),
2. try pydoc,
3. examine
That's funny. Knowing Alan is from the UK, when I saw Kent was from
Manchester I thought he was Alan's countrymate.
You know the British (at least my cousins) make fun of us for always
having to say our state. Paris, Texas, Boston, Mass, Tampa, FL.
But, we just have so many more towns,
Martin Walsh wrote:
Eric Brunson wrote:
I'm coming in late to the discussion and thought that someone would
explain it succinctly, but there have been so many correct statements
which I feel fail to nail down the problem that I thought I'd chime in.
Hi Eric,
Thank you for your
Kent Johnson wrote:
Ismael Farfán Estrada wrote:
Hi there.
I have a small system in production with wxPython and PostgreSQL running on
a machine with Centos 5.
At first everytihing was running ok but now a weird bug was discovered:
they can't insert characters like á é í ó ú ä ë ñ
Why not find the sign, calculate the binary of the absolute value, then
make the result negative (twos complement) if necessary?
Just a thought.
[EMAIL PROTECTED] wrote:
Hi,
I'm trying to get this binary converter working, but I can't seem to get the
negatives to work properly. If the
So far I've gotten five copies of this. It could be mailman doing
something wrong, but if you're resending because you don't see your
reply, please be patient, this list is not always instantaneous.
I think you're missing the gist of what I'm saying. Calculate the
binary of the absolute.
No worries. I said it could be mailman, and apparently it was. :-)
[EMAIL PROTECTED] wrote:
Hi,
I also got this email five times, and several rejection emails from the
moderator. I'm very sorry for this, but I swear I only sent the email once.
If this Apology email is also sent multiple
Martin Walsh wrote:
Michael Langford wrote:
This signal is not something you care about. All SIGPIPE means is that
the source of the signal found itself writing to a pipe with no sender.
Your line signal.signal(signal.SIGPIPE, signal.SIG_DFL) means use the
default signal handler for
You know, Alan, I remember you commenting that you had some flakey
behavior from this list a few of weeks ago, then
over the weekend I received about two dozen emails from threads as far
back as August.
Something is definitely wonky (technical term ;-) about this list server.
Alan Gauld
I'm coming in late to the discussion and thought that someone would
explain it succinctly, but there have been so many correct statements
which I feel fail to nail down the problem that I thought I'd chime in.
Here's the important concepts to understand. The pipe is a construct of
the shell,
Bryan Fodness wrote:
The data file is larger than shown, and I was wondering if it would be
better to populate an array or create a dictionary. Which would be
easier?
A dictionary is an array with an index, if you need an index into your
data, use a dictionary, if not use an array.
Allen Fowler wrote:
I seem to be having an issue with __getattr__() being called even if
the proporite already exists... I thought that this was not supposed
to happen.
I think you've misunderstood. __getattr__() should always be called, it
allows you to intercept and reimplement the
Allen Fowler wrote:
*/Eric Brunson [EMAIL PROTECTED]/* wrote:
Allen Fowler wrote:
I seem to be having an issue with __getattr__() being called
even if
the proporite already exists... I thought that this was not
supposed
to happen.
I think you've
I used to run an old linux laptop with two NICs as my firewall, but I
played a bit with DD-WRT and now I'm an evangelist.
DD-WRT is based on an embedded Linux kernel and provides a great set of
features, including time based filters, web GUI, ssh access and a real
unix command line as well
Alan Gauld wrote:
shawn bright [EMAIL PROTECTED] wrote
messenger (gaim) all night if i didn't. i have a cron script that
checks the
hour of day, if later than x pm. does
os.system(/etc/init.d/network stop)
os.system(chmod a-x /etc/init.d/network) ( so that a reboot
doesn't
override
Øyvind wrote:
Hello.
I have written a simple application that does a number of simple
calculations. In psudo-code it looks something like below.
The program works fine. However, it seems like I need a supercomputer to
finish the resultwithin a reasonable timeframe, as the var.txt contains a
Kent Johnson wrote:
Eric Brunson wrote:
claxo wrote:
dont indent the line after '\', that means 0 indent
s = 'hello\
boy'
Or, arguably better:
s = '''hello
boy'''
That is a different string, it contains a newline, the original does not:
In [20]: s = 'hello
wormwood_3 wrote:
Thanks to everyone who responded for the information and tips.
* That line I had:
for line in inputlist:
updatequery = update resultstable set fqdn = line.split(,)[1]
where ip = line.split(,)[0];
was totally bogus. I was typing and thinking, and not
David Millar wrote:
Hi everyone,
I'm working on making a Debian package for a game I'm working on, and
it works fine, but I've run into a problem with my script now. The
script is placed in /usr/bin so all users on the system have access,
but even though it will run fine, I can't save
Happy Deer wrote:
Thank all for the discussion.
Maybe I can separate my question into two.
First, I have experience in Matlab, where I can use eval. I wonder
whether someone knows about it.
Second, if I just want to return data[:,1], ...data[:,-1] separately
without knowing ahead how
]
What do you expect data[:,1] and data[:,-1] to return?
On 10/7/07, *Eric Brunson* [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
Happy Deer wrote:
Thank all for the discussion.
Maybe I can separate my question into two.
First, I have experience in Matlab, where
A good python coder would probably not choose to pollute his name space
like that. My choice would be to assign the elements of data to a
dictionary indexed by the strings in varlist like this:
vardict = dict( zip( varlist, data ) )
and reference var1 as:
vardict['var1']
Happy Deer wrote:
claxo wrote:
dont indent the line after '\', that means 0 indent
s = 'hello\
boy'
Or, arguably better:
s = '''hello
boy'''
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
to think in Python
rather than thinking in Matlab and transliterating.
Eric Brunson wrote:
A good python coder would probably not choose to pollute his name space
like that. My choice would be to assign the elements of data to a
dictionary indexed by the strings in varlist like this:
vardict
Or, if you're on a real operating system (i.e. linix) you can type man
ascii. ;-)
bhaaluu wrote:
Here's a handy reference file for ASCII.
(See attached file)
___
Tutor
What is that, Perl? ;-)
[EMAIL PROTECTED] wrote:
Äú·¢¸øÎÒµÄÐżþÒѾÊÕµ½¡£
ÍøÒ×163ÓÊÏä--ÖÐÎÄÓÊÏäµÚһƷÅÆ£¬2000Õ׳¬´ó¿Õ¼ä£¬Ö§³Ö³¬´ó¸½¼þ£¬È«¹úΨһ24Сʱ¿Í»§·þÎñ¡£
»¶ÓÄúÀ´×¢²áʹÓá£ÍøÒ×ÓʼþÖÐÐÄ£ºhttp://mail.163.com
Elaine wrote:
Does anyone know which is the more efficient way of
finding a square root in Python:
sqrt(x) or x ** 0.5
I dunno, let's check:
import timeit
t = timeit.Timer( 12 ** .5 )
print t.timeit(1000)
2.29147315025
t = timeit.Timer( sqrt(12), from math
Fangwen Lu wrote:
Dear all-
I am a new-comer to [EMAIL PROTECTED] I guess a lot of my future
questions may have been asked by others already.
As I am a new-comer, I don't have the previous emails.
I wonder whether there is a way for searching for previous questions
and answers so that
Alan Gauld wrote:
Eric Brunson [EMAIL PROTECTED] wrote
import timeit
t = timeit.Timer( 12 ** .5 )
print t.timeit(1000)
2.29147315025
t = timeit.Timer( sqrt(12), from math import sqrt )
print t.timeit(1000)
7.17679214478
Looks like ** is about
Alan Gauld wrote:
Suzanne Peel [EMAIL PROTECTED] wrote
However both suggestions will only give me that name of the 1st file
executed eg when I use execfile('EA_Owner.py') the name returned
when
the __file__ or sys.argv[0] is executed always EA_Owner.py .
You didn't mention you
Christopher Spears wrote:
I'm trying to write a script that detects if a string
is palindromic (same backward as it is forward). This
is what I have so far:
#!/usr/bin/env python
my_str = raw_input(Enter a string: )
string_list = []
for s in my_str:
string_list.append(s)
Fangwen Lu wrote:
Dear all-
Let a=(3,4,7), b=[3,4,7].
If I type
print '%d + %d = %d' %(a)
I get
3 + 4 = 7
But if I type print '%d + %d = %d' %(b), I get errors.
If there is a way for doing this kind of type dirrectly from array.
No, but it's trivial to convert an array to a
Fangwen Lu wrote:
Dear all-
I want to do some loops. Each loop will generate a tuple. Eventually I
want to put tuples together in a higher level of tuple. Do you know
how to do this?
Say a=(1,2,3), b=(4,3,2),c=(9,5,6). I want to get a tuple as ((1,2,3),
(4,3,2),(9,5,6)).
If
Fangwen Lu wrote:
Dear all-
If I have an array array([1, 2, 3, 4, 5, 6]), and I want to get
((1,2),(3,4),(5,6)). What should I do?
First, you read some documentation and tutorials on the language, then
you iterate over the list and build tuples out of the elements.
Thank you!
Boykie Mackay wrote:
Ok,I have learnt how to generate prime numbers and how to 'split'
input.The above was to help me solve the second 'SPOJ'
challenge,PRIME1.The challenge can be found at
https://www.spoj.pl/problems/classical/sort=0,start=0
I have written my solution and tested it and it
There are quite a few ways to do what you want. Here's are a few
variations on a theme:
try:
if not any( ( len(queuePacket['procSeq']),
len(queuePacket['opacSeq']),
len(queuePacket['keySeq']) ) ):
# Do your stuff here
do_stuff()
except
t = timeit.Timer( '1000%2')
t.timeit(100)
0.25893402099609375
t = timeit.Timer( '10001')
t.timeit(100)
0.2567589282989502
It's almost insignificantly faster.
However as a programmer and a mathematician, I disagree with your
position that the bitwise operation is more or less
James wrote:
Thanks for the quick reply.
Interesting. I'm a little overwhelmed with the different terminology
(fork, spawn, thread, etc.). I'm under the impression that I'm
supposed to use os.fork() or os.spawn() for something like what I'm
trying to do (start multiple instances of
()
Traceback (most recent call last):
File stdin, line 1, in module
AttributeError: A instance has no attribute 'method3'
When you derive a subclass from another class all methods of the parent
class are available
Is that clear?
On 9/13/07, *Eric Brunson* [EMAIL PROTECTED]
mailto:[EMAIL
That is not the expected behavior and not the behavior I see:
Python 2.5.1 (r251:54863, May 1 2007, 13:27:01) [C] on sunos5
z = [[1,2],[3,4]]
z[0][0]=100
print z
[[100, 2], [3, 4]]
[EMAIL PROTECTED] wrote:
I'm having a problem assigning numbers to a 2-D list.
for the 2d list z for
Lamonte Harris wrote:
Okay
class A:
def __init__(self,x,y):
self.x = x
self.y = y
def save(self,fn):
f = open(fn,w)
f.write(str(self.x)+ '\n')
# convert to a string and add newline
f.write(str(self.y)+'\n')
return f # for child objects
The first is how I would code it. Python guarantees that compound
boolean statements are processed from left to right and also that the
AND operator will short circuit the rest of the evaluation, since the
rest of the line cannot change the falseness of the entire statement.
Orest Kozyar
ALAN GAULD wrote:
Forwarding to the list
NB Use Reply-All when replying to the tutor list.
Alan G.
- Forwarded Message
From: Ryan [EMAIL PROTECTED]
To: Alan Gauld [EMAIL PROTECTED]
Sent: Tuesday, 11 September, 2007 5:32:33 AM
Subject: Re: [Tutor] Apache, CGI-BIN, Python
Eric Brunson wrote:
ALAN GAULD wrote:
Forwarding to the list
NB Use Reply-All when replying to the tutor list.
Alan G.
- Forwarded Message
From: Ryan [EMAIL PROTECTED]
To: Alan Gauld [EMAIL PROTECTED]
Sent: Tuesday, 11 September, 2007 5:32:33 AM
Subject: Re: [Tutor
sacha rook wrote:
Hi I wonder if anyone can help with the following
I am trying to read a html page extract only fully qualified hostnames
from the page and output these hostnames to a file on disk to be used
later as input to another program.
I have this so far
import urllib2
Just my opinion, but I didn't mind the attachments, I felt they added
quite a bit to the discussion and I certainly appreciated the input on
the application of the libraries.
My opinion on your tone, I'll keep to myself.
Dave Kuhlman wrote:
On Wed, Sep 12, 2007 at 01:57:35AM +0200, Eike Welk
When you get done with this math problem you should consider a book on
punctuation. Not using it makes your sentences run together and
difficult to read. :-) Honestly, I just gave up after the first two lines.
max baseman wrote:
haha :) yeah it's the new imp stuff i like parts of the idea but
1 - 100 of 177 matches
Mail list logo