15,181 Topics

Member Avatar for
Member Avatar for Toni_3

i need to write a loop program converting celsius to farenheit using the formula F=9*C/5+32 and terminating at -999

Member Avatar for Slavi
1
200
Member Avatar for Slavi

Hey guys, I am making a few gui programs and I was wondering on this code .. class PaintChart(wx.Panel): def __init__(self, parent, data): self.data = data.split() wx.Panel.__init__(self, parent) self.SetBackgroundColour('BLACK') self.Bind(wx.EVT_PAINT, self.drawChart) def drawChart(self, e): dc = wx.PaintDC(self) dc.SetDeviceOrigin(30, 240) dc.SetAxisOrientation(True, True) dc.SetPen(wx.Pen('RED')) dc.DrawRectangle(1, 1, 300, 200) Here I set the …

Member Avatar for Slavi
0
411
Member Avatar for Manuela_1

#!/usr/bin/python import Evaluar from pylab import * from numpy import * def biseccion(a, b, TOL, N): Evaluar.dicc_seguro['x']=a fa = eval(Evaluar.funcion, {"__builtins__":None}, Evaluar.dicc_seguro) vectorx = zeros(N, Float64) vectory = zeros(N, Float64) i = 1 while i<=N : p = (a+b)/2.0 vectorx[i-1] = p Evaluar.dicc_seguro['x']=p fp = eval(Evaluar.funcion, {"__builtins__":None}, Evaluar.dicc_seguro) vectory[i-1]=fp if …

Member Avatar for Gribouillis
0
346
Member Avatar for Tcll

apparently this seems to be pretty unheard of because of the over-glorified NumPy extension, which yes is faster than using python alone, but most likely not as fast as defining the raw complex methods such as matrix inversion in plain C. with NumPy you need to make an array object …

0
113
Member Avatar for greenleafone7

I have a 'User' model holding some information like username password etc. After installing swingtime I was hoping to correlate its 'Event' model with my 'User' model so I can add events for every individual user. The thing is that in order to do that I need to have a …

Member Avatar for greenleafone7
0
177
Member Avatar for Felipe_1

import evaluar from pylab import * from numpy import * def puntofijo(po,TOL, N): vectorx = zeros (N, Float64) vectory = zeros (N, Float64) i = 1 while i<=N : vectorx[i-1] = po Evaluar.dicc_seguro['x']=po fp = eval(Evaluar.funcion, {"__builtins__":None}, Evaluar.dicc_seguro) vectory[i-1]=fp if fabs(po-fp): print "La raiz buscada es: ",po, "con", i-1, "iteraciones" …

Member Avatar for rubberman
0
793
Member Avatar for Felipe_1

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 …

Member Avatar for Gribouillis
0
219
Member Avatar for mark103

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 …

Member Avatar for Gribouillis
0
333
Member Avatar for venk7

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

Member Avatar for venk7
0
307
Member Avatar for davidbr

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 …

Member Avatar for Gribouillis
0
473
Member Avatar for Riya_2

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 …

Member Avatar for Ene Uran
0
119
Member Avatar for Deebash_1

SOMEONE HELP ME line 23, in <module> class Yakudi(ch.RoomManager): AttributeError: 'module' object has no attribute 'RoomManager'

Member Avatar for Gribouillis
0
255
Member Avatar for venk7

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

Member Avatar for Gribouillis
0
403
Member Avatar for venk7

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

0
93
Member Avatar for lewashby

#!/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 …

Member Avatar for vegaseat
0
2K
Member Avatar for venk7

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 …

Member Avatar for Gribouillis
0
400
Member Avatar for vegaseat

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 …

Member Avatar for vegaseat
2
8K
Member Avatar for Tcll

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 …

Member Avatar for Tcll
0
266
Member Avatar for D3N9

Need to have balls moved when touched using getmouse() also need an if then statement when ball is clicked to have it moved

Member Avatar for Schol-R-LEA
0
233
Member Avatar for winecoding

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

Member Avatar for vegaseat
0
395
Member Avatar for kouty

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

Member Avatar for kouty
0
303
Member Avatar for Tcll

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 …

Member Avatar for Tcll
0
1K
Member Avatar for new2py

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 …

Member Avatar for new2py
0
305
Member Avatar for cheeseman125

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

Member Avatar for BustACode
0
235
Member Avatar for fonzali

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 …

Member Avatar for fonzali
0
4K
Member Avatar for BustACode

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 …

Member Avatar for snippsat
2
514
Member Avatar for Tcll

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

Member Avatar for Tcll
0
257
Member Avatar for jolio5

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 …

Member Avatar for vegaseat
0
178
Member Avatar for Tcll

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 …

Member Avatar for Tcll
0
2K
Member Avatar for ccandillo

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 …

Member Avatar for ccandillo
0
743

The End.