15,175 Topics
| |
Hello everybody I'm trying to use Python and Django to make my first website , i followed this tutorial : [URL="http://webpy.org/docs/0.3/tutorial"]http://webpy.org/docs/0.3/tutorial[/URL] , and i could finaly while the execution of the Python code nouveau_fichier.py which is : [CODE]#! /usr/bin/python # -*- coding: utf-8 -*- import web urls = ( '/(.*)', … | |
hello friends As the tittle say , i just would like to know if there is possibilities to change the graphisme of the Button : color , form , insert image on the Button ... , Thank you for answering , good luck :) . | |
hello friends , I just don't know , why in using Crontab it don't execute a code python that contain : [CODE]execfile("Backup1.py")[/CODE] my code is nouveau_fichier2.py : [CODE]#!/usr/bin/python #-*- coding:Utf-8-*- # -*- coding: cp1252 -*- import os print 'helo' #os.system("sudo chmod 777 /home/ismail/Bureau/Test/20111214") execfile("Backup1.py")[/CODE] and my crontab file after "crontab … | |
I am having trouble parsing xml files using ElementTree after the python code is turned into .exe using cx_freeze. [CODE] from xml.etree import ElementTree file1 = 'file1' file2 = 'file2' tree1 = ElementTree.parse(file1) tree2 = ElementTree.parse(file2) print 'Done' [/CODE] It works fine with the .py file, but after I made … | |
What I'm trying to do is read a line from a file containing some data that includes a person's first and last name, their hourly wage and the number of hours they worked, and then writing to a seperate file their last name, first name: wage. The input file looks … | |
So, this seems like it should be the default to me... if you're going to make your own picture for a button, I don't see why you'd want the default border around it, but I can't for the life of me figure out how to get rid of it. I … | |
Beginner here (meaning I probably did something silly): I am trying to target indexed elements that have [A], in them. Entries for 'scarcity' and 'sweet' are both shown. I am running into trouble when index item[2] is empty. I get the following message: [code=text]['scarcity', 'scarce', '[A],', 'ity', '[N|A]', '[N]'] scarcity … | |
Hi, I need to extract some info from a file. This is two rows from what the file looks like: prob=0.0093;ID=RGT430;BQRS=491;BRZ=-4.263;ID2=RT914;DRT=0.00;HRun=0;HaplotypeScore=0.2794; prob=0.003;ID=RGR301;BQRS=4;BRZ=-3.261;ID2=EV913;DRT=0.00;HRun=0;HaplotypeScore=0.2654; ....etcetc until last row: prob=0.345. I want to extract prob from each row in the file and put it in a new file, but I don't know how … | |
Have you ever cited the Python documentation? How did you do it? I can't seem to find author names and such information. I've only ever cited books as well. I'm trying to find out who authored the 2.7.2 docs, and how to cite them properly, since I used it to … | |
[code] import urllib from urllib2 import urlopen from gzip import GzipFile from cStringIO import StringIO import re import urllib2 def download(url): s = urlopen(url).read() if s[:2] == '\x1f\x8b': # assume it's gzipped data with GzipFile(mode='rb', fileobj=StringIO(s)) as ifh: s = ifh.read() return s s = download('http://www.locationary.com/place/en/US/Virginia/Richmond-page20/?ACTION_TOKEN=NumericAction') findLoc = re.compile('http://www\.locationary\.com/place/en/US/Virginia/Richmond/.{1,100}\.jsp') findLocL … | |
Hi! I am trying to make a program that will put the bands I've played with in alphabetical order. I'm getting the band names from a file on my computer. I am fairly new to python and don't have much experience what so ever. I'll post the code that I … | |
Hi everyone! I joined these forums about a week ago so I could try and learn more about Python, and thankfully I can say that I have learned a bit. Enough to try and create a Mastermind game, although I'm having trouble with converting the code into Pygame and give … | |
I am getting this error PYTHON - TypeError: unsupported operand type(s) [CODE]weekPay = [] names = [] hours = [] wages = [] while True: name = raw_input("Please input yor first and last name or type \"Done\" to continue: ") if name.title() == "Done": break names.append(name.title()) hour = raw_input("Please input … | |
In my code they're instructed to enter a width and height. However obviously these will be intergers, but I need to perform checks that they are intergers before they're used. Atm I've got this: [CODE] while True: if width.isdigit() == True and height.isdigit() == True: if width >= 2 and … | |
Hi there, I'm writing my first Python script for a(n imperative) programming class at university, and I want to make it a little better. It's meant to be fairly short, 50 lines. I've written the basic 'mechanism' to look at the user input. Instead of simply printing every property of … | |
hi everyone,i am just a beginner in python,i am going through "head first programming" and saw about the [B][COLOR="red"]pygem[/COLOR] [/B],but iam unable to install pygem....i already downloaded [B][COLOR="red"]pygame-1.9.1release.win32-py2.5[/COLOR][/B] from pygem site,but at the time of running the set up i am getting a error that it is not compatible with … | |
Hi friends! I need to make a function which takes a string, e.g: '(239..247),(467..765)' (corresponding to the coding area of DNA sequence) and return a list with a tuple for each coding part, each with a start and end value. e.g. [(239,247),(267,765)]. Someone has a clue how to start up? | |
Hi guys, I been working on a project that involves in managing a phone inventory for a company. So for this project we are to use classes. For the most part I got everything except two areas of code that I am having trouble with. I have two classes, Class … | |
Hi, I have data in the form: rpm Torque 1000 36 2000 40 3000 45 4000 50 . . I need to find the torque at a specific rpm. I found numpy.interp() which will give me a linear interpolation, but my tutor said it wouldn't be accurate enough. I found … | |
How do you get the name of a win32com.client.gencache.EnsureDispath name? For example, I have an application named "xxxxx", and the Python object browser detects it when I use makepy.py. How do I get name like "Excel.Application"? | |
[CODE]tomorse ={ 'A': '.-', 'a': '.-', 'B': '-...', 'b': '-...', 'C': '-.-.', 'c': '-.-.', 'D': '-..', 'd': '-..', 'E': '.', 'e': '.', 'F': '..-.', 'f': '..-.', 'G': '--.', 'g': '--.', 'H': '....', 'h': '....', 'I': '..', 'i': '..', 'J': '.---', 'j': '.---', 'K': '-.-', 'k': '-.-', 'L': '.-..', 'l': '.-..', … | |
Good day everyone, I need to print data using if-elif statement. I when I run this code like this, everything went well [CODE] if row['username'] == 'mutago': print " okay" sys.exit(0) else: print "wrong" [/CODE] OKAY now i want to include elseif statement to print another data but it returns … | |
Hey, So I am completely new to python, I was wondering if someone could assist me with this program I am trying to make, The idea is simple, a program that counts for the user. Asking the user to enter a starting number, ending number, and the amount to count … | |
Is their any way to make an exe from my python files other that py2exe as am getting some problem.And for the same is their any method for linux also. | |
hello everybody , good day , i just need to insert an image : "BosqueTK.jpg" in a speciale place in my window Tkinter using .place(x= , y= ) , for this i created a frame f2 placed like : [CODE]f2.place(x=130 , y=213) [/CODE] , and want to insert in it … | |
Hi Guys, I'm new to python - how to execute dos2unix from python - subprocess.popen with shell = False ? >>> cmd = subprocess.Popen(["dos2unix","./FEED1/bin/*"], stdout=subprocess.PIPE) dos2unix: converting file ./FEED1/bin/* to UNIX format ... >>> dos2unix: problems converting file ./FEED1/bin/* All help appreciated. | |
Hi, We are a team of 3 people. We have not worked on Python before.We want to learn python & also develop a small project or software using python,c,shell scripts in LINUX environment. Could someone help us or give information on websites of the projects that we can develop? | |
Im working on my final project for school where i have to uses arrays to store the first year of energy costs, the second array will store the second year after going green, and the third array will store the difference. I have pretty much all the code written out … | |
Hello, im currently taking a python programming class at my high school and we have an assignment to create a falling sand type game using pygame. im totally lost on how to start could someone please help me get started. if you dont know what the falling sand game is … | |
Hello, i'm new to this forum and to Python and i want to creat a function that counts the number of words on .txt file, but also that creats a dictionary with it, with the words has a key and the number of referencies to it has a value. Thanks … |
The End.