Programming :: NameError: Global Name 'set' Is Not Defined
Apr 17, 2011
I have a Red Hat 4.9 server running python 2.3.4. However I need some of the new functions so I downloaded and installed Python 2.7.1. I wanted to use the "set" function which was not in the earlier version.
/bin/python is 2.3.4
/usr/local/bin/python is 2.7.1
I have a script running 2.3.4 which calls the 2.7.1 script however it fails because it cannot find the "set" command here is an example
Script1
#!/bin/python
import Mytest
[code]....
The error message is :
NameError: global name 'set' is not defined
View 14 Replies
ADVERTISEMENT
May 27, 2010
When I run from the command line, I get this output:
Traceback (most recent call last):
File "/usr/sbin/system-config-samba", line 45, in <module>
mainWindow.MainWindow(debug_flag)
File "/usr/share/system-config-samba/mainWindow.py", line 82, in __init__
[code]....
I have removed and re-installed and get the same crash.
View 2 Replies
View Related
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
Oct 3, 2010
ERROR "global name 'sqlite' is not defined" when install Apache + Subversion + Trac
Apache+Subversion+Trac
httpd-2.2.16
Python-2.6
swig-1.3.31
sqlite-3.6.13
subversion-1.6.12
mod_python-3.3.1
[Code]....
View 4 Replies
View Related
May 10, 2011
I've had to do some code in java, a language I'm very much unfamiliarly with so please excuse my incorrect use of terms. The basic outline of my problem is I create a class object as a local within a swing button function it works fine. If I create it as a global ( with I think I need to do ) within main, then prototype it with the other swing objects at the bottom of the file when it is called it causes a host of problems. I think the easiest way is to show it.
View 2 Replies
View Related
Sep 13, 2010
i'm practicing in very basic c programs using the gcc compiler.I found that when i create two variables let's say
Code:
int a,b and Code: a=15;
b=3;
a=b;
b--;
then a equals 2.I thought that this isn't normal in C isn't it?I haven't had the time to read the gcc documentation yet...so i think it has something to do with my compiler's default settings.I use the
Code: gcc filename.c -o filename command to compile
Are all variables defined like pointers?
View 5 Replies
View Related
Dec 12, 2009
I converted my programming project over to autotools, which gives me a config.h file with all the cool definitions, like these ones:
Code:
/* Location of data files. */
#define DATADIR "/usr/local/share"
/* Define to the full name of this package. */
#define PACKAGE_NAME "lusus"
And naturally I think this is cool because then I can hardcore these into the binary. To my dismay, however, I discovered that the pre-processor does not do the text-substitution if the macro name is inside another quoted string.
Code:
// Prints out "/usr/local/share/lusus"
std::cout << DATADIR << "/" << PACKAGE_NAME << "
";
[code]....
This seems lame, because then this doesn't work:
Code:
CL_Image leaves_corner_tl(gc, "DATADIR/PACKAGE_NAME/img/leaves_corner_tl.png");
So, am I literally going to have to strcat DATADIR/PACKAGE with the other text every time I want to prefix DATADIR/PACKAGE_NAME onto another string?
View 2 Replies
View Related
Mar 20, 2011
I've been reviewing some source code recently which contains many conditional compilation statements, and I found it hard to understand the code not knowing whether some macro is defined or not. Is there any way to test whether a macro is defined?
View 2 Replies
View Related
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
Feb 8, 2011
I am writing an expect script and I wish to use environment variables that are defined outside of the script.
View 6 Replies
View Related
Jan 24, 2011
I wrote a shell script and was able to compile it using SHC. after that i copied it to the /bin folder and tried running it as a normal user, but i keep getting the error " operation not permitted killed "
I tried changing the permissions. but it doesn't work. it only works with sudo. there must be another way. otherwise it won't be linux right?
View 11 Replies
View Related
Feb 19, 2010
I have created a file with a pre-defined size as follows:
Code:
#define FILEPATH "testfile"
#define FILESIZE 16
[code]...
View 5 Replies
View Related
Jun 27, 2010
I have two modules A and B in the kernel which i am trying to hack by introducing a variable in A which is of type 'extern' (and using EXPORT_SYMBOL) and then calling it in B. Now the problem is how to introduce that variable in module A. Currently i have made a global variable and it works fine but global variable in kernel is a bad bad thing.
I tried having an 'extern' function in A which have that variable and calling that function in module B, but then again how would module A use my variable unless the variable is available outside the scope of that function and that again means a global variable.
View 3 Replies
View Related
Oct 12, 2010
The first line of this struct:
Code:
struct custom_int {
typedef int big_int;
[code]...
View 4 Replies
View Related
Apr 29, 2011
i got a sample.c which generate a linked list for sorting according to the number generated. then i want to split the sorting function into a header file. and it looks like the sort function in the header file could not access the linked list in the main. the error is dereferencing pointer to incomplete type
sample.c
Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
[code]...
View 2 Replies
View Related
May 20, 2011
I have a general question regarding php. Suppose that I want to have an array that stores connection-specific data, that can be anything IP address or something similar. However, whenever I use global or server variables (i.e. GLOBALS or _SERVER) the array created in this way is kind of connection-oriented, so that for each connection there is a separate instance of this array. Maybe it has something to do with the MPM of Apache, but I am not sure. Is it possible to implement an array that stores information about all connections that are at a system? In this way, each connection can chip in and upload it with data? Also, I would rather not use cookie's.
View 3 Replies
View Related
Jun 27, 2009
I am dealing with some Linux kernel code, which define most its functions with Macros.The trouble I am having is to use those code in user space in Windows.
For example, I have a function defined like this:
#define list_for_each_entry_safe(pos, n, head, member)
for (pos = list_entry((head)->next, typeid(*pos), member),
n = list_entry(pos->member.next, typeid(*pos), member);
&pos->member != (head);
pos = n, n = list_entry(n->member.next, typeid(*n), member))
And in user space code, I call it in this way:
list_for_each_entry_safe( pcre_item, tmp,
&(((pcre_list_head_t *)(hr.value))->head), list)
{
// My code to handle each element in the list
}
This is working like a charm in Linux, but I got errors in Windows:
It reminds me missing ';' after 'list_for_each_entry_safe( pcre_item, tmp,
&(((pcre_list_head_t *)(hr.value))->head), list)'.
Does this kind of linux code not working in Windows at all? (Linux is in GCC C stand and VC is ANSI C) I prefer not to convert them to normal functions but keep it the way if it could be working under windows by some tricks.
View 5 Replies
View Related
May 26, 2010
Is it possible to create a global struct variable with predefined member values?Only one instance of that struct is ever needed.
View 1 Replies
View Related
Sep 13, 2010
I wonder if there is anyway to make a user-defined bash shell function global, meaning the function can be use in any bash shell scripts, interactively or not. This is what I attempted:
Code:
$ tail -n 3 /etc/bashrc
echotm () {
echo "[`date`] $@"
}
[code]....
View 11 Replies
View Related
Jul 7, 2010
Here is the block of code : (The red part is the code that doesn't work) The file is not created and see the output after the code. # i loop create environment structure and k loop create std procedure sub structure.
for i in TRAX2 TRAX BENCH PROD
do
eval mkdir $"acsayul02501_${i}"
eval chmod 2770 $"acsayul02501_${i}"
[code]....
View 3 Replies
View Related
Jul 4, 2011
I have a perl script which was written for me by a professional (I have some basic knowledge), is working fine at the moment but on moving it to a different server as I'm changing a server (new server is shared and supports perl modules), I get the following message"Global symbol "$psid" requires explicit package name at admin.pl line 16". I get this for every single one for my values for the whole script which is about 2000 lines. Same error messages for main and admin.I haven't changed anything on moving it to the new server apart from the first line which is the location of the perl.I thought it would be too much to post the whole script here but anyone has any idea why is doing it taking into account that it works on a different server?
View 1 Replies
View Related
Feb 19, 2010
I have two major issues, and one minor one, after I started using Ubuntu, I tried searching the forum for them, but couldn't find anything relevant to my problems.First issue: Screenshots and the cursor.This is probably a very easily fixed issue, but none-the-less, I can not figure it out.How do I NOT include the cursor in my screenshots on Ubuntu 9.10?What I do is, I press the Prt Scrn button, and my cursor is always there in the image, and I don't want that.Second is pidgin.I love it, but every time I boot it up, my friendly name is reverted back to firefoxfag.I think it has something to do with me using gmail for msn, but I'm not sure...Also, as a last very small issue, the global hotkeys on audacious don't respond unless i open preferences, open settings for global hotkeys, then close down the settings..
View 4 Replies
View Related
Dec 29, 2010
i have Ubuntu10.10 (kernel-2.6.35-22-generic) installed. struct stat StatBuff;
[Code]...
I have mounted a windows share folder on /mnt. When i gave any directory within /mnt/ to stat function it fails with errorno 75. perror shows "Value too large for defined data type". Example 1 is fail but Example 2 works fine.
View 7 Replies
View Related
May 28, 2010
I would like to have a global equalizer in KDE. I have done a bit of searching and didn't find anything that looked promising. It looks easy with ubuntu since it uses Pulse audio. I actually installed pulse audio and it seems to have somewhat integrated lol but I can't find an equalizer to see if it works.
View 5 Replies
View Related
Oct 15, 2009
Upon a fresh install of Fedora 11 (and as a Fedora n00b), I noticed there are several aliases defined for me.
Code:
$ alias
alias l.='ls -d .* --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
[code]...
files had these aliases. So where are they?
View 14 Replies
View Related
Aug 1, 2010
My OS Ubuntu 9.04
I installed java via
Code:
Code:
Code:
Now logged out and logged in again in my system checked
Code:
and
Code:
After which I type on command prompt
Code: ant and get the following error
Code:
Error: JAVA_HOME is not defined correctly. We cannot execute /usr/lib/jvm/java-6-sun/bin/bin/java
both the file ant.sh and jdk.sh are executable.
View 1 Replies
View Related
May 30, 2011
How do I install global-menu-bar in Fedora15? It is innevitable for me since it saves a lot of screen space.
View 4 Replies
View Related
Jul 23, 2011
Using KDE 4.6+, I'd like to have a predefined set of hotkeys for all users of the computer. E.g. the "XF86Calculator"-key starting "kcalc" as a default for all users without everyone being forced to deal with the absolutely messy and un-intuitive KDE hotkey configuration. Is there a way to do that? Preferably something like an "*.desktop"-file in /usr/local in order to be consistent with the rest of the system.
View 9 Replies
View Related
Jan 29, 2010
Been looking online and have only been able to find PPA lines. I tried adding them to software sources with no joy. I keep getting an error message. Are there any .deb packages for global menu? If not can anyone give me straight forward steps on how to install it? I am running Jaunty.
View 1 Replies
View Related
Mar 29, 2010
I installed the Gnome global menu bar URL... for my Ubuntu 9.10 laptop. All that was there was the files that I had to make and make install. But this happens when I type make or make installNo targets specified and no makefile found. Stop.Is there a prebuild version of the gnome global menu bar on the Ubuntu Software Center, or can someone provide the link?
View 3 Replies
View Related