15,190 Topics

Member Avatar for
Member Avatar for Archenemie

I would like my wx.TextCtrl box to only accept numbers, preferably to only 2 decimal places. Where should i start? should i use an input mask or are there styles too control this kind of input? [CODE]value = wx.TextCtrl(parent)[/CODE]

Member Avatar for Archenemie
0
4K
Member Avatar for raschko

Delving into modelview programming became complicated after seeing few explanations of the structure involving an editable model; Perusing through forums, source and documentation is only leading me so far. My issue currently is trying to edit a tableview header (subclass) entry using a custom delegate. I've seen implementations using an …

0
56
Member Avatar for maniac00

Hi guys i need help with one thing in Python... I've got something like [code] number=001 example = "picture%d" % number print example ---> But it prints picture1 not picture 001.... [/code] and i need it as integer not as string because i want to use --->[code]number=number + 2 for …

Member Avatar for Gribouillis
0
119
Member Avatar for paul.hahn

Hi, I'm newbie on Jython and on this forum as well. I need to create a GUI with Swing. My original code is based on Tkinter (see below, code adapted from Tony Veijalainen's [URL="http://www.daniweb.com/code/snippet283859.html"]Tkinter Info Grid by loops and tuples[/URL]). The main point is the use of mainloop() allowing the …

Member Avatar for paul.hahn
0
179
Member Avatar for ijessiichan

Okay. I am creating a program for school and I am a beginner to python. Here is my code: [CODE] intro = input("Want to play a game of number guess? ") while intro == 'yes': print("\nOkay. Just guess the number I am thinking of from 1 to 10.) if intro …

Member Avatar for woooee
0
188
Member Avatar for stefh

Hi there, my name is Stéphane, i'm french and a beginner with Python... I've registered on a french forum about Python to ask a question regarding an issue i have with a code, but it seems the members of this forum are not active. I paste the message i posted …

Member Avatar for stefh
0
658
Member Avatar for Vertana

I've been racking my brain over this for a few days now. I'm attempting to write a program in Python 3.1 / PyQt 4.7.5 that will open a Powerpoint, go through every shape on every slide, determine if it is a picture and then save that picture to the specified …

Member Avatar for Vertana
0
1K
Member Avatar for Urban48

hello! I'm developing a software to monitor communication to different locations. the principle is simple: send ping every second and display the results in real time (ms delay, packet loss etc) It's also important to mention that I'm running the software from Linux, so in order to ping from my …

0
113
Member Avatar for Gribouillis

This snippet defines a function [icode]a2bits[/icode] which converts a characters string to a string of 0's and 1's showing its bitwise representation.

Member Avatar for Gribouillis
0
2K
Member Avatar for Thropian

I have a string such as [CODE]"this is a really long string that is completely pointless. But hey who cares![/CODE] and I was wondering if there was a way to cut the first X characters off and return the res of the string

Member Avatar for TrustyTony
0
116
Member Avatar for Krstevski

Hello friends, I have a small problem with creating XML documents. After creating the XML when I try to get a XML document as string using .toxml() or .toprettyxml() functions i got escaped string. [CODE=python] >>> from xml.dom.minidom import Document >>> html = '<a href="http://www.google.com/">Google</a>' >>> doc = Document() >>> …

Member Avatar for Gribouillis
0
445
Member Avatar for Greyhelm

I am trying to understand using an SQLite database in Python and can grasp running queries, but would like to understand how to populate Python variables from SQLite fields. Here is my sample Python code: [CODE]import sqlite3 id = 0 name = "" occupation = "" location = "" connection …

Member Avatar for richieking
0
4K
Member Avatar for neroth

A bit of background: I've been working on a python script to do some calculations on a land use model. Basically, I take amount of space developed in the future and pull out a table that has the amount of space by geographic area within the larger area. I load …

Member Avatar for neroth
0
308
Member Avatar for BirdaoGwra

Hi, Right now I have this. And I could not understand how to sort it out: [CODE]def onView(self): img = wx.EmptyImage(240,240) filepath = self.filedlg.GetPath() img = wx.Image(filepath, wx.BITMAP_TYPE_ANY) img = img.Scale(240,240) picture = ogl.BitmapShape() picture.SetBitmap(wx.BitmapFromImage(img)) self.canvas.AddShape(picture)[/CODE] I want to load an image with fileDialog into a wx ogl canvas. Thanks …

Member Avatar for BirdaoGwra
0
120
Member Avatar for acehigher

Hello, I think this is a pretty simple problem but I just don't know where to start. I have a text file: 1 00:00:34,000 --> 00:00:36,135 Thank you, Detective. 2 00:00:42,714 --> 00:00:45,794 - Any change? - Nothing since you left. 3 00:00:52,988 --> 00:00:55,585 She seems to be looking …

Member Avatar for Gribouillis
0
102
Member Avatar for python01

Hi all, I was just wondering if anybody could point me in the right direction regarding a program that need to be able to track the cursor and draw it's path on the screen. I was thinking about Tkinter, but is there another option?

0
51
Member Avatar for rx21825

Hi. I am a python newbie seeking some help in working with a file containing rows and columns. I have a file, that ideally contains an equal number of rows and columns. The first row is a tab separated header row and the first column is a label row. The …

Member Avatar for rx21825
0
204
Member Avatar for Thropian

I made a little python code that makes a ball bounce around the screen. Every time you left click it makes another ball. when you right click it clears the screen but you can't spawn more balls afterward... any help (python, tkinter) [CODE]from Tkinter import * import time import base_translate …

Member Avatar for Thropian
0
1K
Member Avatar for BirdaoGwra

Hi, It is my code: [CODE]mylist = [['fiss','giss'], ['e','h'], ['d','u'], ['c','t'], ['b','o'], ['a','z']] for alist in mylist: g = ' '.join(alist) print g f = open("write.txt", "w") f.write(g) f.close()[/CODE] How will I write all the words in the txt file. it is only writing the last line of the file. …

Member Avatar for Tommymac501
0
136
Member Avatar for tcl76

hi, is there a way to convert from string to long? for eg: i want to concatenate all the arrays into data and make it same type (long) as data1. [CODE] a='0x' array0 = '00000018000004000000000000000000' array1 = '00000000000000000000000000000000' array2 = 'fe000000000000000000000000000000' array3 = '00000000000000000000000000ffffff' data = a+array0+array1+array2+array3 print data print …

Member Avatar for Gribouillis
0
5K
Member Avatar for tcl76

hi, i have a script that converts hex to bin and bin to hex back. however, when converting back to hex the leading 0s are truncated. how to maintain the leading 0s? i'm using Python 2.5 and Win XP. tq [CODE] import binascii import string def byte_to_binary(n): return ''.join(str((n & …

Member Avatar for TrustyTony
0
3K
Member Avatar for debasishgang7

hey all, i'm trying to get all content of a webpage using python and trying to put them all into a file. Here is my code: [CODE]import urllib data = urllib.urlopen('http://www.site.net/index.html').read() #print data //if i ignore the rest part of this code the code is just working awesome...its printing the …

Member Avatar for richieking
0
139
Member Avatar for kuchi

Apache is running in UNIX box, and we have configured folder path in config file and we are accessing python code from that folder. In the python code, we have two methods new_page() and access_form_elements(), new_page() -- print new HTML page with two form elements and method=POST and action=same .py …

0
80
Member Avatar for aldusforte

Hi all. I am new as can be to programming. I always heard a good way to learn to write was to find a project that I am interested in and start from there. So my ideal goal is to write a script that cleans up my downloads folder, ie …

Member Avatar for aldusforte
0
385
Member Avatar for Tommymac501

I am trying to replace a fixed field name in an XML file with data. I know that I could do it the proper way using XML tools, but, this is a standard templae file that only needs one item replaced. It seems simpler to just hack a replacment. [CODE] …

Member Avatar for woooee
0
80
Member Avatar for yeleek

I have two lists which contain titles and links to interesting pages (trying to write a scraper). Where I'm falling down is on the actual printing. [CODE]for i in var1: print i for a in var2: print a[/CODE] Prints all of list 1 and then all of list 2. If …

Member Avatar for yeleek
0
100
Member Avatar for rssk

hi all....... I m running a program in windows like this import os os.system('snmpwalk -v2c -c ar441c 192.168.1.10 .1.3.6.1.4.1.18489.1.2.1.1') when i run this i m getting error like [B]SNMPWALK IS NOT RECOGNISED AS A INTERNAL AND EXTERNAL COMMAND,OPERABLE PROGRAM OR BATCH FILE[/B] so anyone can plz help me........ thanks in …

Member Avatar for rssk
0
4K
Member Avatar for zizuno

I have code the goes to a page and downloads information on its update. Every once in a while it errors out with [code] url2z = url2z.read() File "/usr/lib/python3.1/http/client.py", line 502, in read s = self._safe_read(self.length) File "/usr/lib/python3.1/http/client.py", line 594, in _safe_read raise IncompleteRead(b''.join(s), amt) http.client.IncompleteRead: IncompleteRead(15928 bytes read, 37182 …

Member Avatar for TrustyTony
0
344
Member Avatar for Parth tank
Member Avatar for joeywheels

Hi everyone! New here and to Python. I'm having trouble with my break statement executing and cannot figure out why. I'm learning to write to files and want the loop to break if the user hits enter. It's not working for some reason. I've even tried to get fancy (in …

Member Avatar for joeywheels
0
106

The End.