15,406 Topics
![]() | |
hi, im learning to use python at the moment and i came over a question where it gives me a large csv file with names of companies and how much they are earning and i was asked to find the top 10 companies..i orignially did this: [code] import urllib import … | |
![]() | I hope people don't mind seeing references to other forums here. I'm a regular at [URL="http://www.python-forum.org"]www.python-forum.org[/URL] but lately I've been having problems with the site. Last week, I couldn't post anything for two days, but that seems to be resolved. Now, I can't even log in. I get a "406" … |
Hi there, I have a data set ([url]http://app.lms.unimelb.edu.au/bbcswebdav/courses/600151_2008_1/datasets/entertainment/moviestats_large.csv)[/url], and i was just wondering the best way of tackling the question stated below: Which director is the most productive? I an new to python and wondering if anyone could help me out a little on this problem. I have considered trying … | |
i have a script which will do a specific task for a file in a folder,now i would like to do the same task for the all files in that folder(25 files).how can i do that? Thanks in advance. | |
Hi All, We have been using http_class in urllib2.py ,_http.py and calling its various methods like h = http_class(host) # will parse host:port h.set_debuglevel(self._debuglevel) h.request(req.get_method(), req.get_selector(), req.data, headers) h.getresponse() I am searching this class in the python directory but I could'nt find any.. DO we need to download this separate … | |
here is what i have to do: [url]http://www.sendspace.com/file/og252q[/url] this is what i have so far. [url]http://ayman86.pastebin.org/34381[/url] its pretty much the code in the pdf file with defined functions of quick sort, bubble sort and better bubble sort im not sure how i implement "size of array increment, and number of … | |
Hello, I have a project to make a text comparer. I've downloaded almost 90000 texts from a site, parsed them and stored the texts in a file(150MB). So now, a new text is in another file and should be compared with the others, and return a result of 20 most … | |
Hey guys, I'm trying to get a socket to work, but this code doesn't seem to fire. [code] #!/usr/bin/python import sys import os import socket serverHost = 'localhost' # servername is localhost serverPort = 2000 # use arbitrary port > 1024 mySocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # create a TCP socket … | |
Hi i was wondering the best way to time how long a function/program takes i cant work out how to do it. I tried fiddling with the time module yet i keep doing the wrong things. | |
[CODE] #!/usr/bin/python #SQL Table/Column Fuzz #How to use this tool: #In this script you can test Tables, Columns or #Both. # #For your site argument set TABLE,COLUMN or both for #which ever you want to test. #Example: #./d3.py www.site.com/shop.php?id=-1+union+all+select+1,COLUMN,3+from+TABLE-- # #Add the errors you receive to the ERRORS array. # … | |
[code] # This is meant to draw Start and Stop buttons and a label # The Start button should start a loop in which the label # is configured to change colour and text. # At each pass through the loop the variable self.stop is checked: # if True the … | |
Hi all, I need to open a https site ,I have http proxy for that site..I want write a program in python which can open an https site via http proxy using certificates which I exported from browser to my local system. Can anyone help me in this regard?? | |
Hi My question is: i made a program that counts up and up continuously in the background but i want it to print what number it is up to when you press a certain button such as ENTER. I have tried using raw_inputs() but all that happens is it keeps … | |
I have a list for exemple: a = [ 9,6,5,4,1,0,0,7,6] . By this function I want to delete all element which content zero and delete all element which content duplicate. But it doesn’t do exact what I want. [CODE]def rensa(a,b): j=0 for i in a: if a[j]<= 0: del a[j] … | |
Python's system of deciding for you what type to give all your variables is nice and all, but is there a way to force it to give a variable a certain data type? For instance, if you give it the following: [code=Python]n = 2 m = 3 print n/m[/code] It'll … | |
Hi everyone, Would someone please tell me how to hide the command prompt window while my Tk/Tkinter program runs, I'm kinda new to windows programming, but i'm doing all right. (except the command prompt window keeps sticking its tung at me) Thanks for any help, I appreciate it. | |
Hi all, I would need your expertise/advice on the problem I encounter right now when I tried to parse in the contents of .csv file. Here is the scenario: 1) I have csv file with the possible entries as follow: ProjCat,RefNum,ProjTitle,MemberName,ProjDeadline,ProjGrade --> Header I,0001,"Medical Research in XXX Field,2007","Gary,Susan",20.05.07,80 R,0023,Grid Computing … | |
This was a comment from ee_programmer in reference to one of the Python code snippets. [code=python]""" I was expecting the first class instance to only have one dictionary entry {'person0': 0} rather than two dictionary entries. Similar expectation with second class instance. How do I create and assign value to … | |
what are the differences between these two type of commands: 1- >>> import socket 2- >>> from socket import * i mean when you get the object list from the first command it gives different object from when you get objects from the second command. so does it mean these … | |
Hi, I'm a starter of python programming and i've stuck on a problem. i imported a csv library into the consule and i tried to print out a particular column. but i don't want to print out the heading (which is the first row) of the column. this is what … ![]() | |
| |
Hi! how can i run a python script in a link such as([url]http://192.168.8.111).what[/url] do i nid?i have ubuntu7.10 and installed apache2.pls help.tnx!! | |
hi guys!! im having a hard time editing the main configuration file httpd.conf.im planning to use it for a project with api using python and im trying to run it in our office ip address.([url]http://192.168.8.111)can[/url] you pls help me.what are the right codes for it?im really having a hard time … | |
Hi everyone, I'm trying to find the points that satisfy the equation y^2=(x^3)+ (4*x) + 4 (mod 5) from the book i know im suppose to get x=0 y=2 x=0 y=3 x=2 y=0 x=4 y=2 x=4 y=3 so far i haven't been luck in getting anything any help is appericated … | |
Hi, Assume that I have a target directory, which I am using as a location to store my python scripts.What I need to do is to listen to that directory and when a python script is placed in that directory, I need to execute it at that time.Can anyone give … | |
Hey guys again, well i got another question. When ever i have an if statement asking for input and i try to use an elif statement and run the code, it say's 'elif' is an syntax error. Is it an indention problem or something else? Thanks [CODE]print "1) Play" if … | |
Could someone please help. I would like to sort a multidimensional array. But to sort it out by one key which appears in all array for example. [code] total=[[serial,'john'],[[serial,'james']] [/code] all the records i have all in arrays they contain a "serial" i would like sort by serial. I have … | |
Recently I downloaded Ubuntu v8.04 (Hardy Heron), and was delighted to find Python pre-installed. However, that pleasant surprise was soon dampened by the fact that IDLE would not run, and so I am left without a decent program for coding in Python. gedit works, but lacks pretty much everything except … | |
My script works perfectly now!!! :) This is my first script too!! The problem is that this code sucks. I hate to bash my own code, but it is really inefficient and I am sure that there is a better way to perform the brute force. Here is the code, … | |
Hey guys....I've been doing Python for probably more than 4 months and i have gotten to the point saying to myself "What should i make?" and "How would i do that?" i just don't know where to go know and what to do. I am capable in many things in … | |
Dear All, Iam Using python 2.3,i have pythonpath in environment variables,is it possible to rename Pythonpath because i have to use two path alternatively first is pythonpath and second is PythonPath1 any idea????????? regards Narain | |
Hey, Can anyone please point me to a place where I can find all the modules so far developed for python. I am mainly looking for modules that can be used to update excel files. ping machines and send automatic mails though local mail client. Appreciate your help here! Thanks, … | |
Hi, How can I send right nouse click with python? thanks. | |
SysFileTree() in REXX offers an easy way to work with all files (or subset) in a directory tree. For a summary of the function, see [URL="http://publib.boulder.ibm.com/infocenter/iadthelp/v6r0/index.jsp?topic=/com.ibm.etools.iseries.orxw.doc/orxw_ref614.htm"]http://publib.boulder.ibm.com/infocenter/iadthelp/v6r0/index.jsp?topic=/com.ibm.etools.iseries.orxw.doc/orxw_ref614.htm[/URL]. Which Python module offers similar function? | |
for home work I have to write a small class that deals with something mathematical it has to have some loops... anyway if u could give me some ideas (not codes) for the theme of my classs anything that would have some loops and is not very complicated i did … | |
The code below is part of a simple craps game that I am writing for practice. I have the dice rolling down, but I can't get this betting command to work out. The only module that I am really interrested here is the bet1(x) module but I copied the entire … | |
Hello all. I have a txt file which has a number of links and i need to save this file as a .html page in my webserver.How do i append <html><body><title></title>'Content of the file'</body> </html> tags to the start and end of a file so that it is saved as … | |
Hey guys i'm new here, but i got the basics of python down and i'm having some problems with my code. All i want to do is be able to type in something and have it saved as a txt file, i have tryed numerous things and when i ran … | |
Hi guys, I'm learning python right now, and I'm having a little trouble with one of my assignments. I have to write a program that will take a word and "encrypt" it. an example, if the letter is 'a' then it should get converted to 'b'. I have the code … | |
I'm trying to modify a find/replace script that I previously got help with here on Daniweb. The script below iterates through a file A and makes replacements defined in a csv file B. My original goal was to change any line in file A containing a search string (in whole … | |
Below is code that I'm using that essentially creates fake *.avi files and puts them in a directory structure so that they can be later added into a database. The whole purpose of this is to be able to index the files without the risk of screwing up the originals. … | |
Hello I'm trying to write a program that will wrap an ASD envelop to a trangle wave sound. I can't seem to get my trangle one to work. I did get my sine wave to work. What could I change to get it to do a trangle? [code] def asd(fileName,nSeconds,cyclesPerSecond,maxAmp): … | |
""" i am having a bit of trouble with my whoWins function and my menue. i can get all of my other functions to run from main but whoWins just doesnt seem to want to work no matter what i try.i am also unsure if the dictionaries etc for the … | |
[CODE] """ cow.py a fully animated cow sprite uses graphics from reiner's tile set cow walks towards the east """ import pygame pygame.init() class Cow(pygame.sprite.Sprite): def __init__(self, screen): self.screen = screen pygame.sprite.Sprite.__init__(self) self.image = pygame.image.load("sprites/Walking1.gif") self.image = self.image.convert() tranColor = self.image.get_at((1, 1)) self.image.set_colorkey(tranColor) self.rect = self.image.get_rect() self.rect.center = (320, 240) … | |
"""hi i am having heaps of trouble with calling my whoWins function from main. i can get all of my other functions to call ok from main, but am having trouble with this one for some reason. any help would be greatly apreciated. cheers joel""" import random Ascore = 0 … | |
I am having a bit of trouble with my whoWins function and my menue. i can get all of my other functions to run from main but whoWins just doesnt seem to want to work no matter what i try.i am also unsure if the dictionaries etc for the whoWins … | |
I am a total n00b to both programming and Python. I am working my way through "Python Programming for the Absolute Beginner" by Michael Dawson. On of the "challenges" given on page 87, chapter 3 is to create a Fortune cookie program. I can't get the code I want to … | |
I have a file with a long list of English verbs and I have a set of search strings; now I want to search through the verbs to find any verb which contains any of the strings as a substring. For example, the verbs "forgotten" and "negotiate" both contain the … | |
Hi I have a function which rand digit between a and b. it maybe 2,3 or more digits. I want to save these digits in a list and then use them in another part of my program. How can I do it? [code] def dela(x): sum=0 while sum <x: b= … |
The End.