3,386 Posted Topics

Member Avatar for windiggy

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.

Member Avatar for woooee
0
361
Member Avatar for Doncripz

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.

Member Avatar for Doncripz
0
5K
Member Avatar for MunkyCheez

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?

Member Avatar for woooee
0
4K
Member Avatar for Reverend Jim

You could also try to clear the browsers cache. Then you should get to "bake" a new cookie.

Member Avatar for Sahil89
0
181
Member Avatar for T0pAz

[Here you are ;)](http://lmgtfy.com/?q=operator+overloading+C%23 "Something you should know to do")

Member Avatar for Mitja Bonca
0
90
Member Avatar for utkarshsahu

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`. …

Member Avatar for utkarshsahu
0
175
Member Avatar for Transcendent

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 …

Member Avatar for JamesCherrill
0
122
Member Avatar for amrita111

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?

Member Avatar for TrustyTony
0
142
Member Avatar for tubby123

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.

Member Avatar for michelleradu
0
162
Member Avatar for Tuz
Member Avatar for lisa92222

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)

Member Avatar for TrustyTony
0
191
Member Avatar for motrcolt

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!

Member Avatar for zeroliken
0
611
Member Avatar for happygeek

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.

Member Avatar for TrustyTony
0
107
Member Avatar for ~s.o.s~
Member Avatar for Nick Evan
1
323
Member Avatar for C0ding

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 …

Member Avatar for C0ding
0
324
Member Avatar for TrustyTony

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 …

0
412
Member Avatar for SpartanIE

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.

Member Avatar for TrustyTony
0
2K
Member Avatar for Kaptain Khronic

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)

Member Avatar for TrustyTony
0
304
Member Avatar for C0ding

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.

Member Avatar for Banfa
0
167
Member Avatar for winky

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]] …

Member Avatar for winky
0
473
Member Avatar for Twin802

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 …

Member Avatar for vegaseat
0
246
Member Avatar for oldSoftDev

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.

Member Avatar for TrustyTony
0
218
Member Avatar for crazy99

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?

Member Avatar for crazy99
0
342
Member Avatar for M.S.

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)

Member Avatar for M.S.
0
412
Member Avatar for Niner710

You must collect values as list or other collection type. Now you overwrite values and only last stays.

Member Avatar for TrustyTony
0
3K
Member Avatar for Reverend Jim

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 …

Member Avatar for TrustyTony
1
262
Member Avatar for Twin802

Which [state](http://www.merriam-webster.com/dictionary/state) you are talking about?

Member Avatar for Twin802
0
108
Member Avatar for lfmconsummates
Member Avatar for pleasecompile
Member Avatar for pakiali007
Member Avatar for Dani

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 …

Member Avatar for Dani
0
526
Member Avatar for pakiali007

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 …

Member Avatar for TrustyTony
0
76
Member Avatar for joey_r

Do you mean that you want to count the occurances *without* regular expressions as you are not even importing re module?

Member Avatar for TrustyTony
0
164
Member Avatar for needforkevin
Member Avatar for paulzef

>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.

Member Avatar for TrustyTony
0
197
Member Avatar for choosenalpha

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 …

Member Avatar for TrustyTony
0
222
Member Avatar for WaltP

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. ![networking_read_F5](/attachments/large/2/networking_read_F5.jpg "networking_read_F5")

Member Avatar for Dani
0
184
Member Avatar for jodzjcm
Member Avatar for RogerGC

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 …

Member Avatar for RogerGC
0
154
Member Avatar for gbonline

[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 ~~~

Member Avatar for gbonline
0
265
Member Avatar for hemant_rajput

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() …

Member Avatar for hemant_rajput
0
466
Member Avatar for Jx_Man

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 …

Member Avatar for Dani
0
226
Member Avatar for mrcerimo

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 …

Member Avatar for mrcerimo
0
401
Member Avatar for LDJ95

[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 ''.

Member Avatar for LDJ95
0
850
Member Avatar for Labdabeta

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.

Member Avatar for Dani
0
311
Member Avatar for nickecarlo
Member Avatar for TrustyTony
0
230
Member Avatar for tauqeer ahmed
Member Avatar for frivolous
Member Avatar for TrustyTony
0
59
Member Avatar for guidely

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 …

Member Avatar for TrustyTony
1
1K
Member Avatar for utkarshsahu

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.

Member Avatar for TrustyTony
0
125

The End.