904 Posted Topics

Member Avatar for ayman86

Writing your print statement to file: [code=python]# open/create text file for writing in main() fout = open( "test1.txt", "w" ) # may need "a" for append # in your program under this line # print '\tn: %d, sort time: %f' % (n, dt) # add this line print >>fout, '\tn: …

Member Avatar for ayman86
0
128
Member Avatar for maui_mallard

I agree, whoever gets to 20,000 posts first should get the immensely coveted "Fickle Finger of Fate" award.

Member Avatar for jbennet
2
312
Member Avatar for lllllIllIlllI

You can also use Python's module profile: [code=python]import profile def get_primes3(n): if n < 2: return [] if n == 2: return [2] nums = range(3, n, 2) idx = 0 while idx <= (n - 1)**0.5 - 2: for j in xrange( idx + nums[idx], n//2 - 1, nums[idx] …

Member Avatar for woooee
0
84
Member Avatar for DangerDev

[QUOTE=joshSCH;529078]Wow.. I think that post proves that you are a young, naive fool.[/QUOTE]Mon dieu, if Lardmeister is one fool than what are you? How low can you go?

Member Avatar for sneekula
0
582
Member Avatar for The Dude

[QUOTE=Lardmeister;593759]When I grow up I would love to look like Rodney Dangerfield. He made tons of money with his astonishingly good looks.[/QUOTE]Rodney is one wonderful man, but when I grow up I rather want to look like actor Jean-Claude Van Damme. He has muscles like Arnold Schwarze... , but he …

Member Avatar for twomers
-1
293
Member Avatar for Abbigail
Member Avatar for server_crash
Member Avatar for Shakis

One way to do this is to have your running application update shared datafile that can than be read from your Python program.

Member Avatar for pythonuser
0
84
Member Avatar for wandie

There are number of ways, but this way I mostly use: [code]# sorting a list of lists by index def sort_inner(inner): """ inner is each inner list in the list of lists to be sorted (here item at index 1 of each inner list is to be sorted) """ return …

Member Avatar for PlagTag
0
259
Member Avatar for FreezeBlink

Ubuntu seems to be one ugly beast, I have heard other poeple complain about it, particularly Python programmers.

Member Avatar for bumsfeld
0
185
Member Avatar for briansmall

Sky diving, ski jumping, car racing, target shooting, sailing, romance.

Member Avatar for ZZucker
0
560
Member Avatar for The Dude
Member Avatar for The Dude
0
76
Member Avatar for scru

That handy round roll of paper is indispensable! I have not seen any software to replace it properly.

Member Avatar for Lardmeister
0
104
Member Avatar for GrimJack
Member Avatar for majestic0110
0
313
Member Avatar for vatocleti

It would be very nice if you would use code tags with your code to preserve the indentations. Otherwise the code is very difficult to read and not too many folks will help. [noparse][code=python][/noparse] your Python code here [noparse][/code][/noparse]

Member Avatar for bumsfeld
0
1,000
Member Avatar for ChrisP_Buffalo
Member Avatar for zandiago

It's not-in-jail older folks with bad morals that teach younger folks bad habits.

Member Avatar for jbennet
0
862
Member Avatar for kv79

[QUOTE=GrimJack;594581]jwenting - you spew the most amazing, er 'stuff'. George W. Bush was a draft dodger who got into the Guard thru political influence. While in the guard, he essentially went AWOL and was not seen by his commander for over a year. To be honest, I don't 'hate' much …

Member Avatar for jbennet
0
449
Member Avatar for fredomondi

My God, that Python version must be at least 10 years old. I don't think pyTTS was out then.

Member Avatar for linux
0
100
Member Avatar for sanoski

When you see code like this, sometimes it's enlightning to print out the variable for test. Yes, you can multiply lists.

Member Avatar for sanoski
1
269
Member Avatar for nsandestin
Member Avatar for nsandestin
0
121
Member Avatar for wyno

Learn the Python language, then you can talk it into going on a diet. Your python is in it's main growing stage, just keep feeding it, it will grow out of that hungry habit.

Member Avatar for Ene Uran
0
88
Member Avatar for heshan
Member Avatar for bumsfeld
0
56
Member Avatar for Foobar69
Member Avatar for bumsfeld
0
63
Member Avatar for The Dude

I saw one movie about slaughter houses when I was in elementary school. About half the kids would not eat meat afterwards.

Member Avatar for >shadow<
1
281
Member Avatar for The Dude
Member Avatar for techbound

Hits you right in the tear duct! I wonder what land locked countries have to present.

Member Avatar for joytech22
0
141
Member Avatar for Kythas

Your program reads in all the lines into one list of lines and then even makes one copy of this rather large list. The code below reads in the lines as needed for processing: [code=python] ... for vhstring in file(vhdat): # remove trailing whitespace vhstring = vhstring.rstrip() # your processing …

Member Avatar for jice
0
134
Member Avatar for a1eio

Here is older dragdrop example for Tkinter: [url]http://www.faqts.com/knowledge_base/view.phtml/aid/4383[/url]

Member Avatar for bumsfeld
0
108
Member Avatar for Acidburn

You are trying to concatinate class instance with string ".ac" that will not work. Why don't you simply create the new class attribute dynamically this way and then you can use it. [code]searchSpace[0].ac = None [/code]

Member Avatar for Acidburn
0
257
Member Avatar for Islandstone

When you run the above file, carefully read the messages. PIL has history of giving problems with py2exe. Just for testing, use small PIL program with py2exe. Of course, I am using Windows Vista and expect all sorts of problems anyway!

Member Avatar for Islandstone
0
328
Member Avatar for gehher
Member Avatar for lio04
0
306
Member Avatar for lasher511
Member Avatar for crackers

The best way to pick random integers between 1 and 15 is this way: [code=python]import random # selects one random integer from 1 to 15 pick = random.randint(1, 15) [/code]Then you set up one 'endless while loop' asking the user to enter the guess. Use series of if/elif statements comparing …

Member Avatar for crackers
0
156
Member Avatar for The Dude

Thank you jwenting for identifying the axis of evil right here. May God and his son Jesus bless you!

Member Avatar for Drezta
0
60
Member Avatar for steven woodman
Member Avatar for jbennet
0
158
Member Avatar for steven woodman

[QUOTE=Google Spider;583107]I will make a second account and try it out, let's see how it goes:icon_cheesygrin:[/QUOTE]You find it easier to simply follow the rules, easier for you, the members (posting buddies), and DaniWeb mods.

Member Avatar for jbennet
0
238
Member Avatar for vegaseat

I think Jwentings plane #10 might be F5 Tiger (Freedom Fighter), possibly one of the ones that the Shah of Iran purchased.

Member Avatar for jwenting
1
1K
Member Avatar for i_saw_some

In Python use: [code=python]s = """return false; } function validPeriod() { for (var i = 0; i < periods.length; i++) { """ # test it print s [/code]

Member Avatar for i_saw_some
0
87
Member Avatar for drjekil
Member Avatar for bumsfeld
0
74
Member Avatar for fongoos

Compared to Java, Python has simplified a lot of the syntax. It will spoil you, and you may actually have fun.

Member Avatar for linux
0
823
Member Avatar for rt7878

Citroën C3 would do very nicely! Very good milage, sharp look and reliable. Actually, I would love to drive this 1924 Citroën CV, real party car!

Member Avatar for sneekula
0
159
Member Avatar for strictlycustom

You need to study up on argument passing to and from functions. I put some comments into your code to help you: [code=python]def ask_hours(): hours = float(raw_input ("How many hours did you work? ")) rate = float(input ("What is your rate of pay? ")) # return the two arguments as …

Member Avatar for strictlycustom
0
932
Member Avatar for soomedh
Member Avatar for soomedh
0
180
Member Avatar for heshan

Something like that? [code=python]def foo(): return foo.bar foo.bar = "foobar" print foo() # foobar [/code]

Member Avatar for bumsfeld
0
83
Member Avatar for fredomondi
Member Avatar for bumsfeld
0
33
Member Avatar for Ramy Mahrous

[QUOTE=DimaYasny;550924]yeah, CNN, BBC, Reuters and everyone else is pro-terrorist, and there isn't much to be done about it. ... [/QUOTE]That is utter nonsense!

Member Avatar for DimaYasny
0
289
Member Avatar for The Dude
Member Avatar for tsic
Member Avatar for Google Spider

I have gone to Area 52, and that is even more secret. Just to mention that you were there puts your life in danger. Hey, I love to live dangerously!

Member Avatar for sneekula
0
218

The End.