Re: [Tutor] vcf_files and strings

2011-10-05 Thread Andreas Perstinger
On 2011-10-05 21:29, Anna Olofsson wrote: vcf file: 2 rows, 10 columns. The important column is 7 where the ID is, i.e. refseq.functionalClass=missense. It's a missense mutation, so then I want to extract refseq.name=NM_003137492, or I want to extract only the ID, which in this case is NM_003137

Re: [Tutor] a quick Q: how to use for loop to read a series of files with .doc end

2011-10-05 Thread Andreas Perstinger
On 2011-10-06 05:46, lina wrote: On Thu, Oct 6, 2011 at 4:33 AM, Prasad, Ramitwrote: Dictionaries {} are containers for key/value based pairs like { key : value, another_key : value(can be same or repeated) } For example: {'B': [0, 0, 0, 0, 0, 0], 'E': [2, 1, 4, 0, 1, 0]} The keys here are

[Tutor] declaring a blank interger

2011-10-05 Thread Mike Nickey
Hey all, I'm sorry for such a silly question but I want to declare a blank integer for x. What I have is a base for a program that I'm working on for fun. Yes, for fun. The long term goal is to create a way to log items that are currently being done via pencil & paper and make this easier for

Re: [Tutor] a quick Q: how to use for loop to read a series of files with .doc end

2011-10-05 Thread lina
On Thu, Oct 6, 2011 at 2:01 AM, Alan Gauld wrote: > On 05/10/11 13:46, lina wrote: > > another question, you know in linux, when use TAB, can automatically >> input something, >> so in python3, are there some way they can intelligent give some hints >> or fill the left. >> > > What development to

Re: [Tutor] a quick Q: how to use for loop to read a series of files with .doc end

2011-10-05 Thread lina
On Thu, Oct 6, 2011 at 4:33 AM, Prasad, Ramit wrote: > >>yes, you're iterating over the keys of a dictionary. Since it only has > the key "E", that's what you get. Try printing dir(results) to see what > methods might return something other than the key. Make the language work > for you. > > >S

Re: [Tutor] String switch

2011-10-05 Thread bob gailer
On 10/5/2011 5:51 PM, Christopher King wrote: There is a program that will open another program, write code at the top of the program. The code at the top will cause the program to print all strings afterwards in swap case. Please provide a sample program that you wish to modify. -- Bob Gail

Re: [Tutor] Mac IDE

2011-10-05 Thread Liam Clarke
I second the recommendation of PyCharm, it's the best Python IDE I've used. Alan - OS X has Vim by default? At least, I've always used it and never installed it, but I started from 10.5. Regards, Liam Clarke On 30/09/2011, at 3:43 AM, Tom Tucker wrote: > > Another IDE to consider that suppo

Re: [Tutor] String switch

2011-10-05 Thread Christopher King
There is a program that will open another program, write code at the top of the program. The code at the top will cause the program to print all strings afterwards in swap case. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

[Tutor] vcf_files and strings

2011-10-05 Thread Anna Olofsson
Hi, I'm a beginner at Python and would really like some help in how to extract information from a vcf file. The attached file consists of a lot of information on mutations, this one though is just 2 rows and 10 columns (the real one has a lot more rows). I want to extract the mRNA ID only i

Re: [Tutor] a quick Q: how to use for loop to read a series of files with .doc end

2011-10-05 Thread Prasad, Ramit
>>yes, you're iterating over the keys of a dictionary. Since it only has the >>key "E", that's what you get. Try printing dir(results) to see what methods >>might return something other than the key. Make the language work for you. >Sorry I am not smart. value? Dictionaries {} are container

Re: [Tutor] regex and parsing through a semi-csv file

2011-10-05 Thread Wayne Werner
On Wed, Oct 5, 2011 at 1:12 PM, Mina Nozar wrote: > > If there is a more graceful way of doing this, please let me know as well. > I am new to python... > I just glanced through your email, but my initial thought would be to just use regex to collect the entire segment that you're looking for

[Tutor] regex and parsing through a semi-csv file

2011-10-05 Thread Mina Nozar
Hi everyone, I am post processing data from the output of simulation of activities for various radionuclide produced in a reaction at different times. I have already combined the information from 13 files (containing calculated activities and errors for 13 different times). The format of thi

Re: [Tutor] extract information from txtfile

2011-10-05 Thread Alan Gauld
On 04/10/11 21:00, Anna Olofsson wrote: The table looks something like this, but with many more columns and rows: # chr Pos ID REF ALT . . . . . . . . . . . 1 13645 - C T . . . . . I want to extract certain data from this table above and make it to a sentence looking something like this: chr1:

Re: [Tutor] a quick Q: how to use for loop to read a series of files with .doc end

2011-10-05 Thread Alan Gauld
On 05/10/11 13:46, lina wrote: another question, you know in linux, when use TAB, can automatically input something, so in python3, are there some way they can intelligent give some hints or fill the left. What development tool are you using? If you use IDLE, the standard IDE that comes with P

Re: [Tutor] a quick Q: how to use for loop to read a series of files with .doc end

2011-10-05 Thread lina
> I ask again. What did results look like when you print it out. I'm > referring to the argument to writeonefiledata(). > >> def writeonefiledata(outname,**results): >> > put the lines here: >print ("results is: ", results) >print("repr is:", repr(results)) $ python3 c

Re: [Tutor] fake defrag revisited

2011-10-05 Thread Wayne Werner
On Wed, Oct 5, 2011 at 8:18 AM, Dave Angel wrote: > Anyway, you can slow it down drastically by alternating bubble passes with > random passes, where in each case a random pair is swapped if they're out of > order. > You can also slow it down by adding a time.sleep(1) (sleeps for 1 second). Use

Re: [Tutor] extract information from txtfile

2011-10-05 Thread bob gailer
On 10/4/2011 4:00 PM, Anna Olofsson wrote: Hi, I'm a beginner at Python and I'm trying to extract some information from a textfile where I have a lot of data. The table looks something like this, but with many more columns and rows: # chr Pos ID REFALT . . . . . . .

Re: [Tutor] a quick Q: how to use for loop to read a series of files with .doc end

2011-10-05 Thread Dave Angel
On 10/05/2011 08:46 AM, lina wrote: On Wed, Oct 5, 2011 at 8:21 PM, Dave Angel wrote: #these two are capitalized because they're intended to be constant TOKENS = "BE" LINESTOSKIP = 43 INFILEEXT = ".xpm" OUTFILEEXT = ".txt" def dofiles(topdirectory): for filename in os.listdr(topdirector

Re: [Tutor] fake defrag revisited

2011-10-05 Thread Dave Angel
On 10/05/2011 07:58 AM, R. Alan Monroe wrote: Since all the moves are swaps, it'll be guaranteed to be in a sequence that converges on the correct final order. Will it be the minimum number of moves? Definitely not. But that wasn't a requirement, and if it were, you wouldn't start by building t

Re: [Tutor] a quick Q: how to use for loop to read a series of files with .doc end

2011-10-05 Thread lina
On Wed, Oct 5, 2011 at 8:21 PM, Dave Angel wrote: > > >> >>> #these two are capitalized because they're intended to be constant >>> TOKENS = "BE" >>> LINESTOSKIP = 43 >>> INFILEEXT = ".xpm" >>> OUTFILEEXT = ".txt" >>> >>> def dofiles(topdirectory): >>>for filename in os.listdr(topdirectory):

Re: [Tutor] a quick Q: how to use for loop to read a series of files with .doc end

2011-10-05 Thread Dave Angel
On 10/05/2011 02:51 AM, lina wrote: On Wed, Oct 5, 2011 at 1:42 PM, Dave Angel wrote: On 10/04/2011 11:13 PM, lina wrote: On Wed, Oct 5, 2011 at 10:45 AM, Dave Angel wrote: On 10/04/2011 10:22 PM, lina wrote: On Wed, Oct 5, 2011 at 1:30 AM, Prasad, Ramit *com w SyntaxError: inva

Re: [Tutor] fake defrag revisited

2011-10-05 Thread R. Alan Monroe
> Since all the moves are swaps, it'll be guaranteed to be in a sequence > that converges on the correct final order. Will it be the minimum > number of moves? Definitely not. But that wasn't a requirement, and if > it were, you wouldn't start by building that list of tuples. I did get a sem

Re: [Tutor] Calling Python Functions from Powershell scripts

2011-10-05 Thread Christian Witts
On 2011/10/05 09:32 AM, Nikunj Badjatya wrote: Howdy All, To give an overview of the problem, I have an installer. It is used to install virtual machines at specific location. The installer is written in Powershell and Python. The topmost script is in Python ( install.py ) which internally ca

Re: [Tutor] Calling Python Functions from Powershell scripts

2011-10-05 Thread bodsda
You can run .py files from powershell, just like you would run any other command - 'python myfile.py' I don't have any experience of the logging modules, but what I do when using multiple languages is have them all write to the same plain text log file and just prepend [] to the beginning of ea

[Tutor] Calling Python Functions from Powershell scripts

2011-10-05 Thread Nikunj Badjatya
Howdy All, To give an overview of the problem, I have an installer. It is used to install virtual machines at specific location. The installer is written in Powershell and Python. The topmost script is in Python ( install.py ) which internally calls other .py and .PS1 ( powershell ) scripts using