Flash Website Builder- Trendy Site Builder is a Flash Site Building tool that helps users build stunning websites. Check Out Custom Custom Logo Design by LogoBee. Website Design and Free Logo Templates available.
 CodingForums.com Simple Looping HELP
 User Name Remember Me? Password

Before you post, read our: Rules & Posting Guidelines

Enjoy an ad free experience by logging in. Not a member yet? Register.
 11-16-2010, 12:17 PM PM User | #1 bennykelly13 New to the CF scene   Join Date: Nov 2010 Location: Ireland Posts: 1 Thanks: 0 Thanked 0 Times in 0 Posts Simple Looping HELP I am having a problem with a simple loop,but I cant seem to get it to work.Basically I have a function Currentcalculator taking in a number of predefined parameters plus changing parameters for V and T from an excel spreadsheet.The spreadsheet is in the format shown. Temperature Wind 1 2 3 4 5 1 2 3 4 I want to take a wind speed of 1,2,3,4 and temp of 1 and print the results to excel, then take wind speed of 1,2,3,4 and temp of 2,then a temp of 3,4 etc.Can anyone help me?here is my code x1 = win32com.client.Dispatch('Excel.Application') x1.Visible = 1 x1Wb = x1.Workbooks.Open('current calc.xlsx') point = x1.Cells row, col = 0, 0 V = () T = () i = 3 j = 3 k = 2 while i < 28: while k < 8: cells = point(i,1) Wind = int(cells.Value) V = Wind cells = point(2,k) Temp = cells.Value T = Temp dlr = Currentcalculator(T,80,V,45,0.00403,0.01813,0.5,0.5,0.000123,0.000183,75,20,900,100) cells = point(j,k) cells.Value = dlr cells = point(j,k) if i<28: i = i+1 j = j+1 ## if k < 6: break k = k+1
 03-06-2011, 11:18 AM PM User | #2 Kakao Regular Coder   Join Date: Mar 2006 Location: Brasília, Brazil Posts: 153 Thanks: 0 Thanked 0 Times in 0 Posts Use the code tag to format your code. Otherwise it is very difficult to read Python code.
03-06-2011, 11:45 AM   PM User | #3
oesxyl
Master Coder

Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
Quote:
 Originally Posted by Kakao Use the code tag to format your code. Otherwise it is very difficult to read Python code.
difficult? this is a nice substitute for impossible,

for op: left justification make impossible to see where each while loops, if's are ended. as Kakao said, use code tags please.

best regards

 Bookmarks

 Tags excel, loop, python

 Thread Tools Rate This Thread Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home :: Client side development     JavaScript programming         DOM and JSON scripting         Ajax and Design         JavaScript frameworks         Post a JavaScript     HTML & CSS     XML     Flash & ActionScript         Adobe Flex     Graphics and Multimedia discussions     General web building         Site reviews         Building for mobile devices :: Server side development     Apache configuration     Perl/ CGI     PHP         Post a PHP snippet     MySQL         Other Databases     Ruby & Ruby On Rails     ASP     ASP.NET     Java and JSP     Other server side languages/ issues         ColdFusion         Python :: Computing & Sciences     Computer Programming     Computer/PC discussions     Geek News and Humour Web Projects and Services Marketplace     Web Projects         Small projects (quick fixes and changes)         Medium projects (new script, new features, etc)         Large Projects (new web application, complex features etc)         Unknown sized projects (request quote)         Vacant job positions         Looking for work/ for hire         Project collaboration/ partnership         Paid work offers and requests (Now CLOSED)     Career, job, and business ideas or advice     Domains, Sites, and Designs for sale         Domains for sale         Websites for sale         Design templates and graphics for sale :: Other forums     Member Offers     Forum feedback and announcements

All times are GMT +1. The time now is 04:43 PM.