- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 8
- Posts with Upvotes
- 8
- Upvoting Members
- 7
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
93 Posted Topics
Re: You need a loop that checks if the user has selected option 4 or rather check that the user hasn't selected 4 in order to continue looping. Give it a try and come back with any questions. Also, use raw_input, not input. input will evaluate the users input as Python … | |
Re: You're not giving us any information about how you want this to work but the simple solution would be to iterate over the files in the directory with the following as the body of the loop: [CODE=cpp] FtpPutFile(hFtpSession, "C:\\log.txt", "mylog.txt", FTP_TRANSFER_TYPE_BINARY, 0); if(FtpPutFile(hFtpSession, "C:\\log.txt", "mylog.txt", FTP_TRANSFER_TYPE_BINARY, 0)){ MessageBox(NULL, "Successfully uploaded … | |
Re: [QUOTE=oiwah;844489]pleas help... is it possible that a wxpython program can become a web page??[/QUOTE] Be more specific. I doubt you can do what I think you are asking. You could write the server-side code using wxPython. I'm not sure you would really want to, however. | |
Re: They have a PDF download link. Why not use that? ![]() | |
Re: You might also want to check into the differences between 2.5, 2.6 and 3.0. They aren't a simple progression. It may not be a bad idea for someone just starting out to learn on 2.5; it's what most of the tutorials, examples and libraries you will come across will be … | |
Re: What happens when you forget to run the script or your computer is off one day? I suppose that's one more day of school ;) If you want to calculate the number of days, try something like this: [CODE=python] import datetime graduation_date = datetime.date(2010,8,31) today = datetime.date.today() duration = graduation_date … | |
Re: [icode]height = principal * 0.02 TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'[/icode] 0.02 is your float and * is your operand. That only leaves principal to be your NoneType. At another point, you are setting principal equal to the return value of a function that doesn't return anything. … | |
Re: You would probably want to make that: [code=python]labels=['yes',"i don't know",'no'] results=[5,60,30] list_3 = zip(results, labels) list_3.sort() print list_3[/code] So that it's sorted based on results rather than labels. But using a dictionary may be a better choice in the first place. | |
Re: What do you expect from us? We don't know what "weather" looks like and we aren't going to implement sorting algorithms for you. If you are having trouble, give it your best effort and come back with specific questions. | |
Re: You need to place the label somewhere like you did with the buttons: [code=python]label.grid(row=1, column=2)[/code] Also change: [code=python]while True: if count_flag == False:[/code] To: [code=python]while count_flag:[/code] Although that's not necessary, it's proper use of while loops. | |
Re: Here's a simple example: [code=python] def funcA(): var = 1 print var var = funcB(var) print var def funcB(var): #var could be named anything you want var = var + 25 return var funcA()[/code] This will print (I hope, didn't test): [icode] 1 26 [/icode] EDIT: Just to make this … | |
Re: [QUOTE=sneekula;843752]With huge indentations like you have in your code my editor will go up in smoke! I will let someone else try it first! :)[/QUOTE] Haha. I just tried to run through the execution of the code in my head without trying to follow the logic. It seems to me … | |
Re: This looks like more of a math problem than a programming problem. Use b for your y-intercept. Anyone that has opened an Algebra book will be familiar with it. y1 = m1x + b1 y2 = m2x + b2 Solve for x and you have an equation you can plug … | |
Re: Something like this: [icode]remote.download#CheckerRunner?checker=|EqualityChecker?threshold=5|+|AnotherChecker?threshold=6|[/icode] Or are you looking for help with the code? | |
Re: If that is all of the arguments your program will take, this would be the easiest option: [code=python]import sys for file_name in sys.argv[1:]: print file_name[/code] | |
Re: You could write your own parser but that doesn't make sense when python standard library provides you optparse ([url]http://docs.python.org/library/optparse.html)[/url]. | |
Re: Since you nearly had it, here's a working example with minimal changes to your code with comments where there are changes. [code=python]print ("Perfect Numbers") a = 1 #No need to start at 0 b = [] while True: for n in range(1, a+1): #Start at 1 and remove the check … | |
Re: A None value 3x3 matrix: [code=python][[None]*3]*3[/code] [code=python]def mlist(size): return [0] * size def mmatrix(rows,cols): return [mlist(cols)]*rows[/code] | |
Re: [QUOTE=evstevemd;847909]Yeah, I mean CLOSED SOURCE AND COMMERCIAL So if LGPL allows that and everything is as you have said, choice becomes to user, am I right?[/QUOTE] Just link to the shared library and you're fine with "closed source and commercial." Also, I much prefer Qt. | |
Re: EDIT: MrSpigot beat me to the semi-colon bit but the rest applies. You are missing semi-colons in these lines: [code=cpp]float fltBonus float fltMoney[/code] Also you have > in your case statements. You need an if clause to do what you are trying to do. Also, don't use [ICODE]#include<iostream.h>[/ICODE]. Use [ICODE]#include … | |
Re: [code=python]len(b)[/code] Will give you the length of b. [code=python]s = 0 for i, value in enumerate(b): s += value[/code] That will give you the sum of all elements in b. You could also do it like this: [code=python]s = 0 for i in range(len(b)): s += b[i][/code] Or: [code=python]sum(b)[/code] ;) | |
Re: I thought I would throw another solution using recursion out there. Not fully tested but should do the job. [CODE=cpp] int sum_digits(int number) { int remainder = number%10; if (remainder > 0) return remainder+sum_digits((number-remainder)/10); else if (number >= 10 && remainder == 0) return sum_digits(number/10); return number; } bool sum_digits_even(int … | |
Re: You could use this library: [url]http://www.swftools.org/gfx_tutorial.html[/url] It will let you easily convert a PDF to another image format that you might find easier to print. As for ReportLab, I could be wrong but I don't think it will decode PDFs. It will generate them, however. | |
Re: [QUOTE=bhanu1225;847977]No no... [COLOR="Red"]I have created a sample program using python Tkinter(An application) which is not related to web application. Its Just a stand alone application.[/COLOR] Lets take an example In our PC's, we have "OPEN OFFICE". There is an option for print. Exactly, i need to get the [COLOR="Red"]print option[/COLOR] … | |
Re: [code=python]import time time.sleep(5.5) #sleep for 5.5 seconds [/code] [code=python]3**2 == 9[/code] | |
Re: [code=python]for word in 'sun is shining'.split(' '): print word[/code] | |
Re: Why are you using [icode]del[/icode] and using a recursive function? Why are you using two variables when you are only keeping track of one number? Try something like this: [code=python] import time a = 0 while True: a += 1 print(a) time.sleep(5) [/code] My recommendation would be that you forget … | |
Re: Any of your variable names that repeat should be in a container. So instead of T1...T50, you should have a list, T, with 50 elements. While you might consider jlm699's solution to the repetition, it really doesn't address the fact that you have 50 variables that could easily be reduced … | |
Re: What are the guidelines? How much time do you have? Do you have any areas of special interest or expertise? Basically, we would need more in be any help. | |
Re: [icode]\t[/icode] will print a tab. I don't know if that's your best option, not seeing your data. | |
Re: [CODE=python]# find user ( elif choice == "1": import active_directory user_name = raw_input('Enter user name: ") user = active_directory.find_user (user_name) print user[/CODE] You might also want to do some input checking and/or check that the find_user function returns a valid user. | |
Re: Why not open the csv file outside of the loop? That would result in having only one csv output. | |
Re: You need to post your code. I don't know what you are asking. You say "specific detail" several times. What does this mean? | |
Re: Search for the next " after the one in src=" As a side note, you would be better off using regex or an HTML parser. | |
![]() | Re: Perhaps a little more detail will help with giving you better options. Is it OK for the user to be asked for input and then wait until after they are done to determine if it's past closing time? You could then just ignore the input. If the user must be … ![]() |
Re: Also, when you post the remainder of the code, ask specific questions. You are much more likely to get answers if people know exactly where you are having trouble. Does it not compile, does it not do what you expect (what do you expect?), is there something you need to … | |
Re: You really need to break this down into simple parts and put them together. This is not the optimized way of doing things but you have stated exactly what you have to do in simple steps: [QUOTE]What I am trying to do is, - break a number (say 85) into … | |
Re: If you want to run something arbitrary: [CODE=cpp]import os os.system('your\path\here') [/CODE] Using the webbrowser module would make more sense for that specific problem, as said above. | |
Re: [QUOTE=vidaj;845866]Oh, and by the way - don't create multiple threads with the same topic. It doesn't matter if you haven't got any answers yet, multiple threads are a no-go.[/QUOTE] The problem is that he did get a response and still posts multiple times (and probably on other forums) looking for … | |
Re: You're able to use -listContents because it's picking up the -l part. You should be able to replace 'istContents' with anything and get the same results. It's picking up 'istContents' as the option of the argument '-l'. The option parser in Python uses Unix style. Gotta run so I can't … | |
Re: For the first problem, you can use two nested loops using the range function ([url]http://www.network-theory.co.uk/docs/pytut/rangeFunction.html)[/url]. The outer loop would be wind speed and the inner loop would be temperature. Something like this: [CODE=python]for wind in range(...): for temp in range(...): #calculate and display value using wind and temp[/CODE] Of course … | |
Re: The first thing you do should be to determine if 3.0 is what you want. There are many backwards incompatible changes, as you have found. It's not as simple as moving on to the newest version. | |
Re: .NET is a framework that can be used from many different languages (C#, C++, VB.NET, Python, etc.). It can be used for just about anything, web development, desktop applications, mobile phone apps, etc. | |
Re: If you're also looking for a Linux solution, in sys/utsname.h is the function uname. More info here: [url]http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/utsname.h.html[/url] | |
Re: You're more likely to get help if you try to explain it and ask specific questions that trouble you. I have no idea what your level of knowledge is and won't waste my time trying to explain things that you already understand. | |
Re: boost::filesystem also provides [icode]remove[/icode] as a portable means to delete a file. [url]http://www.boost.org/doc/libs/1_38_0/libs/filesystem/doc/reference.html#Operations-functions[/url] | |
Re: Try this: [CODE=python]event.where.append(gdata.calendar.Where(value_string=item[3]))[/CODE] You could try this for testing purposes so you don't have to edit your CVS structure: [CODE=python]event.where.append(gdata.calendar.Where(value_string="Home"))[/CODE] | |
Re: Give it a try and come back with questions (including compiler errors). | |
Re: Do what breatheasier said and come back with more specific questions. It would do you no good to have one of us answer theses questions. You'll just get behind as your class moves on. If you really try hard on this and still can't get anywhere, I suggest you speak … | |
Re: What's weird about 0.5 being less than 2.5? Is X2 a float? |
The End.