15,190 Topics
![]() | |
this is another pretty simple question, but i've been trying to do it, and cant get it basically what i need is pretty simple, its like say you have a list of 5 numbers. now you need to print out all the lists of possible 3 numbers from those 5 … | |
im sorry this is kind of a silly question i know, but does anyone know any succesful ways to change a .py into a .exe? like so that someone without python installed on their computer can run it? i've seen this topic in a couple places but everything i've tried … | |
I am working on a script that will eventually run as scheduled via chron. This script will access ftp site and download most recent file added to directory. As I want this to be automatic, I wont have a file name to pass. How do I tell python which file … | |
Hello, I am trying to embed a html file (a report from sql) in to a word document in a particular location. I am trying to get this done using the Office Interop. 1) How can I embed a html file in to a word document ? 2) How can … | |
So, I always thought that it was possible to return dictionaries in Python. I was wanting to do this because I would prefer not to use globals. However, I am having trouble with returning my dictionary. Code: [code=python] #!/usr/bin/python # 6/9/09 def loadWords(): pathstart = "/home/foo/Documents/PyScripts/Vocab/Lists/" print "What is the … | |
I've been tearing my hair out for 2 days over this, hopefully someone here can help me. I'm trying to scrape the price data off the following webpage: [URL="http://www.morningstar.co.uk/UK/snapshot/snapshot.aspx?lang=en-GB&id=F0GBR04S4X"]http://www.morningstar.co.uk/UK/snapshot/snapshot.aspx?lang=en-GB&id=F0GBR04S4X[/URL] The value I want currently stands at 6.19 (i.e. the NAV value on the right hand side). I currently have a … | |
Hi all, I'm developing a system in Python. When the app has been a time running, its CPU consumption goes from 10% to 96% and stays there until I close it. Has anyone been in this situation and has a clue to solve it? My program uses Threads, pyserial and … | |
I am using the OptionMenu with Tkinter. I have found that sometimes when I use the OptionMenu widget, I encounter a problem. After the user clicks on the OptionMenu and selects an option, sometimes other widgets such as buttons in the window will not work until the user clicks somewhere … | |
Hello. I'm having trouble about drawing a border around a listctrl [code]"""Main module for psutils GUI""" __version__ = "$Revision: 8 $" # $Source$ import random import wx import psutil ID_EXIT = 110 class MainGUIFrame(wx.Frame): """Main frame. Shows processes and graph""" def __init__(self): """Initialization of the frame""" wx.Frame.__init__(self, None, -1, "psutils", … | |
![]() | Hey guys.. I have been making a random password maker, which makes a password of 8 characters length, but I am encountering a problem. Here'e the code I used: [CODE]import random list=['a','b','c','d','e','f','g','h','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','!','@','#','$','%','^','&','*'] randlist='' a=1 def password(): while a<=8: randlist+=random.choice(list) a+=1 return password() print randlist print 'Are you satisfied with your … |
Hello, I have file name is file.txt inside it this lines line1=hello world line2=hello web line3=hello egy I want print full lines start with line2= like in linux command cat file.txt | grep "line2=" this code will print full line --> line2=hello web And if any one have books in … | |
Hello All Can crystal reports be generate in Python ? Any suggestions plz?? | |
I would appreciate if someone could point me in a direction for setting up a publish and subscribe for udp. Here is a brief description of what I am looking for: As we know, UDP allows directly sending message and receiving message without establishing any connection.A UDP protocol is used … | |
Hey everyone, I wrote a code which runs a game of rock paper scissors, and each time you lose, it counts down until at 0, it exits. The only way I've been able to exit the code is to throw in a 'sys.exit()' command. I hear there are better ways … | |
![]() | I have a file, called 'html.html', which contains 'open_skype' in the first line and in the second line it contains the location of the file. Now, what I want to do is, make a function read the first line and then the second line should be read separately....if you don't … |
Right. Basically I'm new to Python ( Go on call me a noob) and I'm trying to make a program that will open certain programs when you give the right password. But i just can't seem to get it to open the right files. So far, I am only trying … ![]() | |
Hi I wonder if someone could point me in the right direction. I used the following code to access gmail but I got a urllib2.URLError: <urlopen error unknown url type: 'http> error when I ran it. I have included the Traceback import twill, string, os b=twill.commands.get_browser() b.set_agent_string("Mozilla/5.0 (Windows; U; Windows … | |
![]() | Hey guys.... I want to make a program which reads the HTML code from my blog, saves the HTML code as a string, so that I can check if specific words are present in the HTML code, here's the code I used: [CODE]import urllib import string open_site=urllib.urlopen('http://www.sravan953.blogspot.com') read_site=open_site.read() value=str(read_site) for … ![]() |
Hi all. I am new to Python and have a problem regarding data structures. In my application I will be having several messages and my own type of IDs (Lamport clocks) to go with these messages. I will need to frequently ask for specific messages based on the ID. Hence … | |
![]() | Can anyone teach me how to create a function which when called shuts down the computer, or opens an image or video and so on? |
yet another ridiculously simple question, yet i feel compelled to ask because i've been stuck here for like an hour without it working ok so say you have one list, a, and you need the user of the program to input a list of several more numbers, call that list … | |
Hi all, I have a rather conceptual Python question. I have written a client - server application, using sockets. So far, I'm not using any database nor file, everything is held in server's variables. Now I need to make some kind of web interface for the server - for a … | |
I am trying to write a program that generates a list and a random number on 3 seperate occations, then checks the list to see if the number is in the list, all the while, timing the procedure( Python code) 1st list is 1-100, 2nd list is 1-1000, third list … | |
quick question i have come across, i can't find a definition for it perhaps i'll have to make a couple lines to define it? anyways for list a, which has only integers, i need to define the average, x... so i'm looking for something quick to do this: [code=python] >>>a … | |
Hello, I want do somthing in python equal this code in bash For example the file.txt in it "dani_web_the_best" and want print "web" cat file.txt | cut -d"_" -f2 What equal cut -d"_" -f2 in python ? | |
[code=python] class Item: def __init__(self, id, content, userid, duedate, collapsed, inhistory, priority, itemorder, faded, projectid, checked, datestring): self.id = id self.content = content self.userid = userid self.duedate = duedate self.collapsed = collapsed self.inhistory = inhistory self.priority = priority self.itemorder = itemorder self.faded = faded self.projectid = projectid self.checked = checked … | |
![]() | Hey guys..... I have a small program which I created called 'password.py'....I wanted to share it with my friends and so on.....which is why I installed Py2exe. But it doesn't seem to work, I've used this code: [CODE]from distutils.core import setup import py2exe setup(console=['password.py'])[/CODE] and saved it as 'compiler.py'. I … |
[CODE] from math import sin, cos, pi import pygame displayWidth = 640 displayHeight = 480 fpsLimit = 90 def sinInterpolation(start, end, steps=30): values = [start] delta = end - start for i in range(1, steps): n = (pi / 2.0) * (i / float(steps - 1)) values.append(start + delta * … | |
[code]from psychopy import visual, core, misc, event import numpy #for maths on arrays from numpy.random import random, shuffle #we only need these two commands from this lib from random import * import math win = visual.Window([1024,768], units='pix', monitor='testMonitor',rgb=(-1,-1,-1)) numbers = range(100) #range of stimuli to be generated or how many … | |
Hi all I am new to programming and python and am having trouble reading particular strings from a text file and writing them out to a separate file. The file has a large number of lines, has the following format and is interspersed with signature sentences i don't need: subdoc="Book=2:chapter=1" … |
The End.