15,190 Topics

Member Avatar for
Member Avatar for max.yevs

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 …

Member Avatar for max.yevs
0
90
Member Avatar for max.yevs

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 …

Member Avatar for max.yevs
0
172
Member Avatar for dingletoo

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 …

Member Avatar for siddhant3s
0
63
Member Avatar for Summer_Intern

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 …

Member Avatar for Summer_Intern
0
2K
Member Avatar for SoulMazer

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 …

Member Avatar for jlm699
0
103
Member Avatar for njparton

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 …

Member Avatar for njparton
0
191
Member Avatar for Jarmok

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 …

Member Avatar for sneekula
0
50
Member Avatar for mg0959

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 …

Member Avatar for sneekula
0
76
Member Avatar for TerabyteST

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", …

Member Avatar for TerabyteST
0
347
Member Avatar for sravan953

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 …

Member Avatar for lllllIllIlllI
0
121
Member Avatar for zoro007

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 …

Member Avatar for siddhant3s
0
125
Member Avatar for bhanu1225

Hello All Can crystal reports be generate in Python ? Any suggestions plz??

0
54
Member Avatar for jayrodau

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 …

0
41
Member Avatar for hughesadam_87

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 …

Member Avatar for hughesadam_87
0
146
Member Avatar for sravan953

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 …

Member Avatar for vegaseat
0
8K
Member Avatar for Aestter

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 …

Member Avatar for sravan953
0
168
Member Avatar for amadain

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 …

0
83
Member Avatar for sravan953

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 …

Member Avatar for sravan953
0
169
Member Avatar for akindo

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 …

Member Avatar for akindo
0
137
Member Avatar for sravan953

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?

Member Avatar for dads
0
158
Member Avatar for max.yevs

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 …

Member Avatar for shadwickman
0
171
Member Avatar for rope78

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 …

0
60
Member Avatar for jen638

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 …

Member Avatar for slate
0
159
Member Avatar for max.yevs

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 …

Member Avatar for max.yevs
0
162
Member Avatar for zoro007

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 ?

Member Avatar for zoro007
0
105
Member Avatar for Wraithan

[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 …

Member Avatar for slate
0
1K
Member Avatar for sravan953

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 …

Member Avatar for Stefano Mtangoo
0
85
Member Avatar for seamonkie

[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 * …

0
38
Member Avatar for mindfad

[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 …

Member Avatar for mindfad
0
204
Member Avatar for fatbob

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" …

0
69

The End.