3,386 Posted Topics

Member Avatar for johanngomes

'qwerty'.join('""') or '"qwerty"' You should post more data of what you want to accomplish if these do not produce what you want.

Member Avatar for Schol-R-LEA
0
688
Member Avatar for TrustyTony

What modules come builtin with your Python? Let's exclude the internal _ starting ones for this question. You know those? Are you sure? Good, because I did not! (Hint WindowsXP and Python2.72 has 27 builtin modules) Here the answer in code [CODE]import sys print('\n'.join(n for n in sys.builtin_module_names if not …

Member Avatar for Gribouillis
0
304
Member Avatar for LordSnow

I do not see any Computer Science point in your post, more like Windows question as I do not thonk InstallShield exist for other operatinbg systems.

Member Avatar for TrustyTony
0
124
Member Avatar for siddiqui_1985

Try harder, your code has around 10 bugs and it does not compile because of line 10!

Member Avatar for bajishareef
0
181
Member Avatar for 7sisters

Is the order of lines significant? You could read lines in from both files in one list, change values to float numbers. Sort by x.y to bring near points near each other so you do not need to compare distance of every point from each other. But what if distance …

Member Avatar for 7sisters
0
163
Member Avatar for debasishgang7

This one is very good: [url]http://docs.python.org/tutorial/inputoutput.html[/url]

Member Avatar for vegaseat
0
157
Member Avatar for vlady

I would include the letter in the tuple appended to list at line 8 or do loop over count, letter tuples of frequency and letter prepared by the zip function. I would not definately use l as variable name, use full, understandable words.

Member Avatar for vlady
0
1K
Member Avatar for Eswarimallur

The package directory is not on path or pythonpath. What is your need for Python? Did you consider [URL="http://wiki.python.org/jython/UserGuide"]Jython[/URL]?

Member Avatar for Gribouillis
0
2K
Member Avatar for TrustyTony

Lookup table is usually the fastest method to find function value, if number of values is small. Here we demonstrate the principle by using task of showing the value of byte as binary string or transforming binary string to byte binary value.

0
484
Member Avatar for weezy101

Or you can install [URL="http://pypi.python.org/pypi/blist/"]blist module from pypi[/URL] and use the sorteddict.

Member Avatar for woooee
0
185
Member Avatar for yuvalm2

Seeing your backslashes I assume you operate in windows environment. Would itnot be possible to make permanent mapping to drive letter as the direct net form is not accepted everywhere. Or at least have names set up so that you do not deal directly with IP numbers, which looks clumsy. …

Member Avatar for richieking
0
120
Member Avatar for bopiqz

The command is [iCODE]DEL[/iCODE] in Windows and[iCODE]rm[/iCODE]in Linux. And the command in text editor has usually short cut ctrl-N.

Member Avatar for Celtrix
-2
121
Member Avatar for TrustyTony

Concratulations for [URL="http://www.daniweb.com/members/debasisdas/149842"]debasisdas[/URL] for being chosen [URL="http://www.daniweb.com/newsletter/issue.php?date=2011-06"]member of month for November[/URL] [URL="http://www.daniweb.com/newsletter/issue.php?date=2011-04"]like me[/URL]. Don't hold your breath for [B]Featured Poster[/B] sign though, maybe some time next year, I think:icon_evil:

Member Avatar for happygeek
0
229
Member Avatar for kevinmax101

I would not write objects to map. i would concider pellets only while moving PacMan. I would draw in drawing loop first existing in those cordinates: Ghost. packMan, pellet otherwice thing in map. It is not good to try to manage with only the map, you need layers.

Member Avatar for TrustyTony
0
1K
Member Avatar for Nawar

Windows 3.11 was considered somehow decent if you have huge memory (8 or even 16 [b]MB[/b] ;) ).

Member Avatar for TrustyTony
0
637
Member Avatar for TrustyTony

As 3.2 has the input bug maybe it makes sense for going with 3.1.4 (I got my computer full of zombie processes with 3.2.1rc and removed it from my WindowsXP machine) [CODE] Python 3.1.4 released Python 3.1.4 has been released. Published: Sun, 12 June 2011 13:00 -0600 [/CODE] Python 2.7 …

Member Avatar for vegaseat
0
223
Member Avatar for jeffande1966

You forgot the exact error message. Any of those lines with [0] would produce error if the list would be empty.

Member Avatar for TrustyTony
0
422
Member Avatar for Huakalero

Gribouillis' code worked for me also from WindowsXP and Python 2.7.1. I did easy_install and got version 3.2.0

Member Avatar for Huakalero
0
351
Member Avatar for metal_man

Leave the code which you have tested to be working and restart from there testing additions to program properly. Refactor code to functions.

Member Avatar for TrustyTony
0
491
Member Avatar for DOT6

I did not run your code, but checking is easier with sorted hand. Only you must first cosider the wild cards and include those for analysis.

Member Avatar for Narue
0
256
Member Avatar for markfw
Member Avatar for Gribouillis
0
122
Member Avatar for dustbunny000

[QUOTE=dustbunny000;1582267]I keep getting this error: error: unable to find vcvarsall.bat What is vcvarsall.batand why do I need it? I'm new to programming. Please explain as simply as possible!! Thanks![/QUOTE] I do not see what connection your question has with Python.

Member Avatar for Gribouillis
0
251
Member Avatar for mukthyar1255

True is builtin: [CODE]>>> dir(__builtins__) ['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'BufferError', 'BytesWarning', 'DeprecationWarn ing', 'EOFError', 'Ellipsis', 'EnvironmentError', 'Exception', 'False', 'FloatingPointError', 'FutureWarning', 'Generato rExit', 'IOError', 'ImportError', 'ImportWarning', 'IndentationError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'L ookupError', 'MemoryError', 'NameError', 'None', 'NotImplemented', 'NotImplementedError', 'OSError', 'OverflowError', 'P endingDeprecationWarning', 'ReferenceError', 'RuntimeError', 'RuntimeWarning', 'StandardError', 'StopIteration', 'Syntax Error', 'SyntaxWarning', 'SystemError', 'SystemExit', …

Member Avatar for Lardmeister
0
307
Member Avatar for chhabraamit

In DaniWeb terms the undefined behaviour could be translated: risk getting struck by lightning by Goddess Narue ;) if you use it.

Member Avatar for Narue
0
313
Member Avatar for purna501
Re: ccna

[URL="http://www.freebookcentre.net/Cisco/ciscoCcna.html"]Cisco Press[/URL], maybe?

Member Avatar for TrustyTony
0
121
Member Avatar for prakashr85

Adapt my code snippet to do [B]in[/B] test for lines instead of whole file: [url]http://www.daniweb.com/software-development/python/code/316585[/url] More simple finding word in file, showing lines containing word: [CODE]fname = 'alice.txt' find = ('cat', 'queen') with open(fname) as infile: for line_no, line in enumerate(infile, 1): lline = line.lower() if any(word.lower() in lline for …

Member Avatar for TrustyTony
0
99
Member Avatar for s1w

Maybe you are trying to do Html/XML processing with wrong tools. You should use parser, not regex.

Member Avatar for s1w
0
204
Member Avatar for lelejau

Maybe this helps: [url]http://www.delphibasics.co.uk/RTL.asp?Name=As[/url]

Member Avatar for TrustyTony
0
127
Member Avatar for goyofoyo
Member Avatar for TrustyTony
0
265
Member Avatar for bleedblue

Show what you are trying not only teacher's template. You have got the code from code snippet's and that should be more than enough help for you.

Member Avatar for TrustyTony
-1
186
Member Avatar for Mike_11

Using cls to clear teminal is consired bad, antisocial style as you are destroying output from any previously run command. That is also only working in Windows so you make your program unportable without reason.

Member Avatar for AKMafia001
0
407
Member Avatar for TrustyTony

In Python Forum's intro text link to bbcode document does not work (blank page). [url]http://www.daniweb.com/software-development/python/114[/url] link: [url]http://www.daniweb.com/forums/misc-explaincode.html[/url]

Member Avatar for Nick Evan
0
264
Member Avatar for WolfShield

You should run it from command line as [CODE]python chext.py . foo java[/CODE] But really you should fix the function as it is not using the parameters properly: [CODE]def change_ext(directory, old_ext, new_ext): for f in os.listdir(directory): base, ext = os.path.splitext(f) if ext[1:] == old_ext: os.rename(f, "%s.%s" % (base, new_ext)) [/CODE] …

Member Avatar for WolfShield
0
430
Member Avatar for colts18

Are you afraid to read the documentation? [url]http://pygame.org/docs/tut/SpriteIntro.html[/url] [url]http://pygame.org/project-Bouncy+Ball+tank-864-.html[/url]

Member Avatar for raptr_dflo
-1
473
Member Avatar for HelloPeople1

If you make distance matrix from player, it is easy for enemy to zoom in to player. Only problem is that it is too deadly. You only move one closer and check if players position is distance away in same direction, if yes no walls are between.

Member Avatar for raptr_dflo
0
317
Member Avatar for jarograv
Member Avatar for rtr18

Maybe help from here: [url]http://www.eonclash.com/Tutorials/Multithreading/MartinHarvey1.1/ToC.html[/url]

Member Avatar for TrustyTony
0
197
Member Avatar for shimooli

You would use the output of your [URL="http://en.wikipedia.org/wiki/Tree_traversal"]tree traverse[/URL] function and construct the tree next time with your corresponding constructor from same traversal order. Also you could name the nodes and list the children of each node and identify the top node (say the first one in the list). This …

Member Avatar for Narue
0
173
Member Avatar for Schol-R-LEA

You compiled the Python with same compiler? Compilers of Python and other parts should e same. Standard Python is compiled with Microsoft visual c++ 2008.

Member Avatar for Schol-R-LEA
0
695
Member Avatar for rssk

If the scripts main code should be run (no if __name__ == '__main__' condition): [CODE]selection = int(raw_input('''Select one: 1) memory 2) channelmap 3) upload ''')) if selection == 1: import memory elif selection == 2: import channelmap elif selection == 3: import upload else: print('Wrong choice') [/CODE] Better way would …

Member Avatar for rssk
0
79
Member Avatar for vgd

The code manipulates the structure through the passed pointer doesn't it? i think you are mistaken Oh Ancient One! Ternary operation in line 15 set node's pointer to equal p's next pointer if p is not null pointer or zero if p is zero (NULL).

Member Avatar for Ancient Dragon
0
120
Member Avatar for gman1991

you also got literal and variable mixed us at line 23. You better consider more than allocated amount of lines or other incorrect form so use return value of reading the file. You should also give maximum length for scanf.

Member Avatar for abhimanipal
0
164
Member Avatar for Thisisnotanid

The good randoness is sometimes little counterintuitive though, and I would not bet on uniformity of your random numbers. the Art of Computer Programming by Knuth is thing to read if you want scientific understanding about things. As example while getting to know about facts on Sudoku I ran accross …

Member Avatar for Schol-R-LEA
0
333
Member Avatar for LogicallyInsane

You are not saving the value returned from something to global variable, so global variable a is uninitialized. print(something()) would work or adding 'a = ' in beginning of line 5. It is good to start to practice correct naming from beginning, even I understand you are doing proof of …

Member Avatar for LogicallyInsane
0
86
Member Avatar for JohnRedCorn

Many ways, one of cleanest is to use '\n'.join: [CODE]strings = '''First Second Third'''.split() with open('output.txt', 'w') as output: output.write('\n'.join(strings)) # print it out to test print(open('output.txt').read()) [/CODE]

Member Avatar for TrustyTony
0
142
Member Avatar for AhmedGhazey
Member Avatar for shona_5
Member Avatar for TrustyTony
0
141
Member Avatar for silvercats

For me that sounds like difference of preemptive true multitasking (like Mac OS X) vs cooperative multitasking by relinquishing control during certain operatin system calls (like Mac OS 8. No I have not realy used Mac, but example is for Griswolf)

Member Avatar for TrustyTony
0
758
Member Avatar for e-papa

This style of encryption is very weak. If you have patience for interesting, but very long thread we had starting from this vegaseat's snippet, I think you can benefit from this: [URL="http://www.daniweb.com/software-development/python/code/216632"]Text Encryption/Decryption with XOR (Python)[/URL] See especial my devil's advocate posts on braking the encryption:icon_twisted:

Member Avatar for vidur
0
207
Member Avatar for hisan

csv does not have default column width I think, but mayby csv.writer does. If it does in the dialect you use, you can adjust it with [iCODE]csv.field_size_limit([new_limit]) Returns the current maximum field size allowed by the parser. If new_limit is given, this becomes the new limit. [/iCODE] [CODE]>>> import csv …

Member Avatar for raptr_dflo
0
5K

The End.