I am writing a program (code included) and I would like to comment out
the two top-level loops and run the code that is under it regularly,
however, because the following code is not indented properly the
interpreter chokes. Is there a way around this?
#!/usr/bin/env python
import string, sys, os
#for i in range(0,3):
# for j in range(0,3):
# filePrefix = '%d_%d' % (i,j)
# filePrefix = sys.argv[1]
print 'Run getQ'
os.system('~/Programs/KineticEnsemble/GetQMod/getq.exe
/home/reza/Proteins/2ci2/2CI2.contacts ' + filePrefix + '/md\crd 1 100
1.2 ' + filePrefix + '/q.out')
print 'Analyze getQ results'
file=open(filePrefix + '/q.out','r')
fold=0.
ufold=0.
isOpen=1
#numRuns=0
for line in file.readlines():
if line != '#NEWFILE\n':
# if open:
# numRuns += 1
if string.atof(line[:-1]) < 0.15 and isOpen:
isOpen = 0
ufold+=1.
elif string.atof(line[:-1]) > 0.85 and isOpen:
isOpen = 0
fold+=1.
else:
# print numRuns
# numRuns = 0
isOpen = 1
file.close()
print filePrefix
print '\tpFold: %f' % ( fold/(ufold+fold))
print '\tfold: %d ufold: %d' % (fold,ufold) 2 1658
Stefan wrote: I am writing a program (code included) and I would like to comment out the two top-level loops and run the code that is under it regularly, however, because the following code is not indented properly the interpreter chokes. Is there a way around this?
either follow Camerons suggestion :-) or:
for x in (1,2,3):
for y in (4,5,6):
print 'Run it'
change to:
if """
for x in (1,2,3):
for y in (4,5,6):
""":
print 'Run it'
But very likely there are other and probably better solutions.
Karl
Stefan wrote: #!/usr/bin/env python
import string, sys, os
#for i in range(0,3): # for j in range(0,3):
# filePrefix = '%d_%d' % (i,j) # filePrefix = sys.argv[1]
You can do:
if True:
if True:
# code here
Gerrit.
--
192. If a son of a paramour or a prostitute say to his adoptive father
or mother: "You are not my father, or my mother," his tongue shall be cut
off.
-- 1780 BC, Hammurabi, Code of Law
--
Asperger Syndroom - een persoonlijke benadering: http://people.nl.linux.org/~gerrit/
Kom in verzet tegen dit kabinet: http://www.sp.nl/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: David MacQuigg |
last post by:
Playing with Prothon today, I am fascinated by the idea of eliminating
classes in Python. I'm trying to figure out what fundamental benefit
there is to having classes. Is all this complexity...
|
by: Ataru Morooka |
last post by:
Hello, I am renewing a website using CSS and I have some problems with
IE6.
Following this link:
http://www.ansv.it/templates/Template_Index_IT.dwt.asp
you may notice that the container area has...
|
by: Mason A. Clark |
last post by:
How was I to know that "top" means "top" in MSIE6 ??
I was testing <a name="top"></a> at the top of the page
with <a href="#top>go to top</a> at the bottom of the page.
It always worked in...
|
by: Mason A. Clark |
last post by:
LAST WORD(s):
1. MSIE6 and Firefox will go to the top of the page on
command <a href="#top">go upsy</a> even if
there is NO name="top" or id="top"
They know what a "top" is :-)
Opera...
|
by: BACON |
last post by:
I'm just starting the process of reorganising my modest little website
and cleaning up all the HTML, and the logical place to begin was with
the homepage. I made a simple little ASP.NET control...
|
by: BACON |
last post by:
I'm just starting the process of reorganising my modest little website
and cleaning up all the HTML, and the logical place to begin was with
the homepage. I made a simple little ASP.NET control...
|
by: Antoon Pardon |
last post by:
I know this PEP is rejected. However I have a problem that
would benefit from having extreme values and the sample
implementation that is given in the PEP is unsatifactory
for my purpose.
I had...
|
by: levilarsen |
last post by:
Hi, thanks for reading this post. I have a web page that displays fine in IE but in Firefox and Safari there is a space at the top of the web page. It is as if the whole page is pushed down, like...
|
by: Samuel Rhodes |
last post by:
Hi
I am trying to write a code snippet that would display a '?' sign on the top
left of a control.
I do not want to hard code the positioning of the DIV which will contain
that '?'.
Is it...
|
by: noe1818 via AccessMonster.com |
last post by:
Can anyone tell my why this isn't working?
Me!.top=(1440/2.54)*16.78-*0.4)
I want it so that for every 1 change in , a rectangular box
moves 0.4 units closer to the top.
The 1440/2.54...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |