15,181 Topics
| |
Hi!!! I am making a program that is supose to use Naive bayes classifier to classify text from few categories. This is the best i can do to explain, here is what i have done so far: import math d=open('D.txt', 'r') di=open('kat1.txt', 'r') posleden = di.readlines() total = d.readlines() Di … | |
Hello, I am very new to python and have been going through all over the web to try to figure out my problem. I have small script that I would like to do something simple with. I have a number of files called soemthing like (myFile00.txt, myFile01.txt,...). Mainly this is … | |
Hi everybody, I'm trying to do a simple login for a web site, and everything looks fine except one thing, when I enter a name and a password for a superuser I got "403 Forbidden" error. here is my login.html: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> … | |
I just came across this question. All the solutions given are in PERL for this question. I thought I can learn solving this in Python as I could learn many thing by solving this problem. But I am stuck. The question is: You are working at a grocery store which … | |
Hello. I am working on a personal project. It's basically a program for changing specific tags from certain HTML files. So far, everything works. The GUI and the logic a work but I know the main function is wrong because it looks like this: def tag_remove(HTML_string): clean_HTML = a_string.replace('<b>', '').replace('<i>', … | |
Hello all, I'm very new to programming and Python so please forgive my ignorance. i'm just wondering if it's possible to have two strings on one elif. Something like this. name = input("What is your full name: ") if name == "Jack Neilson": print("I like your name") elif name == … | |
What this produces and why? >>> a = 2 >>> b = 5 >>> exec "print(a+b)" in dict(a=6, b=9) | |
hi, i made a music player it opens almost all the songs but while opening some songs it gives this error : A:/Chrome Downloads/Jhalla_Wallah_(Remix)_-_(MusicTub.Com).mp3 Error 277 for "open "A:Chrome DownloadsJhalla_Wallah_(Remix)_-_(MusicTub.Com).mp3" alias mp3_0.878022650438": A problem occurred in initializing MCI. Error 263 for "set mp3_0.878022650438 time format milliseconds": The specified device is … | |
Hi, I'm trying to take two text files, compare them, then output the matches into a new text file. I've read the thread started by the1last, but that's outputting differences, not matches. I just started learning about python a couple days ago, so I don't know anything about what syntax … | |
Hello, Is there a Python tutor in this group who would be willing to help me with about 3 - lines of code. I have an assignment due on the 4th of July and am a little stuck. Thank You, HR | |
Hello, I am having trouble writing a variable named UpperCaseSentence outside of a for loop in this particular code snippet. It runs fine while in the loop but not while out of the loop. Can anyone shed some light on this dilemma for me. Here is the code. Thank you … | |
| Is it possible to create a scripting language using Python? Interactive Shell is fine, just something which comes close to a scripting language? Which allows the user to script some sort of functionality? Maybe more that just a console like this: def main(): cmd = (raw_input('#>>')) if cmd=="do_stuff": print "Ok, … |
I have downloaded vpython and try to run one of the examples included with the program. [CODE]from visual import * floor = box(length=4, height=0.5, width=4, color=color.blue) ball = sphere(pos=(0,4,0), color=color.red) ball.velocity = vector(0,-1,0) dt = 0.01 while 1: rate(100) ball.pos = ball.pos + ball.velocity*dt if ball.y < 1: ball.velocity.y = … | |
I have to write an application in python for image processing.I have made scripts of all the image editing options. Now I want to add GUI in it. I want a window where I can give the path of an image on which I want to perform the editing! At … | |
Hi, People... I have a question about reading xls files in python then parsing it to sqlDatabase. The thing is, that the xls file(pricelist) we as a company use are ordered and it's pretty easy to sort that out. The problem comes with xls files from other companies. (We are … | |
| This is a program using the `urllib` module to find the (html/any client-side script) source code of any website which exists. Have fun! |
| Hi guys, I am having a problem with the following code: #Health set here def win(): import time print "You win!" print "Thanks for playing" time.sleep(10) quit() def lose(): import time print "You lose!" print "Thanks for playing" time.sleep(10) quit() from random import randint pos_damage = randint(15,472) en_health = 1000 … |
Hi all! Is my first post here and well, im very new with python (just aroun 10 days). I did the famous "Guess my number" game. (Python pick up a number and user must guess it). All right, i have not problems with this. But now im trying in the … | |
hey if anyone knows how to open open window when we click on open option in menu bar of gui which is created by boa constructor. | |
Hey, Iv been looking around google for the past few days to find ways to embed python 3.2 into my c++ application. I however want interpeter to be compiled into my application, so i can merely distribute one exe file without relying on the user to install python. However the … | |
I recently left Python behind to pick up Java. In Python, a variable defined in a function could not be called outside of the function. But you could at least let the function return a value, which could be a variable defined in the function. When a variable is defined … | |
Hi. I'm a python noob who codes for fun, so please only critize me if you're trying to help. I'm on python 2.7 and built this code for fun. (dont ask what the questions are mean. its private info) Start = True while Start: print "Would you like to play … | |
| Well, in python I was planning to do something like this: >> echo text text >> But I just cant find a way to do it! I know that for user input i will use `input()`, but how do I get it to echo the text specified? |
Do not miss http://www.daniweb.com/community-center/geeks-lounge/threads/424660/code-snippet-contest | |
Hey guys, I am a non-root user on a linux machine and I'm working with mpi4py. I have an alias set to my python-2.7 that has all of the modules that I loaded into it. So if I type 'python' and then 'from mpi4py import MPI' everything is fine. The … | |
Is it possible to keep writing the output of a program on the same line instead of moving to a new line every time? The output should be written over the preceding output. An example would be a kind of counter... say a number that counts from 1 to 10 … | |
This class just keeps getting worse. My next lab he had us do is this, **"Write a program that computes the intersection of a circle with a horizontal line and displays the information textually and graphically".** He gave us absolutely no help or anything to do this. He just said … | |
Hi, If I have a list of strings, it's easy to output them using .join(). For example: mylist=['hi', 'there', 'girls'] myout='\t'.join(mylist) What I want to know is if there is a builtin python method that acts like join, except it automatically converts ints and floats to strings without giving a … | |
I have this: import re subs = [] def subcons(data): match = re.search(r'(<[a-z]{3})', data) if match: subs.append(match.group(0)) data = data.replace(match.group(0), '') subcons(data) else: print data return data, subs input = 'ABC <uvw <xyz some random data' e, f = subcons(input) print e print f The print statement in the else … | |
Do you get content of oper right before trying it out? oper = ['plus', 'minus', 'times'] oper.extend('divide') How about do you know what happens when you run this? Big bang? ;) print('a' 'b' 'c') And this is same, isn't it`? c = 'c' print('a' 'b' c) |
The End.