Programming :: Accessing Python Scripts Using Web?

Mar 17, 2011

I am using Centos. I have written some scipts in python that access my routers and fetch the configuration, etc. Now i was thinking of creating a web interface which i can access from my windows XP. I want it to have good look n feel :-),

View 7 Replies


ADVERTISEMENT

Programming :: Make Python Programs Run Without Entering The Command Python?

Mar 22, 2009

I want to be able to do

sudo ./program.py

instead of always having to do

sudo python program.py

What do I need to change?

View 5 Replies View Related

Programming :: Python - Get Text File Data Into An Array On Python?

Nov 30, 2009

I've already used line split stuff to transform my data into something like this in a text file:

Code:

['1', '1', '3', '20.7505207']
['2', '1', '3', '23.0488319']
['3', '1', '3', '-1.5768747']
['4', '1', '3', '-26.4772491']

[code]....

How can I get this on a python program so I can manipulate it as an array?

View 3 Replies View Related

Programming :: Python 2.x - Represent The Same In Python 3.x

Mar 4, 2010

I have a function definition in a Python 2.x script which take a tuple as one of its arguments, but 2to3 has no answers nor any of my searching on how to represent the same in Python 3.x

Code:

def blah(self, (string1, string2))

View 4 Replies View Related

Programming :: Totem Python Plugin Programming: Any Signal For Video Mouse Click?

Feb 9, 2011

I want that I click with the mouse on the video, it paused.I notice that there is "BaconVideoWidget" which I guess is the video rendering widget but it don't have signal named "clicked":

Code:
vd = totem_object.get_video_widget()
vd.connect("clicked", vd.hide)

[code]....

View 3 Replies View Related

Programming :: Accessing C Function From C++

Jul 5, 2010

i have an open source application that was developed in C++ (it uses objects and namespaces all over the place). I also have another application that was developed in C. Now i am trying to insert the code made in C into C++ application, but when i do that , i get this error on compilation of the source code:

Code:
error: 'mpi_init_vars' was not declared in this scope the function mpi_init_vars() is not part of object oriented programming and it doesn't belong to any scope, it was compiled into an object file and i am linking it with all objects of C++ application.

How can invoke the C function from C++ object oriented code?

View 2 Replies View Related

Programming :: Python 2.x Vs 3.x

Apr 21, 2010

I'm starting to learn python and I am wondering whether I should start with python 2.x or should I just start learning python 3.x?

View 2 Replies View Related

Programming :: PHP Accessing Variables Within Array

Mar 30, 2011

I am pretty new to PHP so excuse my dumbness. I've searched this up in quite a few places and cant find anything : Basically, I've made an array, within it are 3 more arrays. Their are two values in each array, 'Name' and 'Age'. Basically I am using a While statement to try and cycle through the 'age' value of my array and state whether or not the person is eligible. (I am actually just learning so I'm doing this to just test myself).

Here is my code
Code:
<?php
$people =array(
array('name' => 'Bob', 'age' => 15 ),
array('name' => 'Jhon' , 'age' => 10),
array('name' => 'Sue' , 'age' => 7));
//($value =& $people[0,1,2][age] );

Here was an attempt to try and create a reference to age, I tried it many different ways
while($age < 10) {
echo ('$name, is eligible') ; } ?>

Okay, so I tried to do this through two ways, one way I tried to create a reference to age, then evaluate it, without that line of code their would be no reference, which way is correct, why wont it work? I am using Xammp, so when I launch local host I get an undefined variable error. What To Do?

View 3 Replies View Related

Programming :: Convert Map From Python 2.x To 3.x

Apr 6, 2010

I have an existing line of code from a P2 script that I cannot find a solution to converting to P3:

Code:
for i, x in map(None, list1, list2):
I have found the information about converting the simple case:
map(None,x) becomes list(x)

But my googling was unable to find a solution when more than one iterable exists.

View 2 Replies View Related

Programming :: How To Run Python Script From C

Jan 31, 2010

I have a python script I wrote a while ago and now I would like to call that script from inside C. I know how to do one command from C, but how would you execute an entire script from C, and passing arguments? Like:

Code:

int main(void)
{
python( myprogram(1 2 3) );
}

So I can pass arguments to my script.

View 3 Replies View Related

Programming :: Py_FindMethod In Python 3.1.1

Jan 19, 2010

what the equivalent function in Python 3.1.1 is for Python 2.6.4s:

Py_FindMethod

Be buggered if I can find anything in the doco to say what replaced it or what alternative code may need to be entered to replace it

View 1 Replies View Related

Programming :: Python With Web Development ?

Dec 17, 2010

I have decided to learn python as it seems to be powerful not just for web development (like php) but also a clean powerful language for other puposes.

Q: Can someone suggest a tutorial or book, on learning python (beginner to intermediate) which has as its focus for learning, web development?

In order of preference: 1. Comprehensive, 2. Online, 3. Free

View 2 Replies View Related

Programming :: Accessing A Sybase Database From PHP Running?

May 12, 2011

i get some trouble setting up good environment in linux.i have problem regarding connecting php(under linux) to a sybase server(under windows)is there anyway connecting this two technologies?.

View 1 Replies View Related

Programming :: Accessing File And Manipulating With With Folders?

Mar 12, 2010

I have a .csv file with a list of Drugs Name that i need to remove from the folder. The folder consist of files that stored as drugname.mol format.

What i need to do is to sieve out those mol files from the folder?

How do i

(1) access the drugs names from the .csv file line by line (variable x)

(2) how do i access the files in the folder one by one (variable y)

(3) how can i do a comparison whether $x.mol == $y

(4) and shift them to another folder if $x.mol == $y

View 11 Replies View Related

Programming :: Accessing Server From Remote Host?

Mar 2, 2011

i have made a java web server which works on localhost.but now i want to capable it handling many clients at a time.so clients running on different computer need machine name or IP address of server computer.How can i do this in java?

View 1 Replies View Related

Programming :: Accessing Global Variables In Script?

Apr 10, 2011

I have a script that goes like this

step 1 - install sdk

step 2 - update ~/.bashrc export some new variables

step 3 - check said variables, if they return a value then we know a reboot has taken place and we can continue to step 4. otherwise halt and isssue a warning that a reboot is needed.

Ok, so this works if I just execute the script when I am logged on as root, and after a reboot & rerun of the script I can check the variables exist and the program will continue as expected. only when I am logged on as root will the variables I exported in bashrc return a value. If I run the script as sudo root the values are blank.

View 2 Replies View Related

Programming :: Piping In Bash Using Python?

Dec 16, 2010

I have a bash script that I want to import in to Python, mainly just to see if I can or not. However in the script I do use some piping of commands into sed to trim it down to what I need. When I tried doing it with the os.system() call, it didn't work. The exact error is

sed: -e expression #1, char 16: unterminated `s' command

However the command that was run can be run in bash without an error. Is there a better/another way to do this? For reference the command is:

Code:

locate -n 1 wp-config.php | sed 's/wp-config.php/
/g' | sed '/wp-config.php/ d' | sed '/^$/ d'

View 3 Replies View Related

Programming :: C++ Or Python - Create 3D Animation ?

Jan 25, 2009

I want to create 3D animation and also make some big programs. Is python capable of that? or should I stick to C++?

View 3 Replies View Related

Programming :: Linking Options For Python?

Dec 11, 2010

I am trying to build an application that must link with python so as to load a python module during runtime.I have this makefile :

Code:
[alex@iskandhar src]$ cat Makefile
CFLAGS = -Wall -O3 -I ../../../SPOOLES.2.2 -DARCH="Linux" -DSPOOLES -DARPACK

[code]....

View 4 Replies View Related

Programming :: List Sorting In Python?

May 10, 2011

I have a list of list and I'd like to sort the list according to the last value of each row.

Let's say we have the list

L1 = [ [1,2] , [4,6] , [78,-3] ]

I wish to get

L2 = [ [78,-3] , [1,2] , [4,6] ]

Is there a simple way to do that in python?

View 4 Replies View Related

Programming :: Parsing S-Expressions In Python?

Feb 1, 2011

I've been loosely following this:http://norvig.com/lispy.htmlAnd I have a problem: the parsing function throws an array out of bounds exception. I thought that maybe I'm doing it wrong, so I copy and pasted the code from the page, and still the same error

View 2 Replies View Related

Programming :: Initializing Pmw Megawidgets For Python 2.6

Oct 12, 2010

I am having a problem initializing the Pmw megawidgets for Python 2.6.I have Pmw_1_3 loaded in the site-packages directory.

View 1 Replies View Related

Programming :: Python - Global Name Not Defined

Jun 17, 2011

I found an interesting screencast online about how to make gtk Pyton apps. The thing is, though, the guy was using the interactive shell. I've been trying to get his code into a script, and have been having troubles.

Here's what I got:

Code:

It spits out the error "NameError: global name 'browser' is not defined"

I know I'm doing something wrong with how I'm telling it where to find "browser" and "text", but I can't figure out how to point it to the right place.

View 5 Replies View Related

Programming :: Python - How To Avoid Spaces

Oct 1, 2010

In the code below:

Code:

The output is:

Code:

Looks like the "," operator in the print inside the loop is adding a space for its own.

I want to print the sequence WITHOUT spaces. Something like this:

Code:

But I couldn't figure out how to do this.....

How to print a sequence, inside a loop, without that space ?

View 14 Replies View Related

Programming :: Python: Get The Return Value Of The Last Function?

Jun 13, 2010

But it's been hell finding an answer, or I just don't know what to look for..I have a prompt that asks for a float, and if the user doesn't put in a valid number, then it should die with an error message.

Code:
def die_with_error():
print 'ERROR: You didn't specify a valid number!'

[code]....

View 2 Replies View Related

Programming :: Python Program For Time ?

Jun 24, 2011

I need to write a program for time. like i have 2 tasks both minutes and hours.

like this
1st task=5 hours and 30 minutes
2nd task=2hours and 45 minutes

Together they will take 8 hours and 15 minutes.

I need to write a program thats called ADDTIMES to do something like this.

This is what i have so far.

H1=int(input("enter the number of hours:")) etc..

View 6 Replies View Related

Programming :: Python Serial And Struct On 64 Bit?

May 14, 2010

For a work project, I've got a bunch of python code from about a year ago that controls the movement of our EVI-D30 camera over a ttyUSB connection. It used to work fine on a 32-bit Fedora box, but recently we moved our whole project over to a 64-bit Gentoo server, and the same code seems to be worthless on the new platform. I didn't write the code, so I'm have trouble figuring out how to fix it. Error messages usually look like this:

Code:

File "./CameraController.py", line 172, in pan
turn_callback(cmdStruct[0], cmdStruct[1])
File "./CameraController.py", line 147, in turn_callback
cameras[camera].TiltUp()

[code]....

View 13 Replies View Related

Programming :: Python: Storing A Matrix For Later Use?

Apr 30, 2010

I'm writing a command-line flash card program in Python. I've tried many existing applications, but none fit my specialized needs.

All of the words I'd like to study are manually added to a text file (study.txt). Each time the software is loaded, it checks for new words in that file and also compares them to a dictionary (a tab-separated file, dictionary.txt), and adds that to a matrix. The flash cards are thus automatically generated from study.txt and dictionary.txt.

Now, the software must manage lots of information about each word I'd like to study and add new information made while interacting with the program (such as when that word should be studied next).

That seems easy to put into a matrix. But what is the best way to put that information in a place where I can pull it back when I run the software tomorrow? Do I need to save the matrix to a CSV file, then convert the CSV file back to a matrix the next time the application is run?

View 1 Replies View Related

Programming :: Python To Bash Translation?

Oct 17, 2010

Ive been learning bash over the past 6 months or so and have written a few scripts etc and i have just downloaded julius to execute my scripts and a few commands with speech recognition, the example script that comes with julius to execute commands is written in python and the example works fine when executed but i would like to further extend and customize it but i dont know anything about python, so ideally i would like to translate it to bash as that is what i am learning/using at the minute and would like to learn/use one language at a time, translating it as i think im a little out of my league, i look at the script and sort of understand how it works but i dont know anything about python and my knowledge of bash is limited for use of translating languages.

the python script is:

Code:
#! /usr/bin/python -u
# How to use it:
# julius -quiet -input mic -C julian.jconf 2>/dev/null | ./command.py
import sys

[Code].....

View 1 Replies View Related

Programming :: Python: Won't Copy To The Clipboard?

Aug 28, 2010

I having a hard time figuring out why this code works in an interactive ipython shell, but it gives a blank clipboard when run in a bash terminal.

Code:
#! /usr/bin/python2.6
#

[code]...

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved