Dear Tutors,
whenever I make use of the help() function, I have a good chance of
getting an error. I have not yet understood this tool very well.
Take the modules operator and random as examples. The former is
built-in, the latter not.
Do I wish to see the help files, I have to use a different sy
> -Original Message-
> From: amr...@iisermohali.ac.in [mailto:amr...@iisermohali.ac.in]
> Sent: Wednesday, July 29, 2009 12:13 AM
> To: Paul McGuire
> Cc: tutor@python.org
> Subject: Re: [Tutor] how to get blank value
>
> Thanks for help Sir but with these commands it is showing error:-
>
Thanks for help Sir but with these commands it is showing error:-
ph08...@sys53:~> python trip.py
Traceback (most recent call last):
File "trip.py", line 6, in
from pyparsing import *
ImportError: No module named pyparsing
> Ok, I've seen various passes at this problem using regex, split(
Ok, I've seen various passes at this problem using regex, split('='), etc.,
but the solutions seem fairly fragile, and the OP doesn't seem happy with
any of them. Here is how this problem looks if you were going to try
breaking it up with pyparsing:
- Each line starts with an integer, and the stri
"pja" wrote
One major problem is that the book is written for Python 2.x and I am
using Python 3.1 (and don't want to switch back).
Very few books/tutorials exist yet for v3. But you seem to be
coping with the differences adequately. My tutorial for v3 is
almost half-way complete, you might f
Hi!
I am trying to teach myself Python (using John Zelle's book "Python
Programming"). One major problem is that the book is written for Python
2.x and I am using Python 3.1 (and don't want to switch back).
There is a sample script for calculating the sum and difference of two
numbers:
#
Hi I am learning python for use in Nuke (image compositing software). I
would like to test if a file exists and receive a warning if it does.
To do a Nuke command line render, it looks something like this:
/Applications/Nuke5.1v5/Nuke5.1v5.app/Contents/MacOS/Nuke5.1v5 -iX
WriteComp '/Volumes/s
Good evening List,
I am trying to have this script search for an IP or nearest subnet
match in a dir of csv's. It works with an absolute match, It will be
receiving a whole IP address, so if there is no absolute match no data
is returned, however if it is listed somewhere in a subnet I want to
kn
> > The "answer" to each function is then used in the next function.
> > I can think of two ways to make that answer available ...
> > 1) pass it in, or
> > 2) declare it as self.answer
Thank you Alan, Kent, and Dave. Full agreement, and it makes sense
to me. (Maybe this is also an example
amr...@iisermohali.ac.in wrote:
It is not giving any value, without any error
ph08...@sys53:~> python trial.py
ph08...@sys53:~>
it is coming out from shell.
Thanks for help.
Amrita
amr...@iisermohali.ac.in wrote:
Sorry to say, but till now I have not got the solution of my problem, I
You may like to have a look @ pyparsing module.
URL: http://pyparsing.wikispaces.com/
HTH.
regards,
shantanoo
On 29-Jul-09, at 1:03 AM, amr...@iisermohali.ac.in wrote:
with these data it is giving output but when I tried
if __name__ == '__main__':
data = open('chem.txt').readlines()
for line
with these data it is giving output but when I tried
if __name__ == '__main__':
data = open('chem.txt').readlines()
for line in data:
line2 = line.split('=')
if not line2[5]: # C value missing
if len(line2[2]) <= 5 and len(line2[3]) <= 5: # N and CA values
missing
On Tue, 2009-07-28 at 19:03 +0100, Alan Gauld wrote:
> There is no simpler solution without changing the class.
> If you can do that you could pass the container to the constructor
> and get the class to add itself to the container
Kent, Alan...
thank you very much, indeed I finally
"shawn bright" wrote
So, my question is, how can i write something that will know if there
is an instance of that something already running?
I am doing this in python 2.5 on Ubuntu, if that matters ( which i
suspect it does ).
I suspect the simplest way is to use the ps command and grep.
W
"Mac Ryan" wrote
above function. In fact, as I have the need to access the object both
individually and with the dispatcher, I am doing something like this
every time I instantiate a new object:
mycontent = ContentA()
contents.append(mycontent)
...but although I "feel" this is silly, I
wrote
Sorry to say, but till now I have not got the solution of my problem, I
tried with this command:-
import re
if __name__ == '__main__':
data = open('chem.txt').readlines()
for line in data:
RE = re.compile('C = (.)',re.M)
The regex still does not match the end of line.
On Tue, Jul 28, 2009 at 1:22 PM, Mac Ryan wrote:
> def invokeAll(method, data):
> """This function is a dispatcher: it invokes all the content types
> of the application calling 'contenttype.method(data)'"""
> return [getattr(content, method)(data) for content in contents]
In Python 2.6
Hey all, i used the popen with getpid() option.
working well so far, thanks to all of you.
shawn
On Tue, Jul 28, 2009 at 12:11 PM, Mac Ryan wrote:
> I am not an expert, but if I got you correctly, what you want to achieve
> is a "singleton": http://en.wikipedia.org/wiki/Singleton_pattern if you
>
Hello,
I'm working on an application in which I need the main loop to call the
same method on a number of objects. I came up with this solution that
seem to work, but I was wondering if there is a better / more pythonic
solution to the problem.
def invokeAll(method, data):
"""This fu
amr...@iisermohali.ac.in wrote:
It is not giving any value, without any error
ph08...@sys53:~> python trial.py
ph08...@sys53:~>
it is coming out from shell.
Try this. I embedded the test data to simplify testing:
data = """48 ALA H = 8.33 N = 120.77 CA = 55.18 HA = 4.12 C = 181.50
104 ALA H
I am not an expert, but if I got you correctly, what you want to achieve
is a "singleton": http://en.wikipedia.org/wiki/Singleton_pattern if you
watch at the sample implementation, there is a Python example too.
Mac.
On Tue, 2009-07-28 at 10:45 -0500, shawn bright wrote:
> Hey all,
>
> I have an
On Tuesday 28 July 2009 10:45, shawn bright wrote:
> Hey all,
>
> I have an app that runs in a GUI written in pygtk. It spawns several
> threads, and runs all the time.
> It is mission critical that we can never have two instances of this
> running at once.
>
> So, my question is, how can i write s
It is not giving any value, without any error
ph08...@sys53:~> python trial.py
ph08...@sys53:~>
it is coming out from shell.
Thanks for help.
Amrita
> amr...@iisermohali.ac.in wrote:
>> Sorry to say, but till now I have not got the solution of my problem, I
>> tried with this command:-
>>
>> imp
Thanks for the pointers Wayne, Tino,
Looks easier than i had thought.
sk
On Tue, Jul 28, 2009 at 11:10 AM, Tino Dai wrote:
> On Tue, Jul 28, 2009 at 11:45 AM, shawn bright wrote:
>>
>> So, my question is, how can i write something that will know if there
>> is an instance of that something alread
Hey all,
I have an app that runs in a GUI written in pygtk. It spawns several
threads, and runs all the time.
It is mission critical that we can never have two instances of this
running at once.
So, my question is, how can i write something that will know if there
is an instance of that something
welcome to Tutor:)
On Tue, Jul 28, 2009 at 8:18 PM, Eduardo Vieira wrote:
> Hello, this is just a test. I have posted 2 different messages and
> they have never reached this list.
>
> Eduardo
> ___
> Tutor maillist - Tutor@python.org
> http://mail
By default django looks for a file called *tests.py*(plural) and not *
test.py*. Check that and let us know.
Regards,
Nandakishore
On Tue, Jul 28, 2009 at 6:40 PM, VIJAY KUMAR wrote:
> Hi,
>
>I am running testcase from django when I run them from models.py it
> run.
>
>But when I put t
Hello, this is just a test. I have posted 2 different messages and
they have never reached this list.
Eduardo
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
amr...@iisermohali.ac.in wrote:
Sorry to say, but till now I have not got the solution of my problem, I
tried with this command:-
import re
# assuming H = , N = , CA = , HA = and C = always present in that order
if __name__ == '__main__':
data = open('chem.txt').readlines()
for line in d
Sorry to say, but till now I have not got the solution of my problem, I
tried with this command:-
import re
if __name__ == '__main__':
data = open('chem.txt').readlines()
for line in data:
RE = re.compile('C = (.)',re.M)
matches = RE.findall(line)
for m in mat
Hi,
I am running testcase from django when I run them from models.py it run.
But when I put the same in test.py in the same directory where models is
define it not even getting called.
My structure django application is mysite
Settings.py
Urls.py
Polls
On Tue, Jul 28, 2009 at 02:20, Dave Angel wrote:
> Dick Moores wrote:
>>
>>
>> I'm not sure how to edit it. What's required for Ulipad is quite
>> different, I believe.
>>
>> This is what I got from Dave Angel:
>> e:
>> cd \Python26\Lib\idlelib\
>> ..\..\pythonw.exe idle.pyw %*
>>
>> And I can't
Che M wrote:
This is another very basic structural question, related to one I asked last
week, and again is not necessarily germane only to Python.
Let's say you have a sequence of two calculations or manipulations you need to do, each
one done as a function called by an overall calculate_some
Ryan V wrote:
For this source code, i am getting some errors, and not sure how to fix it,
as i am returning all the values. it is telling me that there is no value
for the variables i am returning. any help is greatly appreciated!
Source
#main function
def main():
print 'The menu is:'
pr
Dick Moores wrote:
I'm not sure how to edit it. What's required for Ulipad is quite
different, I believe.
This is what I got from Dave Angel:
e:
cd \Python26\Lib\idlelib\
..\..\pythonw.exe idle.pyw %*
And I can't decipher it. What is the "..\..\"?
Just ask.The double-dots are the
"Che M" wrote
Let's say you have a sequence of two calculations ...each one
done as a function called by an overall calculate_something() function.
The "answer" to each function is then used in the next function.
I can think of two ways to make that answer available ...
1) pass it in, or
"Ryan V" wrote
as i am returning all the values. it is telling me that there is no value
for the variables i am returning. any help is greatly appreciated!
You are returning the values to variables in the main function.
But in Python variables inside functions (aka local variables) are
only
37 matches
Mail list logo