15,175 Topics
| |
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(), … | |
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. … | |
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] … | |
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 … | |
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 … | |
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 … | |
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. … | |
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 … | |
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? | |
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 … | |
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 * … | |
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 … | |
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 … | |
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 … | |
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] | |
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 … | |
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? | |
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 ? … | |
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 … | |
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 = … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 = … | |
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 … | |
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 … | |
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: … | |
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 … |
The End.