3,386 Posted Topics

Member Avatar for jim.lindberg1
Member Avatar for hughesadam_87
0
138
Member Avatar for crishein14

py2sis should support autostart since version 1.4.1, quote Changes in 1.4.1 from 1.4.0: ----------------------------- * telephone module improved * position module improved * autostart support added to py2sis It is part of [Ensymble](https://code.google.com/p/ensymble/wiki/Welcome) You must have sis officially signed: --autostart -g Flag to control automatic startup of the application. On …

Member Avatar for M.S.
0
173
Member Avatar for crishein14

Read the documentation of os module to find suitable command and use a loop and string formatting to do zero padded number: print('%03i.txt' % 5) Output: 005.txt

Member Avatar for M.S.
0
174
Member Avatar for bflack

clrscr is not standard c, this is just replacing normal loop with recursion, you can allways do that without too much difficulty, usually with increased memory use and running time. I can not see anything tricky here.How about not allowing recursion also and producing 1024 messages fixed. Maybe slightly more …

Member Avatar for SoreComet
0
4K
Member Avatar for rbsmith333
Member Avatar for nitin1
Member Avatar for nitin1
0
110
Member Avatar for Pyler
Member Avatar for nitin1

It may well be that **patience** is more essential property than being excellent programmer.

Member Avatar for nitin1
0
245
Member Avatar for yindra.puentes

This is string array, not number array! array=['NaN', '20', '383.333', 'NaN', 'NaN', 'NaN', '5', '100', '129', '122.5', 'NaN', 'NaN']

Member Avatar for TrustyTony
0
393
Member Avatar for oscargrower11

start /MIN calc also does not start minimized from command line, so it must be problem with the program started, not the command. The wordpad starts minimized with your code and full path (as it is not in PATH in my computer).

Member Avatar for TrustyTony
0
349
Member Avatar for toyotajon93

>>> data = [[278,278,-1,[25076,u'name',3,6,u'',0,0,1,[0,0,None,5]]]] >>> data[0][:3] [278, 278, -1]

Member Avatar for vegaseat
0
196
Member Avatar for lewashby

lines 1 and 2, you should not write output in case input file is missing in first section.

Member Avatar for TrustyTony
0
68
Member Avatar for lewashby

Add to beginning from __future__ import print_function You could use the Python2 style print, but learning Python3 style is worth it as it is more flexible and compatible with Python3.

Member Avatar for lewashby
0
202
Member Avatar for Kert
Member Avatar for ZZucker
0
343
Member Avatar for TrustyTony

My snippet for code snippet competition http://www.daniweb.com/software-development/python/code/426990/split-string-except-inside-brackets-or-quotes is completely messed up. System clitch?

Member Avatar for TrustyTony
0
265
Member Avatar for HTMLperson5

You can also remove your details from your user page and disable the emails from Daniweb, no need to delete account.

Member Avatar for peter_budo
0
578
Member Avatar for danifj

low, high = 10, 100 values = [12, 14, -34, 25, 200, 23, -23, 45, 23] for i in range(1,len(values)-1): if values[i] < low or values[i] > high: # assuming that first value and last value are not off # and neighbouring values are not off values[i] = (values[i-1] + …

Member Avatar for Xantipius
0
152
Member Avatar for ruby.ghata
Member Avatar for TrustyTony
-1
185
Member Avatar for deepthought

Can not say anything, as I do not understand what you are talking about. No data.

Member Avatar for deepthought
0
404
Member Avatar for pritaeas

I just wander how it deals with important issue when you should maybe use language string processing features instead, or parser (eg html).

Member Avatar for pritaeas
1
251
Member Avatar for rmbrown09

You give very little information on your data, but for what you need the re for? print '_'.join(s for s in "[ k '0 ir e ]".split() if s.isalpha()) # Output: # k_ir_e >>>

Member Avatar for TrustyTony
0
242
Member Avatar for deceptikon

Concratulations on your first code snippet deceptikon! #define TEST_DRIVER #ifdef TEST_DRIVER This is obviously allways defined, so I assume the purpose is to comment out or remove the define if done debugging. Maybe that could be left for a [command line option to compiler](http://www.rapidtables.com/code/linux/gcc/gcc-d.htm) defining TEST_DRIVER but that of course …

Member Avatar for deceptikon
0
345
Member Avatar for rotten69

Yes, looks like you Walt have around 10 threads outside Community Center. It is natural for (hu)man to be shy on needing to ask, but really, when it was such a terrible thing for your image? Compare to the times you really should have asked and became ashamed you didn't! …

Member Avatar for Reverend Jim
0
312
Member Avatar for felgall
Member Avatar for bverhaar
Member Avatar for TrustyTony
0
191
Member Avatar for TimLloyd31

Bubble sort is really bad performer and implementing insertion or selection sort instead is not any harder. Best is of course to use the sort from algorithm instead of reinventing the wheel.

Member Avatar for np complete
0
2K
Member Avatar for dan.nitschke

You can also use strip (which is very fast, fastest pandigital check is for example by using lengths and strip('012356789')) # -*- coding: latin1 -*- from string import letters def is_alpha_space(name): return False if not name.strip() else not name.strip(letters+' ') name = "Väinö Veijalainen" print(is_alpha_space(name)) # True name = "Mark …

Member Avatar for vegaseat
0
5K
Member Avatar for TrustyTony

Because of [the course](https://www.edx.org/courses/BerkeleyX/CS169.1x/2012_Fall/about) I think to take to improve employment changes by SaaS, Ruby and Rails and basic agile techniques, I looked little the Ruby forum. Unfortunately it seemed in quite a sorry state some months old questions unanswered. Even there was a related article from one of them …

0
99
Member Avatar for Lardmeister

from __future__ import print_function item1, item2 = 'abc', 'def' print(item1, end='') print(item2)

Member Avatar for Ene Uran
0
245
Member Avatar for Doormail11

You must tell more clearly what would be expected output. There is also three kinds of IAV bits of info on lines: "DHP of IAV" "IHP of IAV" and "IAV" >>> if 'IAV' in "PA,IAV protein,AC0T9,DHP of IAV,2znl-A+z327-A": print('IAV in line') IAV in line >>>

Member Avatar for TrustyTony
0
205
Member Avatar for ProNewb

You should save the split lines, not do readlines and overwrite variable with split data leaving the last lines split data in variables. Indention and variables of line 18 does not make sense.

Member Avatar for TrustyTony
0
159
Member Avatar for D33wakar

You do not call \__init__ explicitely like you do at line 113, and it has no return value, but the returned value is the object created. You are not using the game instance to anything, so why the class? You are doing strange chain of action from \__init__ return through …

Member Avatar for TrustyTony
1
712
Member Avatar for padton

I unfortunately do not know so deeply to csv module, but maybe you trying to do something like this (without file input to leave something to you also to do): from collections import OrderedDict data1 = """ 1,19.0,18.2,22.4 2,8.4,9.4,10.2 4,22.2,2.5,3.1 7,3.2,6.1,4.3 10,3.1,4.2,33.7 11,3.7,23.8,23.4 """.splitlines() data2 = """ 1,4.2,7.3,9.5 2,4.1,8.4,9.2 4,2.3,4.6,3.2 …

Member Avatar for woooee
0
165
Member Avatar for nishu..

If I understand correctly, question is about https://developers.google.com/appengine/

Member Avatar for hughesadam_87
0
175
Member Avatar for Tortura
Member Avatar for Frensi
Member Avatar for rexmorgan

> plist = [float(x) for x in item[start : end]] #having trouble with blanks You could add default value like plist = [(float(x) if x else default) for x in item[start:end]]

Member Avatar for rexmorgan
0
1K
Member Avatar for wootburgers
Member Avatar for TrustyTony
0
264
Member Avatar for wootburgers

It's called palindrome and easiest is to just comparenstrimg with reversed string. But your example GUA....GUG is not one!

Member Avatar for wootburgers
0
259
Member Avatar for TrustyTony

Here is slow brute force way to find the largest palindromic product of three digit integers. You could do loop and break out of it if you go under the smaller number (the second one) of best solution found so far to be more efficient etc.

Member Avatar for hughesadam_87
0
558
Member Avatar for M.S.

@Lardmeister: So do I oldnames = ','.join("""Mary,Helen,Margaret,Anna,Ruth Elizabeth,Dorothy,Marie,Florence,Mildred Alice,Ethel,Lillian,Gladys,Edna Frances,Rose,Annie,Grace,Bertha Emma,Bessie,Clara,Hazel,Irene Gertrude,Louise,Catherine,Martha,Mabel Pearl,Edith,Esther,Minnie,Myrtle Ida,Josephine,Evelyn,Elsie,Eva Thelma,Ruby,Agnes,Sarah,Viola Nellie,Beatrice,Julia,Laura,Lillie Lucille,Ella,Virginia,Mattie,Pauline Carrie,Alma,Jessie,Mae,Lena Willie,Katherine,Blanche,Hattie,Marion Lucy,Stella,Mamie,Vera,Cora Fannie,Eleanor,Bernice,Jennie,Ann Leona,Beulah,Lula,Rosa,Ada Ellen,Kathryn,Maggie,Doris,Dora Betty,Marguerite,Violet,Lois,Daisy Anne,Sadie,Susie,Nora,Georgia Maude,Marjorie,Opal,Hilda,Velma""".splitlines()) newnames = ','.join("""Emily,Madison,Emma,Hannah,Abigail Olivia,Ashley,Samantha,Alexis,Sarah Elizabeth,Isabella,Alyssa,Grace,Lauren Taylor,Jessica,Brianna,Kayla,Sophia Anna,Natalie,Victoria,Chloe,Sydney Jasmine,Hailey,Megan,Rachel,Morgan Julia,Destiny,Ava,Jennifer,Kaitlyn Mia,Katherine,Alexandra,Haley,Savannah Nicole,Maria,Allison,Mackenzie,Stephanie Brooke,Amanda,Ella,Makayla,Faith Kaylee,Jenna,Andrea,Katelyn,Mary Jordan,Gabrielle,Rebecca,Paige,Madeline Kimberly,Trinity,Zoe,Michelle,Sara Lily,Kylie,Alexa,Caroline,Vanessa Amber,Angelina,Gabriella,Lillian,Riley Sierra,Danielle,Leah,Jada,Autumn Erin,Maya,Ariana,Audrey,Isabel Sofia,Marissa,Bailey,Jacqueline,Melissa Claire,Evelyn,Shelby,Jocelyn,Mariah Avery,Leslie,Melanie,Arianna,Aaliyah""".splitlines()) common = …

Member Avatar for vegaseat
2
273
Member Avatar for python1956

They are OK, just list of tuples intead of list of tuples. What kind of errror are you getting? Your data must be homogenous to produce a 2d numpy array: http://stackoverflow.com/questions/9534408/numpy-genfromtxt-produces-array-of-what-looks-like-tuples-not-a-2d-arraywhy

Member Avatar for vegaseat
0
545
Member Avatar for hchikutu

Maybe the politeness of rule * **Do** provide evidence of having done some work yourself if posting questions from school or work assignments May confuse non-native English speakers. For those maybe the rule should be * **If you expect any kind of help** you better show evidence of having done …

Member Avatar for TrustyTony
0
178
Member Avatar for depy
Member Avatar for Sanjam.kumar

You inspired me to post this code snippet to Python forum: http://www.daniweb.com/software-development/python/code/432797/brute-force-check-for-largest-palindromic-product-of-three-number-integers

Member Avatar for WaltP
0
345
Member Avatar for BobTheLob

You forgot to put in your code. Do not forget first to push CODE before pasting.

Member Avatar for Ene Uran
0
6K
Member Avatar for theadmiral99

This would appear clearer way to express your algorithm: abbreviation = raw_input("Abbreviation: ").lower() text = raw_input("Text: ").lower().split() for position in range(len(text) - 2): if all(text[position + ind].startswith(abbreviation[ind]) for ind in range(3)): print ' '.join(text[position:position+3])

Member Avatar for TrustyTony
0
190
Member Avatar for beela16

You could indent code properly following Python rules and then you can just code taking one step at time and testing/printing the partial results for debugging.

Member Avatar for Lardmeister
0
287
Member Avatar for Jacklittle01

You have unterminated string at line 13 and some other syntax errors fix them and also the unnecessary recursion at line 29. YOur code is not fully inside a code block.

Member Avatar for M.S.
-1
170
Member Avatar for nova4005

I would fix it like this: def main(): x = input('Enter a starting value: ') y = input('Enter an ending value: ') # add one to odd starting value and add one to end value to # also get y included for i in range(x + (x & 1), y …

Member Avatar for nova4005
0
148

The End.