15,175 Topics

Member Avatar for
Member Avatar for coconutdumplin

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 …

Member Avatar for coconutdumplin
0
113
Member Avatar for Simplified

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 …

Member Avatar for Simplified
0
212
Member Avatar for jordan0420

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 …

Member Avatar for e-papa
0
128
Member Avatar for xleon

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

Member Avatar for xleon
0
4K
Member Avatar for Voidz

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 …

Member Avatar for e-papa
0
275
Member Avatar for e-papa

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

Member Avatar for e-papa
0
220
Member Avatar for dustbunny000

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 …

Member Avatar for jice
0
230
Member Avatar for e-papa

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.

Member Avatar for TrustyTony
0
6K
Member Avatar for dos_killer

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 …

Member Avatar for dos_killer
0
107
Member Avatar for khaos64

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 …

0
119
Member Avatar for banannamoofin

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 …

Member Avatar for TrustyTony
0
205
Member Avatar for elbib84

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 …

Member Avatar for griswolf
0
151
Member Avatar for bwbyron

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 …

Member Avatar for woooee
0
316
Member Avatar for alokdhari

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 !!

Member Avatar for alokdhari
0
206
Member Avatar for vegaseat

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 …

Member Avatar for TrustyTony
3
7K
Member Avatar for e-papa

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

Member Avatar for e-papa
0
175
Member Avatar for lucksoar

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?

Member Avatar for TrustyTony
0
264
Member Avatar for ihatehippies

Anyone work with UltimateListCtrl's before? I'm looking for a way to dynamically change the column headers background color.

0
106
Member Avatar for rssk

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 …

Member Avatar for richieking
0
541
Member Avatar for spe_eddy

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

Member Avatar for TrustyTony
0
181
Member Avatar for Echo_2011

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 …

Member Avatar for e-papa
0
1K
Member Avatar for Atistus

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 …

Member Avatar for Atistus
0
172
Member Avatar for ThePythonNoob

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

Member Avatar for ThePythonNoob
0
100
Member Avatar for shawntheking

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 …

Member Avatar for TrustyTony
0
115
Member Avatar for MASTERofMINDS

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 …

Member Avatar for snippsat
0
138
Member Avatar for markmcwiggins

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

Member Avatar for markmcwiggins
0
159
Member Avatar for Shansal

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

0
50
Member Avatar for lucksoar

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 …

Member Avatar for lucksoar
0
251
Member Avatar for Thropian

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 …

Member Avatar for Thropian
0
26K
Member Avatar for Thropian

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 …

Member Avatar for Thropian
0
124

The End.