988 Posted Topics
Is there a way to do math with hexadecimal numbers in Python? | |
I read somewhere that you should avoid using a leading underline in a variable name. It is supposed to have a special meaning in Python. I can't find anything more detailed. Does anybody know? | |
Does Python have a static variable like C has? I like to avoid a global variable for the usual reasons. Note: A static variable in a C function will retain its last value. | |
Re: Give him a job! [url]http://en.wikipedia.org/wiki/Dick_Chaney[/url] | |
Re: We went into Iraq without real goals. Well, the original goals (removal of WMD) were fake. If we would have spend the trillions of borrowed Dollars on alternative energy, we wouldn't have to worry about gas prices, home heating and home cooling. Research, development and manufacture of alternative energy like … | |
| |
Re: I just went through this one: [url]http://www.mcafee.com/us/support/index.html[/url] Any question will send you into a perfect circle! | |
How do you loop through an entire year showing each day's date? | |
What is the best way to establish a wxPython event handler for a mouse click, button and so on? I have looked at a number of sample codes and the event handlers differ all over the place. | |
Re: I was just playing around with string functions. String.lower() converts all upper case letters in the string to lower case letters. [code]string1 = "Fahrenheit" print string1.lower() # result: fahrenheit [/code] This way the user can enter Fahrenheit or fahrenheit or F or f and the if compare works. | |
Re: Vega, your are right! In the real world it is more important to be out on the market with a working program at the right time. There are a few cases, where it is critical to milk the speed of program execution for every microsecond. | |
Re: [CODE]// I think clock() is only available for Windows, a tick is ~ 1 ms // if you need time like the string returned by ctime(), then you have to do some processing #include <iostream> #include <ctime> // clock(), time(), ctime(), time_t using namespace std; int main() { time_t t; … | |
![]() | Re: Sorry, I am on a borrowed computer. There is a code snippet here on DaniWeb that uses a BGI for C++. You may check the web site referenced in the snippet. [url]http://www.daniweb.com/code/snippet176.html[/url] |
Re: I have a hunch that driving a printer depends a lot on the operating system and the installed drivers. | |
I am fairly familiar with C, but new to Python. Does Python have something like the handy C conditional expression? For example: [code]// C conditional expression x = a ? b : c; // if a is true then x = b else x = c // here used to … | |
Re: Okay children, stop the name calling! grunge man, you forgot to iclude <iostream> [code] #include <cstdlib> // system() #include <iostream> // cout, cin, endl using namespace std; int main() { int k, n; cout<<"type a number: "; cin >> k; n = k*3; cout << "\ntimes three = " << … | |
Re: Remember one of the basic rules of computing, ideally the flow in a program should be: get data process data show result After I said this, I got interested myself to write the flow, here is my overblown code: [PHP]# find cost of a square inch of pizza given cost … | |
What is the order of the code snippets, they used to be in alphabetical order by title. Now I can't even figure it out, and it is very hard to find anything. | |
Re: Take a look at the C++ code snippets here on Dani Web. The snippets are in a goofy order, but you can search them. This one might do for drawings: [url]http://www.daniweb.com/code/snippet176.html[/url] If its just text: [url]http://www.daniweb.com/code/snippet83.html[/url] | |
Re: Have you ever defragmented your hard drive? | |
Re: For some existing C code take a look at: [url]ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/jpegsr6.zip[/url] | |
Python uses the directories listed in PYTHONPATH to find a module. How can I assure that the module I am importing is on this list of paths? | |
I keep hearing that the eval() function is unsafe. It is a nice function, because you can use it like print eval("2.5*49.7/(23+3.14)") and it will solve the math. Is there any way to protect against some nasty minded person to enter a "os.system(command)" where the command will erase a file … | |
Re: I am starting to learn Python and have a good crasp of C++ from school. I must say, that I find this thread very interesting information. Thanks all of you who contributed! | |
Re: I am here because I find the members of DaniWeb an interesting bunch of nonconforming individuals. Do I here a violin in the background? I am tired of the many lockstep (goose step) folks trained by FOX News. | |
I have the following code, for example: [CODE]price = 50.00 tax = price * 0.08 print "Tax = $",tax # Tax = $ 4.0[/CODE] As you can see there is a space between $ and 4.0. Is there a way to avoid this? I haven't done much Python coding. | |
Re: What GUI library are you using? I am a little familiar with Tkinter and wxPython and might be able to help. There are others I am not familiar with. | |
Re: Where can you find more info on the tkinter text widget? I have played with Tkinter GUI just a little and find it very nice. | |
Re: I think the ladies would vote for Dave Sinkula, if he would be on the list! He looks so boyish and innocent! | |
Re: When I learned C in school our instructor insisted on fflushing after every scanf(), sort of a bathroom thing (student humor). He was a typical puplic school teacher, not very bright. Maybe this comes out of some Herbie Schield book in the library. | |
Re: [QUOTE=Stoned_coder][code] int a=rand(); int b=rand(); int c=rand(); std::vector<int> vec; vec.push_back(a); vec.push_back(b); vec.push_back(c); std::cout<< *std::min_element(vec.begin(),vec.end())<<std::endl; [/code] not a comparison operator in sight[/QUOTE] However, there is a comparison operator out of sight! | |
Re: Is it the processor, the operating system or the compiler? Old Albert is wrong, human stupidity is rather limited. Infinity is much too perfect! | |
Re: The way I read this, this person wants to write a string about 20 to 30 lines long. Am I correct? How to do it best within the code is not an easy question to answer. ---------------------------- I wish you were beer! | |
Re: If it's anything like the sleep(t) function I have been using with C++, there is no way to stop it early. Maybe ctrl/alt/del, but that is not what you want to normally do. | |
Couldn't sleep last night, so I was browsing and found the "Starting Python" thingy. I must say Python looks interesting from the examples. I learned C++ in school, Python sure looks easier to understand. Does any one think it's better than C++? | |
Does anybody know if there is a good C++ code library that can process MIDI music files? | |
Re: JoBe, that looks like interesting code you doing! Is that STL stuff or what? |
The End.