3,386 Posted Topics
Re: 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. … | |
Re: 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) | |
Re: And naturally there is my code snippet http://www.daniweb.com/software-development/python/code/295726/integer-to-english | |
Re: Looks like decimal number of full days since one epoch like Microsoft Excel date. | |
Re: You must save the instances of the ArithmeticButtons like you do for numbers, now you only create them without saving. | |
| |
Re: putting definitions inside loop is really bad idea. You do not need to define the functions multiple times. | |
Re: define the hmldata for all branches of the if statement. | |
Re: 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 … | |
Re: You have syntax errors at lines 1, 6, 9 and 22. | |
Re: 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) | |
Re: Line 6 is there to create a file to report about, if you have preexisting file, you would leave that out, of course. | |
Re: 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 … | |
Re: 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 | |
Re: 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? | |
Re: 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 … | |
Re: cs1graphics is not a standard library module. | |
Re: 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. | |
Re: You can use [py4a](https://code.google.com/p/python-for-android/) with sl4a | |
Re: 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') | |
Re: 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 … | |
Re: 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[:]) | |
Re: See the module zipfile: http://effbot.org/librarybook/zipfile.htm | |
Re: What is your problem, looks simple enough and I think you should be finding average or worst case behaviour complexity in O notation. | |
Re: 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 … ![]() | |
Re: key should be in lower case. | |
Re: 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 | |
Re: Your indentation is incorrect. | |
Re: You did read http://nltk.googlecode.com/svn/trunk/doc/book/ch06.html , didn't you? | |
Re: 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. | |
Re: You set filename at line 26, but you are not using it for anything. | |
Re: 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 … | |
Re: 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] | |
Re: Maybe you could get ideas from my code snippet: http://www.daniweb.com/software-development/python/code/364647/jail-input-and-looping-exercise | |
Re: Just draw rectangle whose width is proportional to points. | |
Re: 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. | |
Re: Your loop is not indented inside the for. | |
Re: 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 | |
| |
Re: 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 … | |
Re: 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)? | |
You can fix one parameter of function call by calling underlying method of fixed parameter instead of using functools.partial or lambda statement. | |
Re: > BTW, line 17 is the continuation of line 16. Which is not necessary as the { gives automatic line continuation ;) | |
![]() | Re: Use list comprehension with enumerate: >>> column = [['A', 'A', 'B'], ['B', 'A', ''], ['', '', 'B']] >>> print [item[ind] for ind, item in enumerate(column)] ['A', 'A', 'B'] >>> |
Re: You should post your code to show effort and explain specific difficulty! | |
Re: 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))) | |
Re: [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/) | |
Re: > if line.contains(word): What is this method? Are you not using standard strings? Normal python uses `word in line`, this looks like Ruby. | |
Re: Of course then you can make all at one line: print '#' + '#\n#'.join(' ' * n for n in range(NUM_STEPS))+'#' if NUM_STEPS else '' |
The End.