473,403 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Easy Python Function Question

3
I need to create a program called extractGenes.py

The command line parameters need to take 2 OR 3 parameters

1. -s: this is an optional parameter, or switch, indicating that the user wwants the spliced gene sequence(introns removed). The user does not have to provide this (meaning he wants the entire gene sequence), but it he does provide it then it must be the first parameter

2. input file (with the genes)

3. output file (where the program will create to store the fasta file

the file contains line like this:

NM_001003443 chr11 + 5925152 592608098 2 5925152,5925652, 5925404,5926898,

However, I am not sure how to include the -s, optional parameter, into the starting function.
Apr 21 '12 #1
1 1331
dwblas
626 Expert 512MB
Check the length (or elements) of sys.argv to see if -s was used.
Apr 21 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Joe | last post by:
The recipe in question is "Implementing Static Methods". It shows how to use staticmethod(). This sentence in the Discussion section isn't clear to me: "An attribute of a class object that...
1
by: Garett Shulman | last post by:
Hello, I am trying to create a wrapper for a function with the following prototype: int ap_get_playlist(int session, int *argc, char ***the_list); I'm not quite sure how to construct the...
1
by: Yanping Zhang | last post by:
Here are more details about my codes, please help! The function declared in C: typedef void (WINAPI *PLEARNCALLBACKPROC) (unsigned int progress, unsigned int sigQuality, unsigned long...
0
varuns
by: varuns | last post by:
if i need to call a python function from c, i can use PyImport _Import() python-c API. Following code shows calling python function "add1" from python module "def1" int add(int x, int y) { ...
5
by: fernando | last post by:
Could someone post an example on how to register a python function as a callback in a C function? It expects a pointer to PyObject... how do I expose that? Basically, the signature of the function...
0
by: grbCPPUsr | last post by:
I am new to Python. I would like to use Python for the specialized purpose of dynamic expressions parsing & evaluation in my C++ application. I would like to encapsulate the expressions to be...
9
by: grbgooglefan | last post by:
I am trying to pass a C++ object to Python function. This Python function then calls another C++ function which then uses this C++ object to call methods of that object's class. I tried...
0
by: bruce | last post by:
hey guys... i managed to solve what i was attempting.. my goal was rather simple, to be able to have a python script, call a ruby app, and be able to return a value from the ruby (child) app to...
6
by: Daniel | last post by:
I hope this question is OK for this list. I've downloaded Rpyc and placed it in my site packages dir. On some machines it works fine, on others not so much. Here is one error I get when I try...
2
by: natachai | last post by:
I am new in python and pysqlite. Right now, I am reallly trying to figure it out the way that I can make python function read the table in sqlite database and calculate data using SQL language. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.