15,175 Topics
| |
Hi, I have a minor website that I wish to maintain that I do for gratis (for free). It is for a school. I wish to be able to automate the task of adding links and photos and text body. I already use a css template to maintain the look … | |
How can I hand off variables from web form to python, process then post back to a response page? PHP Form Code: <form method="post" action="test.php"> Mobile <input type="text" name="mobile"/> <input type="submit" value="Submit"/> </form> and test.php (that the form was posted to) $mobile=$_POST["mobile"]; **pass to python to process, write to db, … | |
I'm not a python programmer, I'm mostly a hobbist that lately is developing a project in php/Mysql. Now I find myself in need of sending two python variables to one mysql table. I found the wonderful MySQLdb module but unfortunately only supports 2.3-2.5, while to run this specific python script … | |
Hello, I am new to the IIs server6.0,I don't the process of configuring python files in IIS server6.0.I want to run my python file using IIs server6.0.How can i do this one. Please help me in this issue. | |
I'm trying to store or arrange three sets of two-dimensional data into three 2xN matrices that are stored as NumPy arrays. [CODE] 1. import os # for file handling functions 2. import numpy as np # for array/matrix processing 3. import matplotlib.pyplot as plt # for general plotting 4. from … | |
| Hi there, I am running a program in order to generate some reports. The program starts connects to the database takes the first customer and then calls a method in order to create a report for this customer. When it completes takes the second customer generates the report etc etc. … |
I'm just learning python. I'm trying to figure out while loops with s.argv in a larger script on my network. hopefully this small example will show basically what i'm trying to do. argtest.py import sys for arg in sys.argv: print arg #which gives me: Life is good but could be … | |
hi all, when i am running a Python script that i made, i get a list as a result ( i do not know the number of items stored in that list ) HOW can i return each element of the list and store in an array defined in a … | |
I'm trying to figure out how to create a custom dialog I can get the dialog to pop up when I click on the corresponding menu item but I cannot figure out how to add buttons, static text ect... Any help would be great. [CODE] def OnAdd(db): dia = wx.Dialog(None, … | |
I don't know where to post it in Daniweb, but since I'm used to Python forum, I hope someone will help me here. Advices of as to where I should post this are valid! I have made a project, compiled it with py2exe and packed fine with Inno setup. The … | |
Hi All I am trying to learn Python and cannot get aroud this problem for the life of me. I have generated a sript as follows, called xandy.py def xandy (x,y): if x < y: print x, "is less than", y elif x > y: print x, "is greater than", … | |
hey does anyone know if there are any modules that i can download that if i feed in x, y values i can make correlation plots and other types of graphs Thanks | |
Hi, Just wondering if someone could explain why this is happening: [code] >>> example = "" >>> example in "Hello there" True >>> [/code] I'm confused as to why [ICODE]example in "hello there"[/ICODE] gives a True value as return. | |
Hi, I am having python 2.4 on linux machine. I am using exec funcation as: objconfigfile=open(path, 'r') for line in objconfigfile.readlines() if line == None: continue exec(line) It is throwing exception as: invalid syntax for "exec(line)" Please let me know the issue, do we have exec function in python 2.4? … | |
Dears, I would like to create a list of QWidgets (lets say QDial). No problem till here. self.motorDial = [] self.velocityEdit = [] for iMotor in xrange(3): self.motorDial.append(QtGui.QDial()) self.velocityEdit.append(QtGui.QLineEdit()) The problem is to connect each of these Widgets to a function, passing to the function the index of the QDial … | |
Hi all, I just had a simple regular expression question. Why does this only match the first character in the string? it should find the 'a' no matter where it is in the string, right? [code=python]C:\Python26>python.exe Python 2.6.2 (r262:71605, Apr 14 2009, 22:46:50) [MSC v.1500 64 bit (AMD64)] on win32 … | |
Hey, I've been trying to install pycURL on my Python install on this Mac for the past 3-4 days now and I can't seem to get it to work. I have easy_install setuptools installed and I've been using the command: easy_install -U pycurl and it finds the package just fine, … | |
I was reading 'Starting Python' trying out in the shell some of the examples. However, I get an error with this [URL="http://www.daniweb.com/forums/post116650.html#post116650"]one[/URL]. What am I doing wrong? [code=python] >>> def sum_average(*args): size = len(args) sum1 = sum(args) average = sum1/float(size) # return a tuple of three arguments # args is … | |
Can someone please tell me what I am doing wrong. I know this is easy, but I haven't managed to make it work properly. [code=python] overwrite = None while overwrite != 'Y'.lower() or overwrite != 'N'.lower(): overwrite = raw_input("Do you want to overwrite (Y/N)? ") [/code] It doesn't exit the … | |
Hey guys. This looks like the right place to ask this question. I just started Python, and I'm still getting familiar with syntaxes and such. Right now, I'm trying to make a program that will make an Isoceles triangle with Turtle module and math module I really don't know what … | |
I was googling for a way to reverse a string and I found this. [code=python] >>> 'asd'[::-1] >>> 'dsa' [/code] It works, but there was no explanation where I got if from. Can someone please be kind enough to explain it. Thanks. | |
Hi, I was trying to use Checkbutton widget from Tkinter and I searched here in the forum for example code how to apply it, and I couldnt find any. So I have to test it myself using some documentation of Tkinter. Since I couldnt find any relevant code in this … | |
I'm trying to make a game with pygame but none of the key constants work for the apple command key. How do I determine if it is pressed or not? Thank you. | |
Well I'm new to wxpython and in trying to learn I started making a small Phone Book program but now I'm stuck need some help on a few things. First thing is when I click on my New Contact in my menu I want a new frame to appear with … | |
| Hey guys, I have made a program called 'tLapse', here's the code: [code='python'] import subprocess import time import os print("Welcome to tLapse...") time.sleep(3) os.system('cls') try: com=open("action.txt",'r').read() condition=True except: print("File error") raw_input("<Any key to quit>") condition=False if(condition): clock=raw_input("Enter time duration after which\nuser-specifiedaction will be\npeformed.\n\nFormat- [hh:mm][24- hour format]: ") def app(path): ext=path[-3:] … |
I'm a newbie to python. After opening a file in 'r' mode then using the approach below. f = open( '/g.txt','r') for line in f: I find a pattern I'm looking for in a text file. Then I use f.tell() to record the file position. However, I think due to … | |
Hi all. I'm new to the forum, this is my first post =) I'm trying to create a list containing 3^10 lists, each list has 10 string. Each string can be of 1 or 3 types, for simplicity let them be 'a', 'b','c'. So basically I wish to generate all … | |
Its long now I try to understand wxPython's print frame work. Every effort have fallen apart. I just cannot understand how it works. I have tried to google with no avail. wxDemo is too painful to swallow :( I request anyone familiar with framework to give me a jump start … | |
I'm trying to develop a simple script that will keep the scores of a cricket match. In my script I want the __init__ method on one class to create an object of another class. here's an example. [code=python] class Person: def __init__(self,name): self.name = name class clubMember: def __init__(self,name): New_clubmember … | |
Why does this make sense in 3.1? [code]>>> a = b'\x01\x02' >>> a[0] 1 >>> a[0:1] b'\x01' >>> a[0] == a[0:1] False >>> a = '\x01\x02' >>> a[0] '\x01' >>> a[0:1] '\x01' >>> a[0] == a[0:1] True[/code] Shouldn't we get True for both comparisons? |
The End.