15,175 Topics
| |
Hi guys this is my very first python program I've been trying to use re.match to test to see if a string is an identifier as defined by this syntax [CODE]identifier -> letter{ letter| digit}[/CODE] I tried the following statements but when i test my program every single time it … | |
Hello all I'm having a few issues with a Python program in that I am performing decimal calculations on and most values come up as desired, however every so often, when there is a very small decimal, the number is represented like "6.80E-7" rather than the desired "0.000000680". Here's a … | |
i am currently running Mac OS 10.5 and i have written and fully debugged (nothing in the command line) a large python script. i am wondering how am i able to create an app for the program. i do not understand the lingo of how to install different libraries and … | |
[CODE]from Tkinter import * master = Tk() def ChangeOpt1(): Options.option_clear() Options.option_add("Apple","Orange","Melon") Options.update() def ChangeOpt2(): Options.option_clear() Options.option_add("Milk","Water","Juice") Options.update() Option1=Checkbutton(text="OPTION1",indicatoron=0,command=ChangeOpt1) Option1.pack() Option2=Checkbutton(text="OPTION2",indicatoron=0,command=ChangeOpt2) Option2.pack() variable = StringVar(master) variable.set("You have to check an option") Options= OptionMenu(master, variable, "You have to check an option") Options.pack() mainloop()[/CODE] I want to do that when I clicked Option1, … | |
Hi DW, I'm extremely new to DaniWeb. I have been coding in C++ for about one month. I'm thinking about coding in Python too. But, I'd like to ask some newbie question's about it first. [B]I'd like to know what it's used for.[/B] [I]I think it's mostly used for web … | |
[CODE]#this function checks if a number is a prime number, #if not it outputs the lowest factor. def isprime(n): """Determines whether a number is a Prime number, Takes a single arguement n, which is the number""" if n==1: return 'Not a Prime number, only has one distinct factor' elif n==2: … | |
I have this code: [CODE]protein="GWEIQPYVWDECYRVFYEQLNEEHKKIFKGIFDCIRDNSAPNLATLVRVTTNHFTHEQAMMDAVKFSEVLPHKKMHRDFLEKLGGLSAPVDNHIKGTDFKYKGKAKNVDYCKEWLVL" pp="LLCCCCCCCCCCCCCCCCCCHHHHHHHHHHHHHHHHHCHHHHHHHHHHHHHHCCCCHHHHHHHCLLLCCCCCHHHHHHHHHHHHHHHHHHHCCCCCCCCCCCHHHHHHHHHHHHCCL" gor="cccccccccccchhhhhhhhhhhhhhhhhhhhhhhccccccccceeeeecccccchhhhhhhhhhhcccchhhhhhhhhhhhhccccccccccccccccccccccceeceeccceec" aber="CCCCCCCCCCCCHHHHHHHCCHHHCHHHHHHHHHHCCCCHHHHHHHHHHHCCCCCCHHHHHHHCCCCCCCHCCHHHHHHHHHHCCCCCCCCCCCCCCCCCCCCCCCCCHHHHHHHCC" for i in range(len(protein)): print i+1,protein[i], pp[i], gor[i], aber[i] [/CODE] I'm trying to compare these strings. However, the output is in a vertical format. How can I print it so that the format is vertical? This would make it much easier to … | |
This is a program that can calculate, the GPA of a student on a 5.0 scale,it's written in python 3.x and no modules are required. | |
i am tryin to create an app that should make my cellphone work as a webcam ... there are softwres like smart cam for that... also there is an app like mycam that lets you use a gif and create a vistual cam ... i want to know how an … | |
| I had recently made a .bat file that read a couple lines from file.txt and assigned them as variables then went through the execution of the bat which ended up deleting the original file.txt and writing the new values to a new file.txt. Now I want to convert this to … |
I am currently having problems displaying a file correctly once i have written a dictionary to the file. For this program the input file needs to have the format: ID: Date: Dayskept: ProductName e.g. 1:12/12/2011:12:A This is fine the first time I read the example file into a dictionary, but … | |
hi, am trying to parse a multiple pairwise format into table for example: Query= m100529_140129_SMRT1_c0000010190006406181231110_s0_p0/32965/0_332_clipped_50:0 (282 letters) Query: 8 TTTTTGAACAGCCCCAACAACTCTTCCGCTGCCGGTTGCTGCA-TTCCAGTTGTTCCACA 66 ||||||||||||||||||||||||||||||||||||||||||| |||||||||||| ||| Sbjct: 4045830 TTTTTGAACAGCCCCAACAACTCTTCCGCTGCCGGTTGCTGCACTTCCAGTTGTTC-ACA 4045772 Query: 67 GTCCAGCTCCAGTTCAACGTCGGTTTAAATCGTCG--AGCT-GTATGAGAGATAAGCATA 123 | ||||||||||||||||||||||| |||||||| |||| |||||||||||||||| | Sbjct: 4045771 GGTCAGCTCCAGTTCAACGTCGGTTTTAATCGTCGCCAGCTGGTATGAGAGATAAGCA-A 4045713 Query= m100529_140129_SMRT1_c0000010190006406181231110_s0_p0/56521/6_684_clipped_527:0 (151 letters) Query: 1 CTTCAAAGAGGGAGAATTACGTCGATATTACCGAAGGCTGGGAGAAGGGTGAAAATACAA 60 … | |
Obviously, here is the initial code for this blackjack game. and in order for me to feel confident in this game I need to have an error check to make sure that there are at least 7 cards per player. And I have to do this in the second part … | |
My tutor suggested me to use deep copy for copying tuples for pawn-chess game... can anyone help me out with how actually deep copy works ?? coz if i know it i can work it out in a more smoother way... n yea... m new to python !! | |
Crypting with xor allows one to write one function that can encrypt and decrypt a file. In this example a text file is used, but it could be an image file as well. Once you have created the encrypted file you simply send it through the same function again to … | |
[CODE]file=open(words.txt) print(file)[/CODE] Please Ive been trying to use the open() function to open a txt file in python, but it keeps telling me that there is no such file or directory, where should I put the file for me to be able to import it. HINT: I use pyscripter, but … | |
Hello, I was curious to know if there was some way to change a .py file to a .pbp file. I know that I can easily make an .exe file with py2exe, is there something like that for pbp? | |
Anyone work with UltimateListCtrl's before? I'm looking for a way to dynamically change the column headers background color. | |
hi all... i want to upload a file using ftp path1 = "D:\Python\test" host = sys.argv[1] def main(): try: f = ftplib.FTP(host) except (socket.error ,socket.gaierror),e: logging.info("Error: cannot reach '%s',%s" % (host,e)) return logging.info("***connected to host '%s'***" % host) try: f.login(user="root",passwd="aims") except ftplib.error_perm: logging.info("Error :cannot login ") f.quit() return logging.info("***logged in … | |
I can't work out why when i try to print the list(listProb....s) it prints the empty list, i'm not setting them to the empty list after this code or anything, and when i print the normDistProb's on their own it prints fine): [CODE]for i in range(0,12): listProbFog.append(normDistProb(dayValues[i], fogAve[i], fogVar[i])) listProbSnow.append(normDistPr...ob(dayValues[i], … | |
Hello All Thanks for such a informative web site. I'm a newbie to python and using python 2.6 for few weeks with no problem. I love notepad++ and trying to hook it up with python2.6 as explain in here but I can't. In notepadd++ at Run menu I get to … | |
I am quite new to Python programming, just started about a week ago, and was just designing a simple menu for a simple guessing game. I have browsed Google and other websites trying to find snippets of code that may help me but my searches haven't turned up anything. I've … | |
It will carry on if the input is X but not O!! block of code concerning this matter [code] print("\nWould you like be X's or O's ? <O/X>:") human=["",""] while not (("X") or ("O")) in human[0]: human[0]=input("") [/code] whole code: [code] print("Welcome to the greatest intelletual challenge of all time: … | |
Create a game where the computer picks a random word and the player has to guess that word. The computer tells the player how many letters are in the word. Then the player gets five chances to ask whether or not a specific letter is in that word. The computer … | |
Hi, I want to get a link from a webpage say h++p://www.daniweb.com. This page might be aspx. Then I want to extract a particular url from this and I have to open that url with some parameters. What should I use for this for doing this in python?? Just need … | |
I am working on a psycopg2 application for a customer. I first used: SELECT * from table which worked fine with 'cursor.fetchone()'. But due to some technical details between the customer's database and the database on my company's side where I could not depend on the order of the fields, … | |
Hi, I created successfully an .exe file for my python code. As a .py file, it works like a charm. But when I try to run it from the exe version, I get error as follows: [CODE] Traceback (most recent call last): File "CreateAS.pyw", line 14, in <module> File "pulp\__init__.pyc", … | |
I know that many people have programed for the Ipod, and have used a lot of different languages, but I can't figure out how to use python to make apps. I understand that I need an interpreter, but I don't know where to find one. Also, how do I import … | |
I was wondering if there is a way to make a transparent image for Tkinter. I was wanting to layer some images at random so I wouldn't know the background to use... at first I was using .GIF but I heard .PNG worked for transparency but I couldn't get .PNG … | |
I'm trying to make the old box game (if you are unfamiliar with it you can play it here: [url]http://www.tcastle.com/games/dots/dots.html[/url] I've seen it go by many different names though) and I was wondering if there was a way to get the pictures on buttons to change easily this is the … |
The End.