Data Warehousing (1107) Databases (3004) JAVA Related 2673) MainFrames (975) Microsoft Related (2296) Networking (553)
Operating Systems (919) Programming (3254) SAP (2318) Testing FAQS (1674) Testing Material (252) Web Related (994)

what is '1000 projects'?

'fullinterview.com' is a educational content website dedicated to finding and realizing final year projects for btech, be, mtech, mca students, here you can search, find your projects and get guidance from experts the below are the different technological projects.
visual Studio projects .net projects, asp projects, c & ds projects, c++ projects (all), cold fusion projects, delphi projects, java projects, perl projects, php projects, sql projects, vc++ projects, visual basic projects.

how it works?

well, everything on this site is submitted by the student and professional community. after you submit your project, it is being verified and approved by our administrator. after approval, other people can read/discuss it, save to favorites.

more number of projects?

here you can find morethan 1000 projects on different technologies, if u want to get more projects please visit our sister sites www.fullinterview.com & Chetanasprojects.com


Category Articles
How can I mimic CGI form submission (METHOD=POST)?
Added on Sun, Jan 10, 2010
I would like to retrieve web pages that are the result of POSTing a form. Is there existing code that would let me do this easily? Yes. Here's a simple example that uses httplib: #!/usr/local/bin/python ... Read More
How do I convert a string to a number?
Added on Sun, Jan 10, 2010
For integers, use the built-in int() type constructor, e.g. int('144') == 144. Similarly, float() converts to floating-point, e.g. float('144') == 144.0. By default, these interpret the number as decimal... Read More
Is there a scanf() or sscanf() equivalent?
Added on Sun, Jan 10, 2010
Not as such. For simple input parsing, the easiest approach is usually to split the line into whitespace-delimited words using the split() method of string objects and then convert decimal strings to numeric values using... Read More
How do I parcel out work among a bunch of worker threads?
Added on Sun, Jan 10, 2010
Use the Queue module to create a queue containing a list of jobs. The Queue class maintains a list of objects with .put(obj) to add an item to the queue and .get() to return an item. The class will take care of the locking... Read More
How do I create static class data and static class methods?
Added on Sun, Jan 10, 2010
Static data (in the sense of C++ or Java) is easy; static methods (again in the sense of C++ or Java) are not supported directly. For static data, simply define a class attribute. To assign a new value to the attribute, you... Read More
How do I read (or write) binary data?
Added on Sun, Jan 10, 2010
or complex data formats, it's best to use the struct module. It allows you to take a string containing binary data (usually numbers) and convert it to Python objects; and vice versa. For example, the following code... Read More
How do I avoid blocking in the connect() method of a socket?
Added on Sun, Jan 10, 2010
The select module is commonly used to help with asynchronous I/O on sockets. Read More
How can my code discover the name of an object?
Added on Sun, Jan 10, 2010
Generally speaking, it can't, because objects don't really have names. Essentially, assignment always binds a name to a value; The same is true of def and class statements, but in that case the value is a callable.... Read More
How do I make a Python script executable on Unix?
Added on Sun, Jan 10, 2010
You need to do two things: the script file's mode must be executable and the first line must begin with #! followed by the path of the Python interpreter. The first is done by executing chmod +x scriptfile or perhaps... Read More
How can I pass optional or keyword parameters from one function to another?
Added on Sun, Jan 10, 2010
Collect the arguments using the * and ** specifier in the function's parameter list; this gives you the positional arguments as a tuple and the keyword arguments as a dictionary. You can then pass these arguments when calling... Read More
How do I modify a string in place?
Added on Sun, Jan 10, 2010
You can't, because strings are immutable. If you need an object with this ability, try converting the string to a list or use the array module: >>> s = "Hello, world" >>> a = list(s) >>>... Read More
How do you remove duplicates from a list?
Added on Sun, Jan 10, 2010
If you don't mind reordering the list, sort it and then scan from the end of the list, deleting duplicates as you go: if List: List.sort() last = List[-1] for i in range(len(List)-2, -1, -1): if last==List... Read More
Where is the math.py (socket.py, regex.py, etc.) source file?
Added on Sun, Jan 10, 2010
There are (at least) three kinds of modules in Python: 1. modules written in Python (.py); 2. modules written in C and dynamically loaded (.dll, .pyd, .so, .sl, etc); 3. modules written in C and linked with the... Read More
How do I generate random numbers in Python?
Added on Sun, Jan 10, 2010
The standard module random implements a random number generator. Usage is simple: import random random.random() This returns a random floating point number in the range [0, 1). Read More
How do I extract C values from a Python object?
Added on Sun, Jan 10, 2010
That depends on the object's type. If it's a tuple, PyTupleSize(o) returns its length and PyTuple_GetItem(o, i) returns its i'th item. Lists have similar functions, PyListSize(o) and PyList_GetItem(o, i). For... Read More
How can I embed Python into a Windows application?
Added on Sun, Jan 10, 2010
Embedding the Python interpreter in a Windows app can be summarized as follows: 1. Do _not_ build Python into your .exe file directly. On Windows, Python must be a DLL to handle importing modules that are themselves DLL&... Read More
The classical "Hello World" in python CGI fashion:
Added on Sun, Jan 10, 2010
#!/usr/bin/env python print "Content-Type: text/html" print print """ <html> <body> <h2>Hello World! </body> </html> """ To test your setup save it with the .py... Read More
What is Python?
Added on Sun, Jan 10, 2010
Python is an interpreted, interactive, object-oriented programming language. It incorporates modules, exceptions, dynamic typing, very high level dynamic data types, and classes. Python combines remarkable power with very clear... Read More
What are the rules for local and global variables in Python?
Added on Sun, Jan 10, 2010
In Python, variables that are only referenced inside a function are implicitly global. If a variable is assigned a new value anywhere within the function's body, it's assumed to be a local. If a variable is ever assigned... Read More
How do I convert between tuples and lists?
Added on Sun, Jan 10, 2010
The function tuple(seq) converts any sequence (actually, any iterable) into a tuple with the same items in the same order. For example, tuple([1, 2, 3]) yields (1, 2, 3) and tuple('abc') yields ('a', &... Read More
What's a negative index?
Added on Sun, Jan 10, 2010
Python sequences are indexed with positive numbers and negative numbers. For positive numbers 0 is the first index 1 is the second index and so forth. For negative indices -1 is the last index and -2 is the penultimate (next to... Read More
How do I iterate over a sequence in reverse order?
Added on Sun, Jan 10, 2010
If it is a list, the fastest solution is list.reverse() try: for x in list: "do something with x" finally: list.reverse() This has the disadvantage that while you are in the loop, the list is... Read More
How do you make an array in Python?
Added on Sun, Jan 10, 2010
Use a list: ["this", 1, "is", "an", "array"] Lists are equivalent to C or Pascal arrays in their time complexity; the primary difference is that a Python list can contain objects of many different types. The array... Read More
How do I create a multidimensional list?
Added on Sun, Jan 10, 2010
You probably tried to make a multidimensional array like this: A = [[None] * 2] * 3 This looks correct if you print it: >>> A [[None, None], [None, None], [None, None]] But when you assign a... Read More
How do I apply a method to a sequence of objects?
Added on Sun, Jan 10, 2010
Use a list comprehension: result = [obj.method() for obj in List] More generically, you can try the following function: def method_map(objects, method, arguments): """method_map([a,b], "meth", (1,2)) gives ... Read More
How do I call a method defined in a base class from a derived class that overrides it?
Added on Sun, Jan 10, 2010
If you're using new-style classes, use the built-in super() function: class Derived(Base): def meth (self): super(Derived, self).meth() If you're using classic classes: For a class definition such as... Read More
How can I organize my code to make it easier to change the base class?
Added on Sun, Jan 10, 2010
You could define an alias for the base class, assign the real base class to it before your class definition, and use the alias throughout your class. Then all you have to change is the value assigned to the alias. Incidentally,... Read More
How do I test a Python program or component?
Added on Sun, Jan 10, 2010
Python comes with two testing frameworks. The doctest module finds examples in the docstrings for a module and runs them, comparing the output with the expected output given in the docstring. The unittest module is a... Read More
How do I delete a file? (And other file questions...)
Added on Sun, Jan 10, 2010
Use os.remove(filename) or os.unlink(filename); Read More
How do I run a subprocess with pipes connected to both input and output?
Added on Sun, Jan 10, 2010
Use the popen2 module. For example: import popen2 fromchild, tochild = popen2.popen2("command") tochild.write("input ") tochild.flush() output = fromchild.readline() Read More
How do I interface to C++ objects from Python?
Added on Sun, Jan 10, 2010
Depending on your requirements, there are many approaches. To do this manually, begin by reading the "Extending and Embedding" document. Realize that for the Python run-time system, there isn't a whole lot of difference... Read More
How do I run a Python program under Windows?
Added on Sun, Jan 10, 2010
This is not necessarily a straightforward question. If you are already familiar with running programs from the Windows command line then everything will seem obvious; otherwise, you might need a little more guidance. There are... Read More
How do I make python scripts executable?
Added on Sun, Jan 10, 2010
On Windows 2000, the standard Python installer already associates the .py extension with a file type (Python.File) and gives that file type an open command that runs the interpreter (D:Program FilesPythonpython... Read More
How to use Sessions for Web python ?
Added on Sun, Jan 10, 2010
Sessions are the server side version of cookies. While a cookie persists data (or state) at the client, sessions do it at the server. Sessions have the advantage that the data do not travel the network thus making it both safer... Read More
Is there a tool to help find bugs or perform static analysis?
Added on Sun, Jan 10, 2010
Yes. PyChecker is a static analysis tool that finds bugs in Python source code and warns about code complexity and style. Pylint is another tool that checks if a module satisfies a coding standard, and also makes it... Read More
How do you make a higher order function in Python?
Added on Sun, Jan 10, 2010
You have two choices: you can use nested scopes or you can use callable objects. For example, suppose you wanted to define linear(a,b) which returns a function f(x) that computes the value a*x+b. Using nested scopes: def... Read More
How can I find the methods or attributes of an object?
Added on Sun, Jan 10, 2010
For an instance x of a user-defined class, dir(x) returns an alphabetized list of the names containing the instance attributes and methods and attributes defined by its class. Read More
Is there an equivalent of C's "?:" ternary operator?
Added on Sun, Jan 10, 2010
How do I convert a number to a string?
Added on Sun, Jan 10, 2010
To convert, e.g., the number 144 to the string '144', use the built-in function str(). If you want a hexadecimal or octal representation, use the built-in functions hex() or oct(). For fancy formatting, use the %... Read More
How do I use strings to call functions/methods?
Added on Sun, Jan 10, 2010
There are various techniques. * The best is to use a dictionary that maps strings to functions. The primary advantage of this technique is that the strings do not need to match the names of the functions. This is also the... Read More
I want to do a complicated sort: can you do a Schwartzman Transform in Python?
Added on Sun, Jan 10, 2010
Yes, it's quite simple with list comprehensions. The technique, attributed to Randal Schwartz of the Perl community, sorts the elements of a list by a metric which maps each element to its "sort value". To sort a list... Read More
How can I overload constructors (or methods) in Python?
Added on Sun, Jan 10, 2010
This answer actually applies to all methods, but the question usually comes up first in the context of constructors. In C++ you'd write class C { C() { cout << "No arguments... Read More
How do I find the current module name?
Added on Sun, Jan 10, 2010
A module can find out its own module name by looking at the predefined global variable __name__. If this has the value '__main__', the program is running as a script. Many modules that are usually used by importing them... Read More
None of my threads seem to run: why?
Added on Sun, Jan 10, 2010
As soon as the main thread exits, all threads are killed. Your main thread is running too quickly, giving the threads no time to do any work. A simple fix is to add a sleep to the end of the program that's long enough... Read More
How do I copy a file?
Added on Sun, Jan 10, 2010
The shutil module contains a copyfile() function. Read More
How do I send mail from a Python script?
Added on Sun, Jan 10, 2010
Use the standard library module smtplib. Here's a very simple interactive mail sender that uses it. This method will work on any host that supports an SMTP listener. import sys, smtplib fromaddr =... Read More
How do I catch the output from PyErr_Print() (or anything that prints to stdout/stderr)?
Added on Sun, Jan 10, 2010
In Python code, define an object that supports the write() method. Assign this object to sys.stdout and sys.stderr. Call print_error, or just allow the standard traceback mechanism to work. Then, the output will go wherever your... Read More
Is a *.pyd file the same as a DLL?
Added on Sun, Jan 10, 2010
Yes, . Read More
Why can't I use an assignment in an expression?
Added on Sun, Jan 10, 2010
Many people used to C or Perl complain that they want to use this C idiom: while (line = readline(f)) { ...do something with line... } where in Python you're forced to write this: while True: ... Read More
How do you set a global variable in a function?
Added on Sun, Jan 10, 2010
Did you do something like this? x = 1 # make a global def f(): print x # try to print the global ... for j in range(100): if q>3: x=4 Any variable assigned in a function is local to that function.... Read More
How do I share global variables across modules?
Added on Sun, Jan 10, 2010
The canonical way to share information across modules within a single program is to create a special module (often called config or cfg). Just import the config module in all modules of your application; the module then becomes... Read More
How do I copy an object in Python?
Added on Sun, Jan 10, 2010
In general, try copy.copy() or copy.deepcopy() for the general case. Not all objects can be copied, but most can. Some objects can be copied more easily. Dictionaries have a copy() method: newdict = olddict.copy() ... Read More
Is there an equivalent to Perl's chomp() for removing trailing newlines from strings?
Added on Sun, Jan 10, 2010
Starting with Python 2.2, you can use S.rstrip(" ") to remove all occurences of any line terminator from the end of the string S without removing other trailing whitespace. If the string S represents more than one line, with... Read More
When I edit an imported module and reimport it, the changes don't show up. Why does this happen?
Added on Sun, Jan 10, 2010
For reasons of efficiency as well as consistency, Python only reads the module file on the first time a module is imported. If it didn't, in a program consisting of many modules where each one imports the same basic module,... Read More
Why don't my signal handlers work?
Added on Sun, Jan 10, 2010
The most common problem is that the signal handler is declared with the wrong argument list. It is called as handler(signum, frame) so it should be declared with two arguments: def handler(signum, frame): .... Read More
Can I create my own functions in C?
Added on Sun, Jan 10, 2010
Yes, you can create built-in modules containing functions, variables, exceptions and even new types in C. Read More
How can I execute arbitrary Python statements from C?
Added on Sun, Jan 10, 2010
The highest-level function to do this is PyRun_SimpleString() which takes a single string argument to be executed in the context of the module __main__ and returns 0 for success and -1 when an exception occurred (including... Read More
How can I evaluate an arbitrary Python expression from C?
Added on Sun, Jan 10, 2010
Call the function PyRun_String() from the previous question with the start symbol Py_eval_input; it parses an expression, evaluates it and returns its value. Read More
How do I call an object's method from C?
Added on Sun, Jan 10, 2010
The PyObject_CallMethod() function can be used to call an arbitrary method of an object. The parameters are the object, the name of the method to call, a format string like that used with Py_BuildValue(), and the argument values: ... Read More
How do I access a module written in Python from C?
Added on Sun, Jan 10, 2010
You can get a pointer to the module object as follows: module = PyImport_ImportModule("<modulename>"); If the module hasn't been imported yet (i.e. it is not yet present in sys.modules), this initializes... Read More
Where is Freeze for Windows?
Added on Sun, Jan 10, 2010
"Freeze" is a program that allows you to ship a Python program as a single stand-alone executable file. It is not a compiler; your programs don't run any faster, but they are more easily distributable, at least to platforms... Read More
How to Debugging in python?
Added on Sun, Jan 10, 2010
Syntax and header errors are hard to catch unless you have access to the server logs. Syntax error messages can be seen if the script is run in a local shell before uploading to the server. For a nice exceptions report... Read More
How to use Cookies for Web python ?
Added on Sun, Jan 10, 2010
HTTP is said to be a stateless protocol. What this means for web programmers is that every time a user loads a page it is the first time for the server. The server can't say whether this user has ever visited that site, if is... Read More
Are there any interfaces to database packages in Python?
Added on Sun, Jan 10, 2010
Yes. Python 2.3 includes the bsddb package which provides an interface to the BerkeleyDB library. Interfaces to disk-based hashes such as DBM and GDBM are also included with standard Python. Read More
How do I tell "incomplete input" from "invalid input"?
Added on Sun, Jan 10, 2010
Sometimes you want to emulate the Python interactive interpreter's behavior, where it gives you a continuation prompt when the input is incomplete (e.g. you typed the start of an "if" statement or you didn't close your... Read More
How do I debug an extension?
Added on Sun, Jan 10, 2010
When using GDB with dynamically loaded extensions, you can't set a breakpoint in your extension until your extension is loaded. In your .gdbinit file (or interactively), add the command: br... Read More
Can I create my own functions in C++?
Added on Sun, Jan 10, 2010
Yes, using the C compatibility features found in C++. Place extern "C" { ... } around the Python include files and put extern "C" before each function that is going to be called by the Python interpreter. Global or static C++... Read More





   copy right ® all rights reserved by www.fullinterview.com