15,181 Topics
| |
Hi, i have this code: s = "hi john' re.serach(r'j\w+h', s).group() and up to here there is no problem but i want to put the letter h in a str variable l = "h" re.search(r'j\w+'l, s).group() but when i do this i receive an error?? | |
I'm using windows 7, hoping to use Tkinter to open an internet window when a button is clicked that goes to a specific page in google chrome. Is this possible? [CODE]class App: def __init__(self, master): frame = Frame(master) frame.pack() self.button = Button(frame, text="Rejuvenation", command=self.info) self.button.pack() def info(self): pass #Will go … | |
How would I find the amount of characters in a string and then use that to print a certain amount of some character that you choose. For example: [CODE=Python] a = 'string' # this holds 6 characters print '*' * # amount of characters in string [/CODE] | |
Hi everyone! I would like to know if python is any good for creating apps for cellphones .. like Iphone,Blackberry.. or even for Ipods? Ive been researching on this matter but I never got a good answer.. haha Thanks in advance! :) | |
According to this post [url]http://www.python-forum.org/pythonforum/viewtopic.php?f=3&t=31349#p146797[/url] it claimed to be possible to create a list were you can store and recall data using a coordinate system ... [code]SomeList[1][5][2] = 234 [/code] I have been playing around with the code a while, and have ran into a problem. No matter what I … | |
Got inspired to make computer to make moves in English Solitaire, I learned in childhood days to solve by myself consistently, no solving or game play interface at the moment (easy to add though). I added printing of the ready solution from the wikipedia, also maybe of your interest are … | |
Hello, all. I am in the process of writing a peg solitaire solver in Python. It will allow the user to select the shape of the board in the future but for now I'm testing it with a standard 5 row triangle game, like the ones you find in Cracker … | |
Hello eveyone, I want to make an search button with wx.SearchCtrl on wxPython-Sqlite3, and after we select to data on wx.SearchCtrl, the data will automatically open. What should I make first? Can anyone give me an example? Thx for helping. | |
Ok, so. I've programmed, just for fun, a conversion calculator for decimal and binary numbers. Here is the code: [CODE]# -*- coding: cp1252 -*- import sys, os, time #This is where you convert a binary number into a decimal number. def binaryToDecimal(): os.system('cls') while True: print "To go back to … | |
Hello everybody This is all my test code : [CODE]#!/usr/bin/env python #-*- coding:Utf-8 -*- from Tkinter import * import Tkinter as tk import tkFileDialog import os import ttk import tkMessageBox import psycopg2 from PIL import Image, ImageTk import Image import ImageTk import os.path chaine1 = "Bureau" chaine2 = "Téléchargement" listtest … | |
Hi all i am college student and making a project related to file compression in python. I want to creat a listCntl with image and text that will look like image that i attached wih this post. plese help me how will i implement this in wx python. | |
Hello, everyone, I'm new to wxPython I want to write a small program that link the menu in one frame with another frame that I created after. I've tried to use like EVT_BUTTON, but it won't work. How am I supposed to do this? Thx for any help | |
While correcting errors in someone else's code, I decided to completely rewrite the original script, and improve upon it. This is the basic code for making 3D arrays using dictionaries. [code] ar = { (x,y,z):0 # creating the array for x in range(3) for y in range (3) for z … | |
I am working on the Tkinter.......i need progress bar in determinate mode........ can some one please give simple example of it, i m getting confuse in start, stop and step method of the progress bar Thanks a lot....; | |
I need a library for a certain script and I don't know which one to choose, I have the following page on a browser: (Its in a table formation) Date | Value | EDIT Date | Value | EDIT Date | Value | EDIT Date | Value | EDIT Date … | |
Can someone give me a pointer on how to solve this scenario: 1) I have an image of a chessboard (8x8) with black and white squares. I need to analyze the image and create a 8x8 matrix corresponding to the chessboard. 2) Store 0 if the corresponding chessboard cell is … | |
I have a file with bunch of lines and I want add html tag for in every line in file Example: [ICODE] 1. [url]www.google.com[/url] 2. [url]www.facebook.com[/url] .... 107. [url]www.daniweb.com[/url] [/ICODE] and the result I want in the end: [ICODE] <p>1: <a href="www.google.com" target="blank">www.google.com</a></p> [/ICODE] ..so I have 180 lines in … | |
can someone help me make my code more simple. i uploaded the source to my website in a zip file with all the images because i used pygame and if you want to test it you will need the images. you can download everything here [url]http://2nh.co/Tk[/url] or here is the … | |
What is wrong with this code? [CODE]import time import sys print """Welcome to the age finder. This program takes some input (they will be the years) and then adds it to 4 ages. For example, if you give the ages 10, 11, 12 and 13 it will return the age … | |
i searched for similar threads but couldnt find any. i write python scripts ..but i want to store them in someother folder eg /Desktop/... the scripts get executed from the unix terminal..however the python intepreter(initialised by typing python in terminal window )is not able to find the files. i changed … | |
I am starting to try and manipulate some CSV file data. My first problem is the empty values (empty cells in a spread sheet). My boss sends me these files and when I open the in csv format Python gives me: "Denison, P14, , , , , $1600" I can't … | |
Hi guys I need some help with a tic tac toe game I made, the problem[s] is that it will not display that there is a tie and when you win it will run the computer move function and then it will say you have won. It is something to … | |
Okay, I need to write a maze solver for the maze in the text file (yes it is an assignment). I am not asking for a direct answer, I just want someone to propose ways of solving the maze( I also have to mark the paths taken in the maze). … | |
Hi, I need some help getting the hypergeom distr. I've started with this code, but it doesn't seem work: [CODE]def logchoose(n, k): lgn = special.gammaln(n+1) lgk = special.gammaln(k+1) lgnk = special.gammaln(n-k+1) return lgn - (lgnk + lgk) def hypgeo(x, r, b, n): return exp(logchoose(r, x) + logchoose(b, n-x) - logchoose(r+b, … | |
Have a look at this...[QUOTE]>>> chores = 5 >>> paper_round = 30 >>> spending = 10 We’ve just created variables named ‘chores’, ‘paper round’ and ‘spending’. We can then re-type the equation to get: >>> print (chores + paper_round - spending) * 52 1300 16 CHAPTER 2. 8 MULTIPLIED BY … | |
Hello everyone, I'm new on wxPython programming I want to make an database with sqlite3, but I don't know how to make a database report with, just like an Microsoft Access Here's the code: [CODE]import wx import sqlite3 as lite class myframe(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, … | |
The title really says it all. For example if I had a music file and I wanted to have it play all the way through then how would I make it start another music file after the first is done? | |
Hello , i have two tables ,animal ,which has name,familie and weight and table food which has feed. I want to assure that every animal has at least one food. I did this : [CODE]import mysql.connector from database import login_info db=mysql.connector.Connect(**login_info) cursor=db.cursor() data=[('Geo','Elephant',['hay',peanuts']), ('Gerald','Gnu',['leaves','shoots']), ('Leo','Leopard',['meat']) ...................... ] for name,familie,feed in … | |
This will allow you to login a website with python. After logging in, you now have access to all the pages for "members only" accessed with python. Could be handy for a myspace update program, webcrawlers, facebook(not recommended, facebook doesn't like scripts), and other things. Some knowledge of HTML is … | |
Working on program to solve a predefined maze. I'm thinking the strings of spaces and #s should be arranged as strings or lists w/in a list, but not sure how to define spatial relationships so program can "move" through the maze. Just looking to help get started. |
The End.