15,175 Topics

Member Avatar for
Member Avatar for Fractilion

There's two different things I'm trying to figure out how to do with Python. First, when I want my program to go through a function, which then moves on to another function..... so say I start with main(). I have variables A and B. I go on to function Do_This(), …

Member Avatar for bvdet
0
106
Member Avatar for MaxVK

Hi. I have an HTML Control on my frame and I am able to display pages in it: [CODE] self.krtc = html.HtmlWindow(self, style=wx.NO_FULL_REPAINT_ON_RESIZE); self.krtc.LoadPage("apitest.html") [/CODE] However, I'm having real problems trying to pick up a CTRL + C event (Or a right mouse click event) to copy any selected text. …

Member Avatar for MaxVK
0
121
Member Avatar for punmeister

Hey hey! I'm trying to write a script that finds out if a given program name exists in the OS environments PATH variable (cross plathform). Thing is, I get a NameError, it's probably a simple error, but I've struggling with it the last hour. Any help would be appreciated [CODE=python] …

Member Avatar for punmeister
0
119
Member Avatar for neta_s

Hi, I have some oython application which uses some COM server. on of the functions in the COM servers expects getting 64 bit unsigned integer (i.e. VT_UI8), but the problem is that python automatically converts 'small' integers to 32 bit integers (even if casting them to long) anf this leads …

0
33
Member Avatar for Darkangelchick

Hi guys, I'm currently working on a program to return whether an inputted number is perfect or not. I've found that the formula for the perfect number is If 2n-1 is prime then 2(n-1)(2n-1) is perfect. I've worked out some code, but I'm stuck. [CODE]Def listfactors(n): For 1=2 to n/2 …

Member Avatar for lllllIllIlllI
0
137
Member Avatar for Darkangelchick

Hey guys im doing the NCSS python challenge and I need help!! ok so here's my current problems (p.s. my teach cant even help) PROBLEM 1 ************************ [code]# This is a Python file def fibonacci(n): return (n <= 1) and 1 or fibonacci(n-1) + fibonacci(n-2) def decrypt(s): def helper(s): return …

Member Avatar for Darkangelchick
0
211
Member Avatar for powrhouse1

Hi, i'm new to python. I'm trying to input a stack of (prefix.tif) images, modify them to png files and output the new files as prefix.png. One code that i was told to use allows me to modify the input name by adding something to the beginning of the name. …

Member Avatar for powrhouse1
0
94
Member Avatar for aodpreacher

I want to make a python game with just the basic python library and Tkinter.. is this possible ? and also where would i go to find the logic behind the Simon Game..the memory part so it makes the buttons click and remember each time? also this is for a …

Member Avatar for Freaky_Chris
0
98
Member Avatar for adam291086

Some languages like C# create an Auth object to authenticate themselves on a soap server. for example [CODE] cpLatestBrief.authValue = new auth(); cpLatestBrief.authValue.username = "username"; // your aql username cpLatestBrief.authValue.password = "password"; // your aql password [/CODE] how can you do this with python?

Member Avatar for adam291086
0
98
Member Avatar for kempablavitt

Hi! I need help with a memory game. I dont know how to do when I want the users choice to appear. The function guessing. I want the user to first write e.g. A1 and then B2. and the doldmatris() is the one with the words. Then the start function …

Member Avatar for Murtan
0
262
Member Avatar for DarkSam

I need help with this problem Generating Random Cities Write a function called generate_cities(min_x, max_x, min_y, max_y, n, distance) that generates a list of cities with random coordinates. The parameters represent the following: * min_x, max_ x: the minimum and maximum values for the x coordinate of each city * …

Member Avatar for Murtan
0
81
Member Avatar for Stefano Mtangoo

I enter first time and works fine, but second time? Boom, it fails! What is wrong Best regards: [CODE=python] #Global values #key is ID/name and value is cost product = dict() identity = dict() #Function to check and add product and its ID def get_prod(): #anything can be a name …

Member Avatar for Stefano Mtangoo
0
70
Member Avatar for lllllIllIlllI

Yesterday, i was programming a program in Java when i came accross something i though was just amazing. I could read and write complete Obects with just one line of code! They would go to a file and when i loaded then they would be straight back, without me having …

Member Avatar for lllllIllIlllI
0
84
Member Avatar for adam291086

I am trying to read in a simple xml file and display all the child elements all i get is the error [QUOTE]Traceback (most recent call last): File "/Users/adamplowman/Documents/Uni/project/python/test_xml.py", line 10, in <module> for element in tree: TypeError: iteration over non-sequence[/QUOTE] Here is the xml file [CODE]<root><child>One</child><child>Two</child></root>[/CODE] and this is …

Member Avatar for adam291086
0
164
Member Avatar for adam291086

I have the variable Adam that contains some information. Later on i have some more information to add to the variable adam. How can this be done something like [CODE] adam = "john" adam = adam + "mike" [/CODE]

Member Avatar for paddy3118
0
90
Member Avatar for Stefano Mtangoo

Hello All Greetings I want to use Lame enc windows DLL procedures. I'm not very dipped in DLL things but it is that I want to use it in my Encoder. Any way can I use it in python?? Also Any suggestion on CD ripping library and Vobis/Ogg/Flac/wma encoder library …

Member Avatar for Stefano Mtangoo
0
193
Member Avatar for ihatehippies

Im trying to write a script that can return directions to an address from google. I've looked over urllib for a while and I cannot figure out how to send the information to the server and then retrieve the directions.. any ideas?

Member Avatar for ccandillo
0
239
Member Avatar for Prahaai

Good day. I wanted to share with you the code for an application I've created. It can read the number of pages in all the PDF files from one directory. The question I have is this : does it need more optimisation ? Can I make it work faster ? …

Member Avatar for Prahaai
0
4K
Member Avatar for OB_

Hi there, new programmer/python user here. What I'm trying to do, is simulate the rules of a tabletop RPG (not nerdy in the slightest). This is using a 10-sided die. In the game when you roll a 10 the dice "explodes" and you roll it again and add the next …

Member Avatar for Gribouillis
0
76
Member Avatar for dseto200

What's the command that allows you to do that. The chapter that i'm reading lists slicing, but I don't see how that helps if you don't have a fixed value of the word. [Code=Python] # Program that gets a message from user and computer prints it out backward. message = …

Member Avatar for dseto200
0
222
Member Avatar for rastaberry

Greetings, I would like to make a programm that would generate a long string of numbers or characters in the way that the user firts states how long the so called word should be (let's say 10 000) and will also state the rules for creating the word: i.e. 1 …

Member Avatar for rastaberry
0
85
Member Avatar for goldsm

I am writing a program using Python and the PYOpenGL3 library. I am trying to use PY2Exe to create an executable version of my program. However PY2Exe does not support PYOpenGL3. Is there an alternative to PY2Exe I can use? Basically I need a way to create an executable version …

Member Avatar for vegaseat
0
88
Member Avatar for Bouzy210

I am trying to write a script where it traverses the current folder and all subfolders and files and prints to screen the name of the files, filesize, and date last modified. e.g. test0.xml | 26 bytes | 11/21/08 23:35:28 (I can get it to do this) Folder/test1.xml | 26 …

Member Avatar for Bouzy210
0
115
Member Avatar for ping24

Hi Guys, I want to write a parser in python. But I am not able to understand that what could be the starting point(some urls and references) so that I can write simple parsers. I just want to have some basic ideas on py parsing methods and techniques. Well I …

Member Avatar for Gribouillis
0
75
Member Avatar for ccandillo

OK, this may be a dumb question but I'll ask anyway. I am starting to see the benefits of using classes. Most notably code reuse, inheritance and overloading. Shoud I still be writing fuctions in my scripts or do classes make them obsolete? Is there a rule of thumb that …

Member Avatar for Stefano Mtangoo
0
139
Member Avatar for tomtetlaw

I'm making a text game and im making a save() and load() function i'v got the save function to work but i dont know how to change varyables in the program depending on the varyables in the text files. heres the code for the functions: [code=python] def save(): openfile = …

Member Avatar for tomtetlaw
0
101
Member Avatar for payne_99

Hello! I'm trying to execute a simple script in the command line, and for some reason, it's not working. Shouldn't it be as simple as this? [code]python myscript.py[/code] And yet when I try that, I get "Syntax Error: invalid syntax" I've googled around, read through the docs--I have a feeling …

Member Avatar for lllllIllIlllI
0
124
Member Avatar for MaracKoMarac

Hy all. I'm beginner in Python ( started to learn it before a week and a half), but since I already know MSWLogo, python is easy. So, I created a fighting-text game called: PythonFight. Features: -10 fights -4 normal kicks and 1 special -rage -bonuses after round. Please download and …

Member Avatar for numonic
0
53
Member Avatar for mrkuchbhi

hi! i have a program which makes use of threads(threading module) it runs fine when i run it using python(2.6).. however when i create an exe of the file(using py2exe) and then run it, the following error occurs.. [code]Unhandled exception in thread started by error in sys.excepthook: original exception was: …

0
75
Member Avatar for overmind

hi everyone, can you please help me out. what i want is to have a server that listens to a single port for clients to connect using tcp. this is located in a thread. if one client connects, it would relocate this connection to another thread so that the first …

0
63

The End.