14,952 Topics

Member Avatar for
Member Avatar for mohankumar554

hi i got an error, " 'none type' object is unsubscriptable"... so how to avoid this error.. can u tell me.

Member Avatar for lllllIllIlllI
0
177
Member Avatar for mohankumar554
Member Avatar for mohankumar554
0
97
Member Avatar for gotm

It keeps giving me this elif syntax error in line 103 and I have NO idea where it's coming from. UGH!!! [code=python] #!/usr/bin/python import os.path #nxn board, in this case n = 10 n = 10 #will hold the positions similar to n-queens allPositions = [] #current state of board …

Member Avatar for woooee
0
175
Member Avatar for ! !

[url="http://www-128.ibm.com/developerworks/opensource/library/os-cherrypy/?ca=dgr-lnxw01CherryPy"]http://www-128.ibm.com/developerworks/opensource/library/os-cherrypy/?ca=dgr-lnxw01CherryPy[/url] [url="http://pyre.third-bit.com/pyweb/index.html"]http://pyre.third-bit.com/pyweb/index.html[/url]

Member Avatar for Arkapravo
0
132
Member Avatar for Spag

Ok so I've picked up some literature and reference books for Python as it has started to interest me in the past few weeks. Now a project has rolled around at uni and I was wondering if I could use Python for what I need to do and then learn …

Member Avatar for scru
0
122
Member Avatar for DimaYasny

Hi all, I was searching for an IDE that is capable of Python GUI drawing, much like MSVS can draw GUI windows without actually having to code them manually. Atm I use NetBeans 6.5 for Python, but I can switch. Yeah, I'd prefer a Linux based IDE of course :) …

Member Avatar for DimaYasny
1
984
Member Avatar for gsingh2011

I just learned how to use py2exe to turn a helloworld.py script into a helloworld.exe script. But when I do it for something more complicated, I get an error. The exe is created, but when I run it I get an error: C:\Documents and Settings\Gulshan\My Documents\Python Scripts\dist>snake.exe snake.exe:85: RuntimeWarning: use …

Member Avatar for Arthurharr
0
242
Member Avatar for linux

Is it possible to get a single key press without having the user press enter? So, say if you were writing a game, say an RPG, to high WASD to move. Ie: [code=python]x = getkey() if x = "w" # blah blah blah if x = "a" # blah blah …

Member Avatar for EAnder
0
14K
Member Avatar for tomtetlaw

[code=python]fout = open( 'tf2 file test.txt', 'r' ) fout.seek(0) items = [] for index, line in enumerate( fout.readlines( ) ): val = line.split('=').strip() items.append(val) for item in items: print item [/code] For some reason it's telling me that strip is undefined?

Member Avatar for woooee
0
142
Member Avatar for ofranko

i'm a school teacher writing an addition app using Python. It was going ok but i didn't like the editor so i found a new one(NetBean6.5). i copied/pasted my code but the NBeans editor is looking for a "main" module... i've done a little c++ so i understand what it's …

Member Avatar for vegaseat
0
106
Member Avatar for daviddoria

If I have /home/doriad/Scripts/Python/ and inside I have a bunch of folders, ie Geometry, Math, Other, etc that each contain scripts (.py files), is there a way I can just add /home/doriad/Scripts/Python to PYTHONPATH and then somehow [code] from Geometry/Spherical import * [/code] rather than having to add every subdirectory …

Member Avatar for vegaseat
0
2K
Member Avatar for evilsage4

k, so I'm sort of a python newbie. And a unicode newbie too. On the webpage: [url]http://www.mangaupdates.com/series.html?id=1580[/url] I want to be able to scrap the following line (html): [code=html] Associated Names</b></div> <div class="sContent">ロザリオとバンパイア<br>吸血鬼女友<br>로자리오와 뱀파이어<br>Rosario + Vampire<br>Rosario+Vampire<br> [/code] how ever, when I scrap it. all the asian character a returned like …

0
61
Member Avatar for ithelp

I have one related question is Jython going to replace Python in a few year ?

Member Avatar for jlm699
0
107
Member Avatar for ning2009

Hi, there With a lot of help in this forum, I strated to use Python to accomplish something. Here I am looking for guide about how to improve my code speed. This code is to determine the normal direction of a polygon with four points. Every four points have 6 …

Member Avatar for ning2009
0
210
Member Avatar for xsxcn

I am considering using python to write a simulation program to display the motions of about 10,000 2d disks. The program doesn't need to calculate the positions of disks. It just reads the result file and displays disks on the screen. I wonder whether python has this ability for rendering …

Member Avatar for targ
0
157
Member Avatar for ofranko

using - python 3, python shell i've tried looking online and in a couple of books, but i can't find an explicit example of creating an exe. could one of ya'll share the steps? ty, frank

Member Avatar for vegaseat
0
119
Member Avatar for hunterm

I thought I understood how tuples work, but that is not the case. [code=python] lose = ['skldhf', 'laweoirht', 'skdljhflkjhs'] print lose [/code] How would I get it to print of the three phrases randomly? No, those aren't what I will be actually using, I just haven't come up with what …

Member Avatar for hunterm
0
114
Member Avatar for CommanderOne

Hey, I'm new to the language and was hoping someone could give me a bit of a hand. [language=code]def common_elements(list1, list2): """ Return a list containing the elements which are in both list1 and list2 >>> common_elements([1,2,3,4,5,6], [3,5,7,9]) [3, 5] >>> common_elements(['this','this','n','that'],['this','not','that','that']) ['this', 'that'] """ list3 = [] for item …

Member Avatar for CommanderOne
0
83
Member Avatar for bhanu1225

Hello All. I created a login form, which has two fields named "USER ID " & "PASSWORD". Here, i took 8 character length for USER ID field. I would like to take "THE" as first three characters as constant in USER ID field. So, is it possible to do it? …

Member Avatar for bhanu1225
0
73
Member Avatar for wavefront

Hello, I am new both to here and to Python. This is my first attempt at writing an actual code in Python 3; I've run into a problem with my class declaration, however. It may be a glaringly obvious problem, but it's not to me, so hopefully someone might spot …

Member Avatar for wavefront
0
134
Member Avatar for jdoppke

I'm trying to do some simple DDE to talk to another windows process. Does anyone have any examples of creating a connection, sending a query and getting the results? I'm finding zero documentation on the DDE module. The demo directory that came with it has very little.

0
38
Member Avatar for CommanderOne

Hey, Kinda new to this, and trying to assemble some simple code, but I'm having a couple of issues that I hoped someone would be able to help me out with. 1) I would like to be able to remove duplicates from a submitted sentence, leaving only the first occurance …

Member Avatar for woooee
0
134
Member Avatar for Deman

I've got a Frame Object that creates all the GUI for my program, and I'm trying to call it in my main function and send it some arguments to use. However, I cant figure out where I need to add them into the object so that it will except them …

Member Avatar for woooee
0
156
Member Avatar for txwooley

I am fairly new to Python, but trying to make a poker game. How do I determine the winner? I have 'scored' the hands 1-8, and given sub-scores for the high card, but how do I compare the scores of 4 players and then in the event of a tie, …

Member Avatar for txwooley
0
332
Member Avatar for tomtetlaw

Is there any way to check if the script is being run in the Windows command line?

Member Avatar for _Nestor
0
62
Member Avatar for comfixit

I have the following CSV file ['ID', 'ABD', 'ABD', 'ABD', 'ABD', 'ABD', 'PC'] ['1', 'N400', '', '', '', '', 'P1000'] ['2', '', 'N401', 'N402', '', '', 'P1001'] ['3', '', '', '', 'N500', '', 'P1002'] The data is not stored in an ideal format. The first row has some pretty useless …

Member Avatar for targ
0
189
Member Avatar for pvi101

Hi all, I am a Python Newbie and started learning it with this book "Programming in Python 3", which has a lot of sample codes. So I am using Python 3 and got stuck while trying this program.The program is to swap the elements in the Tuple and how to …

Member Avatar for supernovicevn
0
196
Member Avatar for Kekalove

help me design a For loop that displays the following set of numbers: 0, 10, 20, 30, 40, 50......1000

Member Avatar for slate
-2
99
Member Avatar for Whelk

I'm trying to set up a login procedure. Here's what I'm trying: [code="python3"] import users import sys print() print("Please enter your username.") print() username = input(">") if username not in users.usrlist: print() print('User does not exist.') sys.exit() else: user = users.username print() print('Please enter your password. Note that for security …

Member Avatar for woooee
0
143
Member Avatar for Prahaai

Good day. I have a problem with matrices / arrays, i cannot resolve. I have no idea how to start... I have two 2D matrices and i want to overlap (mix?) one over the other, no matter what dimensions they have. For example : a = [ (1,2,3,4,5), (9,7), (0,0,0,0,0), …

Member Avatar for scru
0
274

The End.