226 Posted Topics

Member Avatar for bpatt22

Should be this: [CODE]d1 = dict() d1[0] = 1 d1[1] = 8 d1[2] = 8 maxValue = max(d1.values()) #<-- max of values print [key for key in d1 if d1[key]==maxValue][/CODE]

Member Avatar for TrustyTony
0
8K
Member Avatar for parijat24

I see you are working with Drosophila genetics. I'm not sure what you are trying to do.. can you explain it further?

Member Avatar for jcao219
0
193
Member Avatar for job2
Member Avatar for SoulMazer

I think the server processing speed would determine much of that. Also the speed of you LAN network, which you can test with LAN Speed Test [URL="http://www.totusoft.com/downloads.html"]http://www.totusoft.com/downloads.html[/URL]

Member Avatar for ultimatebuster
0
137
Member Avatar for ultimatebuster

[QUOTE=ultimatebuster;1278469]I'm kind of confused over the iterator object/concept and the yield statement and its usage. According to my understanding, all the python sequence are iterators, as they don't need the classic [icode=java]for (int i=0; i<list.length; i++)[/icode] to iterate through lists/arrays. Am I correct over this? Am I missing anything? Also …

Member Avatar for ultimatebuster
0
100
Member Avatar for prashanth s j
Member Avatar for TrustyTony
0
98
Member Avatar for Tommymac501

That indicates that the .csv file has it in scientific notation. No string-number conversions exist there. also this code [icode]L = ''[/icode] is useless. L is not "declared" as a string. Python doesn't do that. If L is first a string, it doesn't mean it will always be a string. …

Member Avatar for Tommymac501
0
2K
Member Avatar for jcao219

This is not my code! Taken from [URL="http://stackoverflow.com/questions/3230978/code-golf-four-is-magic/3231355#3231355"]this SO post[/URL]. You can use this to get the number of letters in the English representation of an integer, from 0 to 99. So for example 5 (five) is [icode]len("five")[/icode] which is 4.

Member Avatar for TrustyTony
0
174
Member Avatar for Simes

[QUOTE=tonyjv;1274972]You did not get rid of those un-Pythonic getters and setters.[/QUOTE] Yea, it would be doing us a favor if you removed them. They are quite painful to my eyes.

Member Avatar for Simes
0
531
Member Avatar for wolfeater017

[QUOTE=wolfeater017;1273575]cx-freeze 3.1 will work with python 3.0 right[/QUOTE] It will surely work with the latest version - Python 3.1.2

Member Avatar for Beat_Slayer
0
198
Member Avatar for acrocephalus

[CODE]while True: fname = raw_input("File name: ") try: fhand = open(fname) break except IOError: print "File {0} cannot be opened. Try again.".format(fname)[/CODE]

Member Avatar for acrocephalus
0
141
Member Avatar for acrocephalus

Or you can do something like [CODE]while True: #... #... if overwrite = 'y': #... break[/CODE]

Member Avatar for TrustyTony
0
141
Member Avatar for Simes

Why do you have so many getter and setter methods? You don't need them, so I recommend removing them. Python has no need for that kind of getters and setters.

Member Avatar for Simes
0
203
Member Avatar for prashanth s j

You can use Regular Expressions. Search the file for that pattern, get the "guid" number, increment it by one, then write it. I haven't done regex in a while, so I'm not sure about the syntax.

Member Avatar for jcao219
0
141
Member Avatar for echellwig

I can't think of anything. If it is in the same directory, then that line should work. Check your spelling of the module name? Sometimes it is something simple.

Member Avatar for ultimatebuster
0
194
Member Avatar for pyprog
Member Avatar for doomas10

I'm very glad that you like Python. When you get more and more experienced in Python, it will get easier to translate your thought process into code. So, when I think of a list of words that have individual values connected to them, then I usually think of Python's dictionaries. …

Member Avatar for TrustyTony
0
417
Member Avatar for vlady

Just as tonyjv suggested: [icode]str(bin(13))[2:].zfill(10)[/icode]

Member Avatar for TrustyTony
0
171
Member Avatar for echellwig

Definitely Jython. It's Python that is implemented on the Java platform. Look into it at [URL="http://www.jython.org/"]http://www.jython.org/[/URL].

Member Avatar for jcao219
0
116
Member Avatar for Skyelher

[icode]while True[/icode], or any indefinite loop is integral to Python. All programs written in Python should have at least one of them.

Member Avatar for griswolf
0
145
Member Avatar for TrustyTony

Works correctly. Order of operations. This also works: [CODE](-1+0j)**.5[/CODE] without error.

Member Avatar for Skyelher
0
340
Member Avatar for dhanapal86mca

Python for .Net is good, but [URL="ironpython.net"]IronPython[/URL] is better. It's Python written in C#, and you can use it with Visual Studio 2010. Check out the main website. Main use of Python? It's easy and powerful. You can embed it in your C# application if you want. You can also …

Member Avatar for ultimatebuster
0
112
Member Avatar for Mkaveli
Member Avatar for shashimgowda8

Embedded in your C# windows application? That sounds like IronPython. You can add a reference to IronPython and Microsoft.Scripting.Hosting assemblies to embed a Python application inside your C# one.

Member Avatar for shashimgowda8
-1
235
Member Avatar for haro2x

Why do you have so many global statements? Or did glade do that? You should have self.r, self.a1, etc instead of them all being global. Global is bad.

Member Avatar for haro2x
0
149
Member Avatar for echellwig

I repro-d your error with this: [CODE]"".replace(0.02,0)[/CODE] What exactly are you trying to do?

Member Avatar for echellwig
0
574
Member Avatar for YasaminKh

What you seem to be trying to do is multiply a list by another list. What do you expect the results to be?

Member Avatar for YasaminKh
0
182
Member Avatar for aframe

Either externally in a configuration file or database, or in the registry for Windows. There is no other way. EDIT: or environment variables

Member Avatar for griswolf
0
2K
Member Avatar for funfullson

Well, you won't get an experience like those C# reporters, I think, because there really isn't a Visual Studio for Python. You can take a look at this SO question: [URL="http://stackoverflow.com/questions/177799/what-is-a-good-pdf-report-generator-tool-for-python"]http://stackoverflow.com/questions/177799/what-is-a-good-pdf-report-generator-tool-for-python[/URL]

Member Avatar for jcao219
0
86
Member Avatar for Pykoda

Always use os.path.join! It's much easier and there's less room for error. [icode]workPath = os.path.join('Prod','Projects',project,'shots',path,'render','REN')[/icode]

Member Avatar for TrustyTony
0
123

The End.