3,386 Posted Topics
Re: Use `elif` for 'g' and 'b' or use the `ìn` test for 'rgb' but test also that input is not empty as empty string '' is in every string. | |
Re: Please indent your code by highlighting it and pushing the TAB key. Use Edit Post to edit your post inside 30 min of writing it. See the help on right corner of Edit box (Formatting Help) for futher info. | |
Re: Fix your indention. What is this two reads for reading the file 18-19, 25-26? You are not using any of imported modules, why you import them? | |
Re: You could also try to clear the browsers cache. Then you should get to "bake" a new cookie. | |
Re: [Here you are ;)](http://lmgtfy.com/?q=operator+overloading+C%23 "Something you should know to do") | |
Re: They are not Pythonic or unPythonic, but 1. is the way it used to be in Python 2 (it **does not function in Python 3**), second alternative is print as function, which is the style of Python 3 and Python 2 new versions if you do `from __future__ import print_function`. … | |
Re: The basic things is to keep in correct place input/output value as string and the numerical value as number, which is one suitable format suitable for calculations. So what really happens is that your have two processes **input** 'some numbers' -> value('some numbers') **output** value -> string representation of value … | |
Re: Quick Google found this http://mailman.isi.edu/pipermail/ns-users/2005-January/046747.html Did you do any effort to find the answer by ourself? | |
Re: Please do not leave every second line empty, it makes your code very difficult to read as logical block of code can not be seen with one look. ![]() | |
Re: Sorry snippsat missed the cygwin bit, install setuptools or distutils and use easyinstall to install the module, if it is not in cygwin python packages like python-crypto (you can rerun cygwin setup.exe to select, deselect packages) | |
Re: Please use the [code tagging](http://www.daniweb.com/community/syntax) by tabulating your code one more level by hightlight and TAB, before the 30 min editing window finishes! | |
Re: Sanjay surely continues to Save Our Souls with worthy style and will be [triumphant](http://www.thinkbabynames.com/meaning/1/Sanjay) in the new role. | |
Re: There is many variations, I have usually python not in path, because I use both Python 2.7.2 and 3.2.2 installed. Actually I have also PyPy 1.8 also installed. So for more rigorous testing I usually use [ConText editor](http://www.contexteditor.org/downloads/), for which I have defined launching various versions of Python to function … | |
Here is an amazing article. Peter Norvig does not let small detail, that the language was never implemented in it's time, disturb his debugging the code written without implementation, but single handedly implements it with Python parser. Frustration warning, this is frustratingly amazing stuff: [Prescient but Not Perfect: A Look … | |
Re: Your sum is correct, just do not use sum as function name. You just need to make user input function, look code snippets section for examples. | |
Re: What this is supposed to mean? def sort01(sort01): sort01=len(Zip) You are defining function, with the function itself as parameter and then shadowing it with length of Zip list. See def sort01(sort01): print sort01 print sort01(Zip) sort01=len(Zip) print sort01 sort01(len) | |
Re: I would only consider movin Recently Updated Articles after Recommended and rename it **All Updated**, to be more vertical mode friendly for mobile. No problem with Opera Mobile in Nokia E7 (Symbian^3) on horizontal mode. For Nokia browser you have kept it disabled, I noticed. | |
Re: I do not know how to do it in awk, as I do my stuff in Python, in Python I would do: ~~~ python fn = 'd.txt' ind, character = 8, 'L' with open(fn) as fin: text = fin.readlines() text[1::2] = [line[:ind] + character + line[ind+1:] for line in text[1::2]] … | |
Re: Usually is to have sequence of values or dictionary, functions if necessary from __future__ import division from operator import * case_func = [('+', add), ('-', sub), ('/', truediv), ('*', mul)] def type_menu(): print("""Types of Math: 1.) - Add 2.) - Subtract 3.) - Divide 4.) - Multiply""") return int(raw_input("Choose one … | |
Re: The values are sorted as long as they are under 10 but they are sorted as strings, I do not understand the bit about **5 count 5, 6 count 6**. You could just us itertools.groupby and check the lengths of the groups, if it is just counts. | |
Re: You refer to line even it only gets define in for of line 6 already at lines 3 to 5. What adding/substracting 1 from the input line is supposed to mean? Please, use `in`, not `__contains__` method. What is `[key]""` is supposed to mean? | |
Re: Line 6 to 26 are strange, missing if/indention? I would remove all command line option stuff and build printing defaults/editor for single _ variables in the class, either called at end of init or your favorite way for mobile (say key 0) | |
Re: You must collect values as list or other collection type. Now you overwrite values and only last stays. | |
Re: Could be usefull to have test user acccount *"Dani de Bug"* ;) For mobile posting I seem to be able to write and back space in Opera Mobile, not remove styles or jump in text. **Update** Now Opera editing with touch screen from Nokia seems to work, but the Edit … | |
Re: Which [state](http://www.merriam-webster.com/dictionary/state) you are talking about? | |
Re: see random.choice | |
Re: where is the pythoncom defined? | |
Re: You forgot to post your code and what is your problem. | |
Re: I do not know if it is possible to add thei markdown extra, so indentation can be avoided for code blocks, otherwise it is better to indent code before copying to your post. I think most posters do not like playing with mouse painting games. from http://warpedvisions.org/projects/markdown-cheat-sheet/ ~~~ // Markdown … | |
Re: Hint stringsToFile is not Python standard name (`strings_to_file` is), instead for loop you can use built in method of file type adn string type. Do not forget that recommended way to deal with files is with `with` Remember to uses meaningful variable names and do not use variables just to … | |
Re: Do you mean that you want to count the occurances *without* regular expressions as you are not even importing re module? | |
Re: >if maze[row-1,col] == 'O' or 'F': --> this doesn't make sense to me and will always be "True" To nit pic it is allways True boolean valu first condition is True, otherwice second expression 'F' which is not a False-like value and therefore acts as True value. | |
Re: If you are wanting to exchange e and o so that every e becomes o and every o becomes e, you must first save one of them, say e by replacing it with one special charcter which does not occur surely in string, like _. Then you change o to … | |
Re: After I marked subforum read the message ipconfig... from Networking is still marked unread in main level of Hardware and Software, even after closing Firefox and reopening.  | |
Re: Please put empty lines and three tilde lines arround your code. Here is your code little edited after recovery from page source with Python massaging: ~~~ import time def delayprint(text, d=0.1): for line in text.splitlines(): print(line) time.sleep(d) def eyes_menu(): delayprint("""These are your choices for eyes: 1.) Open Wide 2.) Closed … | |
Re: [This way](http://mail.python.org/pipermail/python-win32/2006-May/004678.html) does not work? ~~~ Tkinter way ------------------------ <toplevel>.wm_attributes("-topmost", 1) # Make sure window remains on top of all others <toplevel>.focus() # Set focus to window ~~~ | |
Re: For working directly through Word application, you could use pywin32 extensions: ~~~ # from: http://win32com.goermezer.de/content/view/173/192/ # install pywin32 from # http://sourceforge.net/projects/pywin32/files/pywin32/ # reference for the [Word Object Model](http://msdn.microsoft.com/en-us/library/bb244515.aspx) import win32com.client wordapp = win32com.client.Dispatch("Word.Application") # Create new Word Object wordapp.Visible = 0 # Word Application should`t be visible worddoc = wordapp.Documents.Add() … | |
Re: And that should be the action of the **Code** button, right? Like before code tags and cursor between for pasting, now in line between tildelines: ~~~ This will be empty line with cursor ~~~ There will be ready new lines ie tags are '\n~~~\n'. I think it would be good … | |
Re: I would challenge my mathematical mind with challenges of http://projecteuler.org, depends if you are mathematically minded. But first do something simpler to soldify your knowledge from passive knowledge to active one. Think of it: I learned to speek this language little bit, what should be my next step. Answer is … | |
Re: [This my script](http://www.daniweb.com/software-development/python/code/316585/scan-filetree-for-files-containing-text) in code snippets does it, if text to search is ''. | |
Re: I also experienced extra long delay after pushing Reply to this Article button and ended double posting my reply. I do not know if it is related or even just connection delay from here over the pond. | |
Re: Rules and images: http://ww2.cs.mu.oz.au/~bjpop/lsystem/lsystem.html | |
| |
Re: You are trying to print value with no set value line 78, and that variable is never used so just remove lines 77 and 78. You have n instead of \n all around your code and you are using lists as values in c_l_spaces, even you said you can not … | |
Re: You must initialize the newlist out of the loop otherwise you reset before you add next one and you are left with the last value in the list. |
The End.