15,185 Topics
| |
import wx class McaMenu(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, size=(640, 432)) menubar = wx.MenuBar() file = wx.Menu() new = wx.MenuItem(file, 1, '&New\tCtrl+N', 'Creates a new document') file.AppendItem(new) file.AppendSeparator() open = wx.MenuItem(file, 2, '&Open\tCtrl+O', 'Open New document') file.AppendItem(open) save = wx.MenuItem(file, 3, '&Save\tCtrl+S', 'Save') file.AppendItem(save) save = … | |
Hello! I have some probs with this code, somehow it dont loop 10 times as it should, just one? How do i make python use a testfil.txt that already exist? I dont want to remove the old data in the file just add new data to it? In this code, … | |
Hi, I have jest started learning Python. I would like to get some help on writing a script that would delete a set number of lines from a text file which looks like this : 1846440556 1846440521 1846440491 1846440505 1846441137 1846441102 1846441080 1846441331 1846441323 1846441315 ... ... Thanks in advance … | |
And I can't get anything I write to work. I'm so far off course I think I just need a working example of import hooks in action. I've looked for examples on the Internet, but they only show what looks like correct code. They never show that code in action. … | |
Hi everybody, I would like to implement a task but I'm not sure the best way to do it. I have some objects each of which has an attribute that represent the object coordinates as a tuple. I would like to find the neighbors of each object, that is the … | |
why do I only end up with one object in the list i want to keep appending I am sure the answer is simple, thanks studRoll = [] def GetInteger(i): try: return int(i) except: return 0 class stud: def __init__(self, a, n, m): self.age = a self.name = n self.mark … | |
How do I access windows environment variables using Python? eg. if I have the following: set junk=C:\temp\junk how do I access 'junk' from python? | |
Hi, I'm trying to parse an apache log file and match the IP addresses in it. This is my code so far: [CODE] import re ippattern = re.compile(r"\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b") def matchmyip(): if ippattern.search(line): matchedip = ippattern.search(line) print matchedip.group() [/CODE] Now given a line like this from a log file: [CODE]1999-08-01 00:00:00 … | |
(A quine is a program that produces its own source as its output, typically to a file.) [CODE=Python]import sys ifile = sys.argv[0] counter = 0 istream = open(ifile) source = istream.readlines() source[2] = 'counter = ' + str(counter + 1) + '\n' if counter == 0: original = str(ifile) source.insert(5, … | |
Hi, I used SCons to create a shared library (dll) from a c++ file (hello.cpp) below. Then I used Python and it ctypes library to load in the dll and call its functions. I can load the dll and call the main function, but nothing else. I cannot call the … | |
Hello, I need some help with python GUI. There are one image(image1), two plots(plot1, plot2) in the GUI. I want they share the same axes. I tried with many methods but only found that just one axis is shared. Another problem is the image and plot redraw flicker. How to … | |
Hello all, I want to display a hyperlink in qt. For this i need to display the link for the url (as underlined text). I can achieve it easily using style sheets and the url can be opened with webbrowser module.. I want to get the clicked signal of the … | |
Hi! I am working on another program, this time it's a guessing game. I have spend so many hours late in the night, but i can't figure out how to fix this problem. I won't the program to read the input number and display if it is bigger, smaller or … | |
I have to try and echo something to a file from python, but because fot eh content of what I want to write to this file, I seem to not be getting all of what I want into the file. Here is what I WANT to echo to a file: … | |
hello, when I was writing length converter I came across this problem while statement(bold one) gives me Indentation Error that says "unindent does not match any outer indentation level" and I was wondering why's that? Could anyone suggest me how to fix it [code=python]def leng(): def milimetrai(): while True: try: … | |
Hi I'm new to Python and the book I'm using was designed for an older version of Python and consequently there are some examples in the textbook that don't work in 3.1. My first problem is with the following simple example: num1, num2 = input(" Please enter two numbers (num1, … | |
Hi there, Can anybody tell me what is[B] internal documentation[/B] and what is[B] external documentation[/B] based on the following example: def is_palindrome(s): '''If the str is a palindrome which is a phrase that reads the same \ forwards and backwards return True; otherwise, return False.Assume that\ there are only lowercase … | |
Hello ! Recently I was doing some text formatting using python and this forum was extremely handy. My problem now is to put any letter in subscript or superscript. Apparently in Unicode there are just a few symbols in superscript but I want to put let say letter "b" in … | |
Hi guys, We're writing a GUI based on PyQt, and we're running into an issue when using different resolutions. Problem is, we can't find how to get the GUI elements to automatically resize when the window is resized, or when the GUI is running on a larger resolution than the … | |
Is there a way to incorporate a spell checker within a wxPython gui? I would like to be able to check the spelling of wx.TextCtrl values before they get posted to a sqlite3 database. I would imagine that the spell checker would be very os specific, but for me it … | |
hello all first let me say I am really glad to become a part of this community. I am college student majoring in computer systems engineering(more hardware than software), but i am really interested in interfacing computers with microcontroller based projects. I took programming courses in java , and now … | |
Hi there, I would like to be able to change a button during the runtime of a gui. I can change the value no problem (set Label) but I need to change the size of the button as well. I have managed to change it with SetSize((120, 30)) but then … | |
Hi everyone, I am in the process of learning how to use select to run a server that can handle multiple clients. I have not been able to find any server examples which implement Try/Catch Exception errors, which I believe is the root of my problems. Basically the server works … | |
Hello... I want to display rss feed from another site in html, but I don't know how can I get the images of the rss items... In the rss have only "Title", "Link" and "Description"... So, can someone tell me how to get the images from rss items ? P.S. … | |
I've been coding a simple dice roll game to practice Python. I've got the basic mechanics worked out, but I want to have it so that the player receives 5 points every time the game is won. I've tried just simply adding 5 to the variable (PLAYER_TOTAL in the case), … | |
I randomly felt the urge to make a password generator, and it runs semi smoothly. However, whenever I choose to make a custom length password, it freezes and my program exits. This is supposed to be simple but...can you help? [CODE]###################### # Password Generator # # Version 1.0 # # … | |
im using the python command prompt to enter these commands and after the window is shown. it becomes "not responding" which makes all later commands to it do absolutly nothing, including simply trying to resize the window with the mouse. this is how the code starts out... [CODE]import os, sys, … | |
I have a problem reading in data from a CSV file using tabarray (see code below) because the CSV file has a incomplete fields in the last record of the file. As a consequence I get the following error: [COLOR="Red"] File "build\bdist.win32\egg\tabular\io.py", line 170, in loadSVcols assert (Lens == Lens[0]).all() … | |
Hi everybody, Again, I try to deal with exercise from a book Think Python version 1.1.19., exercise 9.2. (case study: world play) My contents of the words.txt is: "Ahoj, Toto je moj prvy pokus otvorit a citat subor. Vela stastia " Thing is, if you have a look at a … | |
I wonder what is the name of his widget. It manages wxFrames whose in turn manages wxNoteBooks. It is like wxAUI but its Frames has maximize windows. I wonder what is equivalent wxWidgets/wxPython for [URL="http://www.swordsearcher.com/features/screenshots/swordsearcher-screenshot-full.png"]this [/URL] see here Thanks |
The End.