3,386 Posted Topics

Member Avatar for andrew.makkink

The Suse's package manager keeps the packages rasonably uptodate, latest Python 2 is 2.7.5 so your Python is quite reacent. You can well start with IDLE and gedit text editor, SuSe's package manager should also include many other editors. Some Unix/Linux people prefer traditional vi/emacs environments with additional Python support. …

Member Avatar for andrew.makkink
0
134
Member Avatar for m_ishwar

Been there, done that ;) http://www.daniweb.com/software-development/python/code/367871/assembler-for-little-computer-3-lc-3-in-python (notice also the follow up posts)

Member Avatar for m_ishwar
0
158
Member Avatar for jpk1a873

And naturally there is my code snippet http://www.daniweb.com/software-development/python/code/295726/integer-to-english

Member Avatar for woooee
0
8K
Member Avatar for floatingshed
Member Avatar for woooee
0
470
Member Avatar for edward.miller.921

You must save the instances of the ArithmeticButtons like you do for numbers, now you only create them without saving.

Member Avatar for edward.miller.921
0
860
Member Avatar for otengkwaku
Member Avatar for felceyboy

putting definitions inside loop is really bad idea. You do not need to define the functions multiple times.

Member Avatar for felceyboy
0
242
Member Avatar for nagia.retsina
Member Avatar for fatalaccidents

have you tryed to use the command ib command prompt? I remember that sometimes you must add one more level of double quotes arround the double quotes, which gets removed. Can you not use only double quoting inside the command, I do not think CMD supports single quotes. I am …

Member Avatar for fatalaccidents
0
390
Member Avatar for ajike
Member Avatar for wolf29

Your pseudo in running form (except last line which does not make sense for me): # as an example of one of the rows in a csv file hostlist=['192.168.10.17', 'postgres12', "Red Hat 4.3", "broken"] if any(item in hostlist[2] for item in ("Red Hat", "Debian", "Fedora", "Linux")): print(hostlist)

Member Avatar for wolf29
0
276
Member Avatar for kamald123

Line 6 is there to create a file to report about, if you have preexisting file, you would leave that out, of course.

Member Avatar for AlexWong
0
6K
Member Avatar for douwe1971

Indent the lines inside the try's except block, same level as the dfn = ... line 48, but I would like you to generalize the check in function, like I did in [my code snippet](http://www.daniweb.com/software-development/python/code/364647/jail-input-and-looping-exercise). You are redefining the check_input three times so it is better to remove lines 7...40 …

Member Avatar for douwe1971
0
192
Member Avatar for krystosan

If you are more fluent in Python you might us/adapt my snipet: http://www.daniweb.com/software-development/python/code/426990/split-string-except-inside-brackets-or-quotes

Member Avatar for TrustyTony
0
124
Member Avatar for wolf_one

Only looks little strange that all documents have 10001 pages. Hope page zero also exists, normally page numbering starts from 1, not zero, I do not know details of the Pdf module. Wouldn't there be any method to find the number of pages in document?

Member Avatar for chriswelborn
-1
273
Member Avatar for Aethir

Here is my number guess game, if you want to compare with your approach. http://www.daniweb.com/software-development/python/code/287950/classic-number-guess-game-python-ternary-operator-demonstration Basic thing not to bloat code with infinite loops checking validity is to just accept anything as long as exception does not occur and let user easily to reenter the numbers if he notices that …

Member Avatar for chriswelborn
0
313
Member Avatar for dp121307
Member Avatar for superbhimanshu

I do not think I understand enough what you are trying to do, you should post some example of input and output and also show what you have done until now yourself.

Member Avatar for TrustyTony
0
164
Member Avatar for reddsoxy
Member Avatar for TrustyTony
0
121
Member Avatar for Necrozze

You have not created instance of HelloWorld object, but try to access the class method without reference to instance (self parameter). class HelloWorld: def __init__(self ,name='friend'): self.name = name def __str__(self): return "Hello, %s!" % self.name print HelloWorld() print HelloWorld('pyTony')

Member Avatar for Necrozze
0
304
Member Avatar for Ancient Dragon

Does not prove it happygeek, **community feedback -> no rep** I tested it in programming forum post of our ancient friend, and somehow it did not get added at all at first click after cancel - upvote and comment, but going back to page and clicking the upvote button again …

Member Avatar for deceptikon
0
174
Member Avatar for ub007

hogging memory should be simple enough for example m = [] while True: m.append(0) If you want to do it exponentially: m = ['a'] while True: m.extend(m[:])

Member Avatar for TrustyTony
0
120
Member Avatar for Ismatus3
Member Avatar for woooee
0
313
Member Avatar for Om

What is your problem, looks simple enough and I think you should be finding average or worst case behaviour complexity in O notation.

Member Avatar for TrustyTony
0
135
Member Avatar for aVar++

Now the policy is just ignore inappropriate down votes, as they have 0 point effect if the giver is not gained respect in form of minus voting power. Also notice that minus power is lot weaker than the plus power of member, in my own case -3/12. Also the DaniWeb …

Member Avatar for diafol
0
562
Member Avatar for Varunkrishna
Member Avatar for massivefermion

Symbian does not support Tkinter, it has interface to phone UI through `appuifw` module: http://www.mobilenin.com/pys60/info_gui_design.htm Tutorial: http://croozeus.com/blogs/?p=215

Member Avatar for TrustyTony
0
213
Member Avatar for siss
Member Avatar for shanki himanshu
Member Avatar for shanki himanshu
0
162
Member Avatar for siss

I do not see where and why you would use command line options in javascript and this can not be translated as the action happens in python standard library module getopt.

Member Avatar for TrustyTony
0
176
Member Avatar for Varunkrishna
Member Avatar for vadimak

This is how I tested for rounding to nearest five cents in https://www.pythonanywhere.com/try-ipython/ (useful as I have not Python and no Admin rights in work): In [15]: granularity = .05 In [16]: #every five cents In [17]: round(v/granularity) * granularity Out[17]: 5.95 In [18]: round(8.91/granularity) * granularity Out[18]: 8.9 In …

Member Avatar for vadimak
0
436
Member Avatar for tengmat

What is your problem, why you do not write it simply directly in C#. > mixes[i+n] = mixes[i]+mixes[i+n] could be expressed more concisely: mixes[i+n] += mixes[i]

Member Avatar for Lucaci Andrew
0
1K
Member Avatar for Aethir

Maybe you could get ideas from my code snippet: http://www.daniweb.com/software-development/python/code/364647/jail-input-and-looping-exercise

Member Avatar for Aethir
0
283
Member Avatar for Necrozze
Member Avatar for aadarsh_khare

JasonHippy> was generated at least once. No it is > 1, so those which was hit **more** than once. I do not see the purpose of printing out the numbers that was hit multiple times. Seeing the distribution of counts would make more sense.

Member Avatar for JasonHippy
-1
277
Member Avatar for manja.her
Member Avatar for zaphoenix
Member Avatar for bumsfeld

You are better off using the ready definitions from the `operator` module. http://www.daniweb.com/software-development/python/threads/453521/code-efficiency-and-a-general-checkup#post1968019

Member Avatar for Kyss
0
240
Member Avatar for zehrah.sayed
Member Avatar for Octet

Here is some possibilities. At least do not use the capitalized names traditionally used for class names for simple instance variables. Also avoid unnecessary empty lines, which in most cases makes code less not more readable. #PyCalc Version 1.0 #for Python2 from __future__ import print_function, division try: input = raw_input …

Member Avatar for Octet
0
429
Member Avatar for Ancient Dragon

Maybe something like this frame: http://www.giftsforyounow.com/Engraved-Memorial-Glass-Picture-Frame-G912901.aspx?green=2A927110-429A-5A5C-9B79-C483BA514055 as avatar style (original avatar in center)?

Member Avatar for TrustyTony
1
400
Member Avatar for TrustyTony

You can fix one parameter of function call by calling underlying method of fixed parameter instead of using functools.partial or lambda statement.

Member Avatar for paddy3118
1
290
Member Avatar for vegaseat

> BTW, line 17 is the continuation of line 16. Which is not necessary as the { gives automatic line continuation ;)

Member Avatar for TrustyTony
5
6K
Member Avatar for user45949219

Use list comprehension with enumerate: >>> column = [['A', 'A', 'B'], ['B', 'A', ''], ['', '', 'B']] >>> print [item[ind] for ind, item in enumerate(column)] ['A', 'A', 'B'] >>>

Member Avatar for TrustyTony
0
195
Member Avatar for jellybean21
Member Avatar for TrustyTony
0
234
Member Avatar for nouth

If the order of lines does not matter, you can use with open('filelein.txt') as infile, open('fileout.txt', 'w') as outfile: outfile.write(''.join(set(infile)))

Member Avatar for TrustyTony
0
362
Member Avatar for Ismatus3

[You can check x and y cordinates of the mouse click from the event's attributes.](http://www.dreamincode.net/forums/topic/137447-tkinter-part-4-basic-event-bindings/)

Member Avatar for Ismatus3
0
295
Member Avatar for nouth

> if line.contains(word): What is this method? Are you not using standard strings? Normal python uses `word in line`, this looks like Ruby.

Member Avatar for nouth
0
328
Member Avatar for dusto

Of course then you can make all at one line: print '#' + '#\n#'.join(' ' * n for n in range(NUM_STEPS))+'#' if NUM_STEPS else ''

Member Avatar for TrustyTony
0
268

The End.