988 Posted Topics

Member Avatar for Ene Uran
Member Avatar for vegaseat
0
189
Member Avatar for Ene Uran

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?

Member Avatar for vegaseat
0
309
Member Avatar for Ene Uran

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.

Member Avatar for vegaseat
0
148
Member Avatar for MIGSoft
Member Avatar for Ene Uran
0
316
Member Avatar for warpeace2006

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 …

Member Avatar for server_crash
0
633
Member Avatar for gbs
Member Avatar for goldeagle2005

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!

Member Avatar for Ene Uran
0
244
Member Avatar for Ene Uran
Member Avatar for bumsfeld
0
5K
Member Avatar for Ene Uran

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.

Member Avatar for Ene Uran
0
380
Member Avatar for Confucius

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.

Member Avatar for Ene Uran
0
310
Member Avatar for greatbear

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.

Member Avatar for greatbear
0
98
Member Avatar for ghadahelal

[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; …

Member Avatar for Ancient Dragon
0
173
Member Avatar for iamthwee

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]

Member Avatar for Ene Uran
0
173
Member Avatar for Blujacker

I have a hunch that driving a printer depends a lot on the operating system and the installed drivers.

Member Avatar for vegaseat
0
99
Member Avatar for Ene Uran

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 …

Member Avatar for Ene Uran
0
118
Member Avatar for grunge man

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 = " << …

Member Avatar for Lerner
0
290
Member Avatar for butterflyTee

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 …

Member Avatar for Ene Uran
0
139
Member Avatar for Ene Uran

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.

Member Avatar for Dani
0
177
Member Avatar for grunge man

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]

Member Avatar for Ene Uran
0
108
Member Avatar for Casso
Member Avatar for ani_manit

For some existing C code take a look at: [url]ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/jpegsr6.zip[/url]

Member Avatar for Ene Uran
0
76
Member Avatar for Ene Uran

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?

Member Avatar for vegaseat
0
175
Member Avatar for Ene Uran

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 …

Member Avatar for Ene Uran
0
104
Member Avatar for Micko

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!

Member Avatar for Ene Uran
0
542
Member Avatar for vieome

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.

Member Avatar for DMR
0
503
Member Avatar for Ene Uran

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.

Member Avatar for vegaseat
0
111
Member Avatar for sharma_vivek82

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.

Member Avatar for vegaseat
0
793
Member Avatar for JabaPyth

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.

Member Avatar for Ene Uran
0
124
Member Avatar for server_crash

I think the ladies would vote for Dave Sinkula, if he would be on the list! He looks so boyish and innocent!

Member Avatar for server_crash
0
2K
Member Avatar for mhk_mohsin
Member Avatar for tippytoe

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.

Member Avatar for Ene Uran
0
199
Member Avatar for SpS

[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!

Member Avatar for SpS
0
319
Member Avatar for SpS

Is it the processor, the operating system or the compiler? Old Albert is wrong, human stupidity is rather limited. Infinity is much too perfect!

Member Avatar for SpS
0
357
Member Avatar for bumsfeld

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!

Member Avatar for Narue
0
319
Member Avatar for bumsfeld

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.

Member Avatar for a1eio
0
296
Member Avatar for Ene Uran

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++?

Member Avatar for vegaseat
0
178
Member Avatar for Ene Uran

Does anybody know if there is a good C++ code library that can process MIDI music files?

Member Avatar for Stoned_coder
0
85
Member Avatar for JoBe

JoBe, that looks like interesting code you doing! Is that STL stuff or what?

Member Avatar for Ene Uran
0
694

The End.