15,181 Topics
| |
| 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" … | |
| Hey guys! I run Windows XP(just though I'd let you guys in about it!) I have written code for a Facebook program: [CODE]import time import bz2 print print("Welcome to Facebook Secure Scratch pad. You can enter your Facebook password\nto encode and store.") print print("Please enter your Facebook password:") ps=raw_input() if … |
How do you render a font so that it changes when the variable changes? This is my code: [code=python] ############################## # Copyright lololol (c) 2009 # ############################## import pygame from pygame.locals import * pygame.init() GRAVITY = 0.07 FRICTION = None def getNumKeysPressed(): temp = 0 for item in pygame.key.get_pressed(): if … | |
I am taking a text file and trying to do calculations with it where the line in the file looks like this: 'Corn For Grain', 'Irrigated', '1970', 'Colorado', 'Chaffee', '8', '10', '15', '11199199', '1', '', '100 acres', '75 bushel', '7500 bushel', '', '' It has commas because it came from … | |
So, this is my hello world program for python and I have been able to solve all the problems except 1. When I grab the page data from WoWArmory in python, non-ascii characters like "ø" are printing as "ø" and "é" as "é" and so on. So, I went over … | |
I'm using HTMLParser to find some thing among this page given below. The link i'm looking to find and follow is in red. I'm using the code, also provided below to find this link, but it isn't seeming to find it at all. The portion of code that isn't working … | |
Hi; I'm learning Python, need a little help here. I have a text file which has the below data, [QUOTE] <SYNC Start=5047><P Class=ENCC> Back, back, back, back! <SYNC Start=7235><P Class=ENCC> <SYNC Start=10725><P Class=ENCC> Yeah, Dan! [/QUOTE] I want to strip the text only i.e. [QUOTE] Back, back, back, back! Yeah, … | |
I have a subtitle file and I want to extract timestamps from the file. e.g. from below lines: [QUOTE] <SYNC Start=106377><P Class=ENCC> Hey... <SYNC Start=107350><P Class=ENCC> close the door. [/QUOTE] I want to extract timestamps '106377' and '107350' and append them with the name of the file including .bmp at … | |
When I use the external module that runs the same code (line commented out) the program terminates. However, when I run the code inside the current module, the program seems to work just fine. Anyone tell me where I'm going wrong? I'd like to be able to use the utilities … | |
Hi - I've been spinning my wheels for days using Carbon.Qt to try and extract one frame from a quicktime movie, and save as a .jpg or .png or .gif to be used as a thumbnail. (You see, I have a load of quicktime movies that I'm uploading to a … |
The End.