15,175 Topics
| |
How do I get a recursive function to return a value other than None? For example: [CODE]def function(depth): if depth > 0: function(depth - 1) else: return 10 function(5)[/CODE] returns None, and not 10. | |
Hi. So, I'm coding this GUI into a sort of quiz. I'm not sure how to explain what I plan to do so I will write it out in a pseudo code. I know this isn't the most efficient way at all to do this, but I'm just focused on … | |
Hey guys, I really appreciate your help so far! :) This one is a tough beast... I don't even know how to approach it. Let me give you a summary version and a detailed version. Summary version: There are all sorts of these XML files scattered within a bunch of … | |
I found one interesting site while I was fooling around ... I mean Googling around: [url]http://python-history.blogspot.com/[/url] Maybe you would like to check it out. One of the guys blogging is quite famous in these circles: Guido van Rossum. | |
Hi i'm stuck on this script that i'm busy writing and have no idea where to start. I need a script that connects to a secure ftp, downloads files and store it on my local pc. has anyone done something similar and which modules should i be looking at. | |
Hi, I have a file that has about 65000 lines and three columns. I need to read in the first 2 columns until line 112960. I then need to write the 12960 lines of 2 columns to a file. This needs to be repeated for about 600 files... I then … | |
hi I can change dictionary values but I can't figure out to change the keys.. here is the scenario I want.. A dictionary is coming like this {'fstn':'Tim','lstn':'Parker','mdl':'W','dob':'19801201'} now I need to change to {'FIRST_NAME':'Tim','LAST_NAME':'Parker','MIDDLE_NAME':'W', 'BIRTH_DATE':'19801201'} please help me to change the keys.. | |
Hi I'm very new to Python Language, I'm getting this error "AttributeError: 'str' object has no attribute 'internalSplit'" and don't understand why. please check the following code.. [CODE] sourceAction = str(sourceAction); identityInfoDict = dict(identityInfo); for key in identityInfoDict.keys(): if(key.find("GENESYS_DATA") >= 0): intDict = self.internalSplit(key,identityInfoDict)[/CODE] and the internalSplit is a function … | |
| Evening all. I have decided to try my hand at programming in python. I have tried some of the tutorials on the web but none of them really hold my interest for long. I am looking for a tutorial that covers all the basics and goes quite indepth. All the … |
I'm new to Python and I'm having a problem I can't explain. While running: [CODE] >>> open('word.txt') [/CODE] it returns: No such file or directory: 'words.txt', even if I have both files saved in the same place. I've tried entering the entire file location, but still no luck. Any help … | |
When I try to run a C program that calls a Python function, I am getting this error: [QUOTE]ImportError: /usr/local/depot/python-2.5.1/lib/python2.5/lib-dynload/math.so: undefined symbol: PyExc_OverflowError[/QUOTE] Please help me resolve this. | |
Hello, I just finished my "Who wants to be a millionaire Game", (very basic coding), but I got some issues when I click somewhere out of the Boxes range(try it), and I'd like to add some sort of points to each question, and as they go further make the question … | |
When I run my code the program adds the following before the start of my program: >>> Warning (from warnings module): File "C:/Users/Steven/Documents/CA/CA python/CAMain.py", line 142 def maxgen(fname, worksheet=1,encoding='cp1251'): SyntaxWarning: import * only allowed at module level >>> [I]The first prompt of my program would be here[/I] The code it … | |
Is is possible to check if the execution of a java program from python gives any error during runtime and compile time ? Any help or sample code will be of real help.. Thanks in advance | |
Hii I am have suffering few problems in doing following assignment , please help me... Qtprogram using python to calculate addition, subtraction. please help me ...i am new python | |
While doing a project i decided to do a mechanism in a panal of its own class, so i could manage the sizers and layout better, then i wanted to take the end result of that panel and display it in my window. Although when i run this code as … | |
How do I convert the integer -2 to its hex 0xfe??? I tried hex() but it gives me -0x2 | |
I have various list being generated by a mapper function in this format >>> mapper("b.txt" , i["b.txt"]) [('thats', 1), ('one', 1), ('small', 1), ('step', 1), ('for', 1), ('a', 1), ('man', 1), ('one', 1), ('giant', 1), ('leap', 1), ('for', 1), ('mankind', 1)] >>> mapper("c.txt" , i["b.txt"]) [('thats', 1), ('one', 1), ('small', … | |
Hi Friends, I want to parse a header file and auto generate a .cpp file. Can any one please suggest me good link in doing so or provide me a sample python script which will automatically generate a .cpp file. I planning to using VC++ pre-build event to call this … | |
I'M learning python and I can write very small simple programs with Tkinter or play sound through pygame. I've just started the book "Beginning Game Development with Python and Pygame". I'M in the earlier part of the book and I've just been given the program below. The thing is, even … | |
numpy.vectorize takes a function f:a->b and turns it into g:a[]->b[]. This works fine when a and b are scalars, but I can't think of a reason why it wouldn't work with b as an ndarray or list. For example: [CODE=python] import numpy as np def f(x): return np.array([1,1,1,1,1], dtype=np.float32) * … | |
hello, i created an executable from a python project, with py2exe & cx_Freeze for testing, and both versions work fine on my Windows OS, but none work on other PCs (Win32), when i start the executable it says : 'The application has failed to start because the application configuration is … | |
Hello, im starting a new project, about the game who wants to be a millionaire, so In the beggining I have a Start Button, but I want to know how to set the parameters of the mouse click to be only within the range of the START button. heres what … | |
Hello, I'm sure there is a simple solution to this but I cannot seem to find the information I need in my textbook or online. I'm creating a GUI with an entry box for the user to input their name. I then use getText() to retrieve the name they entered … | |
Hello there, i have this problem when i try to combine a variable file name that is in languages other than English with a path, like this : path = 'C:\\Files\' path+=UnicodeName+'.txt' it gives the following error : UnicodeDecodeError: 'ascii' codec can't decode byte 0xda in position 7: ordinal not … | |
Hello everybody! I have to go through each subfolder and extract matching strings from each of the files (File_1, File_2, File_3, File_4, etc.). Unfortunately, I don't know how to do that under Linux. I have the following structure: MainFolder: ---Subfolder A ------File_1 ------File_2 ------File_3 ---Subfolder B ------File_4 ------File_5 ------File_6 ---Etc. … | |
[ICODE]class classA: #saved as classA.py def __init__(self): print "class A" printB() def printB(): print "B"[/ICODE] [ICODE]>>> classA() class A Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> classA() File "C:\Documents and Settings\Owner\Desktop\timetable\classA.py", line 5, in __init__ printB() NameError: global name 'printB' is not defined[/ICODE] Using the class … | |
Hi, I've been trying to make a poker game, i got the basic things running like giving the cards to the player and dealer, but i am having trouble coming up with a way to compare the 2 hands... I'm new to python, i tried different ways and didn't really … | |
Hello, I could use a spot of help today. I am very new to python (n00b) and I have a rather specific Issue I am trying to resolve. This problem can be solved using ArcGIS (for those who know it) I simply desire to know more about python so I … | |
Is there way to get the graphics card details in python. please help me in achieving this |
The End.