15,175 Topics
| |
my project consists of 6 files with .py. The first is the main project file, which I called Metodos.py and whose code is: #!/usr/bin/python # coding: latin-1 #import os, sys import Menu from numpy import * Menu.elmenu() Let's see the code Menu.py file: #!/usr/bin/python # coding: latin-1 from math import … | |
Hi all, I need some help with my code, because I have a bit of trouble with using the `cur.execute` in the loops. When I try this: for pos_X, pos_Y, prog_id, prog_width in zip(positions_X, positions_Y, programs_id, program_width): cur.execute('SELECT button_ids, button_width FROM buttons where button_ids=?', [prog_id)) if int(pos_X) == 375: if … | |
In a python script I gave a call in this way: do.call([cfg.tool_cmd("cuffdiff"), "-p", str(cfg.project["analysis"]["threads"]), "-b", str(cfg.project["genome"]["fasta"]), "-u", cfg.project["experiment"]["merged"], "-L", "%s,%s" % (str(cfg.project["phenotype"][0])[2:8],str(cfg.project["phenotype"][1])[2:7]), "-o", output_folder] + [cfg.project["samples"][0]["files"]["bam"] + ' ' + cfg.project["samples"][1]["files"]["bam"]], cfg.project["analysis"]["log_file"]) This gives the command: Command '['/usr/local/bin/cuffdiff', '-p', '5', '-b', '/scratchsan/venkatesh/TuxedoProject/data/genome/ce10.fa', '-u', 'pipeline/merging/merged.gtf', '-L', 'embryo,larva', '-o', 'pipeline/degenes', 'pipeline/SAMN00990702-1/mappings/accepted_hits.bam pipeline/SAMN00990702-2/mappings/accepted_hits.bam']' … | |
I have this code which open a frame, count 5 seconds and then open another frame. Here i have some buttons that should open different frames but they all open same second frame that is already opened by counter. I don t get it why is this happen. Any idea … | |
write a function named makeWordList() that takes two paramaters: 1. readFileName is a string that is the name of a file containing text 2. writeFileName is a string that is the name of a file that makesWordList() writes it outputs to. it should contain of of the words in the … | |
SOMEONE HELP ME line 23, in <module> class Yakudi(ch.RoomManager): AttributeError: 'module' object has no attribute 'RoomManager' | |
I gave a call in this way: print("-L", str(cfg.project["phenotype"][0]), str(cfg.project["phenotype"][1])) This will read the below one phenotype: - embryo: [SAMN00990702-1] - larva: [SAMN00990702-2] And it should give: -L embryo,larva But it is giving like: -L {'embryo': ['SAMN00990702-1']} {'larva': ['SAMN00990702-2']} Can anyone help me in solving this problem. Thank you !! | |
I run a command on command line like : cuffdiff -o diff_out4 -b ../genome/ce10.fa -p 2 -L larval,early -u merged_asm/merged.gtf ../tophat/em/SRR493359_60_61_thout/accepted_hits.bam ../tophat/em/SRR493363_64_65_thout/accepted_hits.bam Both bam files are separated with "space". Now the same command I gave a call in python script: do.call([cfg.tool_cmd("cuffdiff"), "-b", str(cfg.project["genome"]["fasta"]), "-u", cfg.project["experiment"]["merged"], "-o", output_folder] + [cfg.project["samples"][0]["files"]["bam"] cfg.project["samples"][1]["files"]["bam"]], … | |
#!/usr/bin/env python3 tm = open('./timemachine.txt', 'r') Dict = {} for line in tm: line = line.strip() line = line.translate('!"#$%&'()*+-./:;<=>?@[\\]^_`{|}~') line = line.lower() List = line.split(' ') for word in List: if word in Dict: count = Dict[word] count += 1 Dict[word] = count else: Dict[word] = 1 for word, count … | |
This is an R script which I used for plotting. Can anyone please give me a python code for this. Thanks in Advance !! setwd("/pipeline/deff") source('http://www.bioconductor.org/biocLite.R') biocLite('cummeRbund') library(cummeRbund) cuff_data <- readCufflinks('deff') pdf("allplots.pdf") #"distbtn of expression levels for each dataset" plot(csDensity(genes(cuff_data))) #"compare the exp of each gene in all the conditions … | |
A few hundred years ago the glorious leader of a big country wanted to reward the creator of the chess game. The creator of the game simply wanted one grain of rice put on the first square of the chessboard, two grains on the second, then doubling it for every … | |
I'm stuck dealing with strings which is a pain when porting code... I'm doing stuff such as porting this: enum { VAL_NULL = 0, VAL_INT, VAL_FLOAT, VAL_STR, VAL_ANY, VAL_CODE, VAL_MACRO, VAL_IDENT }; to this: for i,v in enumerate([ 'VAL_NULL','VAL_INT','VAL_FLOAT','VAL_STR','VAL_ANY','VAL_CODE','VAL_MACRO','VAL_IDENT' ]): globals()[v]=i anyone know of a method I could use to … | |
Need to have balls moved when touched using getmouse() also need an if then statement when ball is clicked to have it moved | |
I am trying to do some text processing tasks against a collection of files stored in a directory. The data set is just standard 20-newsgroup data. However, running the following code segement gives error message such as `UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 240: invalid start byte` … | |
Have a good evening! **The Aim:** to obtain a Sieve of Erastothenes **The Means:** to build a function of a number n that the prime numbers up to n. **The code** supposed to make this from math import sqrt def holeofStrainer(): """The purpose is to build a sieve of Erasthotenes. … | |
what I'm basically trying to do is: x = struct( size=4, order='var0', # <<< struct.__call__( size, order, **vars ) var0 = bu32 # { 'var0': bu32, } ) data = x() # read data from imported file print data.var0 # should return a bu32 int if data.__class__ == x: pass … | |
Hi, I'm new to Python - and new on here.... I've read lots of tutorials on Python and am currently in an intro to programming class using python, but I can't figure this out. I've searched stack overflow, dani web, java2s, github and many others but can't understand what I'm … | |
So im extremely new to python. Im teaching it to myself for a school project and i heard that calculators are a good place to start so that's exactly what im doing. I have only been using it for about a day now so like i said im pretty newb. … | |
hi , I am trying to first ask the user how many numbers he has ( I have not coded this part yet but assumed number 5 ), then enter the first number , hit enter , enter another number in the same entery widget up until the numbers are … | |
I needed a random color selector. I found one [here](http://peepspower.com/python-script-to-generate-random-css-colors). I rewrote it to make it more general purpose. "f_GenRandomColor" is the picker. The output is in list form, which should make it suitable for most general applications. "f_HTMLRandomColorChart" is just a way to create an HTML table to test … | |
alright, so here's what I got: # -*- coding: utf-8 -*- W = 25 l = [[u'â–‘' for c in range(W)] for r in range(5)] _Y = 2 for X in range(W): Y = _Y+((X&3)-(X&2))-(2*((X&3)==3)) # <-- this could be better l[Y][X] = u'â–ˆ' for r in l: print ''.join(r) … | |
I need to reduce the length of this code in Python3 as much as possible (even if it will be less readable): a,b,x,y=[int(i) for i in input().split()] while 1: r='' if y<b:r='S';y+=1 if y>b:r='N';y-=1 if x<a:r+='E';x+=1 if x>a:r+='W';x-=1 print(r) It's a map: you are on (x,y) and you need to … | |
as the title states, on on linux (Wine32) it works perfectly: http://lh3.ggpht.com/-heB_VObWcwE/VUgfS4bkLkI/AAAAAAAAJAA/tHZzjq2RElw/s642/SIDE_firstPort.png but on windows (synced code) I get this: Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> ================================ RESTART ================================ >>> C:\Documents and Settings\Owner\My … | |
I have a tkinter app that has 2 frames. The frame on the left has a bunch of buttons and the frame on the right has a text widget. I use the create_buttons function below to make the buttons. Is there a way to have the button stay sunken when … | |
I was wanting to create something very specific that I have yet to run into yet googling the topic. I want to create a radviz graph with many parameters, which is well documented. I'll give you an example that might help clarify what I'm trying to do. So here are … | |
HI Guys, I am trying to Create a GUI in Python that calculate the average of three numbers. I am having some issues tring to create the three boxes where the user should enter the numbers, so can anybody please give me a hand? Thank you so much!!!! | |
array = [10.4 , 10.4,10.4 ,10.4,11.0] Need to find the all the values in array are equal, if values are not equal get the first non equal value. expected: false for the above example. get the value 11.0 | |
I have this code which if i press msgbox yes it opens another frame but if i do same thing from another function (counter) i get an error. Can someone help me and tell what is wrong? import tkMessageBox import Tkinter as tk from Tkinter import * from functools import … | |
This is a program that will calculate stockin expenses and other but the problem is whatever value i entered in the cement, bricks and etc(line 120-line155) part it keeps on showing zero import Tkinter Total_StockIn = 0 Total_Expenses = 0 def win1(): global root global s # this is the … | |
so I was trying to think of ways to reduce python's memory usage when you write your code. my logic is telling me your class instances will use less memory if you write your class functions before writing your class: def classfunc( inst, arg ): pass class mainclass: pass inst … |
The End.