Programming :: Can't Get The Syntax Right In This Pyqt3 Command?
Mar 14, 2010Code:
x = self.spinbox37.value() * 40
y = self.spinbox38.value() * 40
[code]...
Code:
x = self.spinbox37.value() * 40
y = self.spinbox38.value() * 40
[code]...
want to get a text file and use sed commands on it to make it more manageable.(because I don't know how in python) Then take each line based on what it starts with and send it to the proper lcdnumber.display. I need an adjustable "pause" to allowing slowing down of the entire process equally but I think the way I'm using the time.sleep is messing things up as only 1 in 10 value sets make it to the lcd and sometimes some of the segments don't get drawn. Also the x digit and the y digit are now being sent to one lcd how can I grab just the first half of the double value xy up to the space as x and then grab the remainder as y so all three xyz values go to three separate lcd displays? I attached 2 files one before and one after the formating.
Code:
def Timer(self):
import time
[code]....
I'm trying to compose a line of numbers each single digit taken from a variable eg: 1010001 each variable digit is either a 0 or 1 made from variable layer1 through 7. I need to add each layer variable to the last to compose the number with no commas or spaces and add it directly after the -p option in the show_command line. I used array and list and the commas mess up the command and inserting "pens" in the show command interpertes it literally instead of the list or array value? The insert should look something like 1000110
Code:
I want to read values from a text file about 2 times a second and update a textLabel with those values but it only inputs the values with the last value from the text file? I tried the same thing with an LCDNumber but it only updated every 10 value changes? After each change do I need to clear the textLabel or refresh the window? For testing the print z and print x in the code prints the values correctly.Heres my code:
Code:
def Timer(self):
import time
[code]...
I am trying to find out can I use the ls command to list my wav files in such a way that it follows this format: <OPTION value="/home/filepath.wav">My first file </OPTION> I would like to know if there is a way I could simplify this because I have about 100 wav files. They all have names and if I could get them listed then a space then the name again with something behind it I could use the find replace feature to generate a bunch of links . If not is there a script out there that could use this format to generate links under this format? BTW this is for a pull down menu that would control windows media player
View 8 Replies View RelatedI am just starting to learn to script and I need to know what this doesn't work, here's the error I get:
"chmod: command not found"
The error goes away when I delete the line with "dirname $NAME" in it.
#!/bin/sh
echo "enter file name with extension and path"
read NAME
FULLPATH=`dirname $NAME`
OPENFILE="open "$NAME
OPENPATH="open "$FULLPATH
echo $OPENFILE > /Users/admin/Desktop/tmpLink
echo $OPENPATH >> /Users/admin/Desktop/tmpLink
chmond +x /Users/admin/Desktop/tmpLink
I have a program I use, rrdtool. I need to modify a ds value on every file at the same time. However, using a wildcard (*) to try this operation of all files does not work and instead only updates one file.
Here is the command syntax:
rrdtool tune <file> --maximum traffic_in:100000000000 && rrdtool tune <file> --maximum traffic_out:100000000000
So, how can I do this on every file in the directory?
There is a syntactical feature I would like to see in Vim, and so I thought to write myself a syntax file for my needs, but I am having trouble finding the exact type of syntax highlighting I want to incorporate'emulate. Currently in Vim, from the terminal instead of say gvim, when I place my cursor over a parenthesis or brace, the corresponding brace or parenthesis will highlight, or block its character. In my case, instead of a single character they will be full words specified within the syntax file.
I want to do something similar. For example if my document has three words:
Group
Element1
Element2
I want the syntax file to tell Vim that when I have my cursor over the word Element1 or Element2 that Group will become highlighted. In the same, to have the cursor over Group will cause both Element1 and Element2 to highlight. I have looked here but understanding still eludes me: [URL]. I would also be happy with creating some sort of command input, where I type in the group name and the elements highlight. Like a very specific search function that searches for only and all instances that are contained within the group named.
How to print a sequence of line say line number 10 to 20 of a 50 line file ?
View 6 Replies View RelatedI'm currently studying for my Linux+ test and I'm getting conflicting information regarding the rm -rf command. Yes, I know this a dangerous command, but my question is in regard to how the command functions. In one book I'm studying it says that rm -rf / home/myfolder (there's a space in there) will delete the entire root directory because there is a space between the root and home directory. It says that if there is a spacing such as this, it will ignore anything after the space, so in this case, it would delete the root directory and stop, not that there would be anything left anyway. Then in another book I have, it says that if you did a rm -rf folderName / (with the intention of adding the trailing slash to indicate it is a directory and not a folder) it will delete everything in folderName (assuming it's a child directory of your pwd) and then CONTINUE on and delete the root directory. Now, those two statements contradict each other. When you remove a directory, does the command line ignore anything after a space or not?
View 1 Replies View RelatedI have an error, which I have no idea why appears. All brackets seems ok.
error:
Code:
Code:
I am having an XML file,i want to verify the file for its syntax,
View 14 Replies View RelatedWhen ever i open vim, i get the error that the following error: E484: Can't open file/abcd/configFiles/vim/syntax/syntax.vim There was a .vimrc file in my home folder that i have removed.
Still i keep getting the same error. Presently in my home folder there is no .gvimrc or .vimrc file.
But still i keep getting the same error. I am not too sure where this file is mentioned.
Background info: The SHELL has been changed from tcsh to bash Earlier i had created a .vimrc file in tcsh, i have removed the .vimrc in bash SHELL.
I'm trying to backup a whole startup disk to another with GRSYNC but I don't need some files or directories. For example, I don't want to backup my 'swapfile1' (I do not have a dedicated swap partition) or the 'media' directory' in order to no enter a looping sync.I've searched the web for the correct syntax of the --exclude command but none have worked if applied in the advanced option "before" rsync starts. These a sample of NOT workin syntaxes:
exclude /media or -- exclude 'media' or -- exclude "media"
same for swapfile1:
exclude swapfile1 or -- exclude 'swapfile1' or -- exclude "swapfile1"
I am repeatedly getting error:
I need to pass the value of:
I am using #!/bin/bash
This command works on shell without any issue.
I am setting some environmental variable in my .bashrc , the sample code I was provided with is for CSH but I am using bash, and there are some syntax differences between them ... I got most of the script to work, but I am getting an error at this part :
Code: if ($RMSTREE == $RMANTREE) then
set path=($path $RMANTREE/bin)
else
[code]...
#by executing bash file
#!/bin/sh
sed -i 's/if (IEexec || domExec) document.write('<iframe id="IdMyIframe" '+IframePropriedades+'></iframe>');//g' *.php
Output is:
line 4: syntax error near unexpected token `<'
line 4: 'sed -i 's/if (IEexec || domExec) document.write('<iframe id="IdMyIframe" '+IframePropriedades+'></iframe>');//g' *.php'
I am reading Sams Teach Yourself SQL in one hour a day. In this book they work with both Oracle and MySQL to teach you SQL. So I installed mysql on my box and I am creating the empty database they use in this book so I can follow along as I read. I have noticed a few typos in the book and now I have noticed some code errors too. I just don't know enough to fix em. I am working on creating the empty database and I am getting syntax errors when I create certain tables. I have checked both the printed version of the book and the electronic version (which differ slightly) and both give me the same synatax errors. First is Creating the first table of the database. Here is the code given to me to enter. The Electronic version
[code]...
how I can correct this error and create these tables?
I'm fairly new to shell scripting and am having the hardest time figuring out why this simple script is giving me an error
The error is "syntax error near unexpected token `else'
I'm using TextEdit on OSX (sorry I'm limited to this). The only thing I can think of is that it's reading some return character and getting thrown off. I've tried saving the script using different encoding types but the same error pops up.
I also get an error at line 2 because it does not regonize as a command
I was going through init/calibrate.c.url
I am not clear with use of + sign before function names. If any one here is aware of this syntax let me know.
They have used + and - signs before some lines I am not sure of what they are?
I want to write a little time-saving alias for my .cshrc file that will move files and then cd to the directory I've moved them to. What I can't quite figure out is the syntax to say 'move all the arguments except the last one.' Here is what I have:
alias follow 'mv !:1-$-1 !:$; cd !:$'
This actually seems to work, but it also gives me an irritating error:
mv: cannot stat `destinationdirectory/-1': No such file or directory
Similarly, I tried:
alias follow 'mv !:*$#argv-1 !:$; cd !:$'
Again the move and cd are successful, but again there is an error:
mv: cannot stat `destinationdirectory/0-1': No such file or directory
I am writing a code in bash script, in my ubuntu command terminal. The program should send the message, "Hello John!!" 5 times to john's terminal (assuming he is logged on to the server). But I keep getting this error: Syntax error: end of file unexpected (expecting "done").
#!/usr/bin/sh
clear
x=1 # this sets up the flag so we can have it send a limited amount
while [ $x -le 5 ]
do
write jdouglas << EFO
>Hello John!!
>EFO
x=$(( $x + 1 ))
done
I'm reading "Understanding the Linux Kernel" and came upon this assembly instruction:
movl $(__KERNEL_CS << 16), %eax
I am curious as to what "<<" means/does. I tried to gooogle, but google doesn't search for "<<".
I'm trying to find all the files in a specified directory that do NOT end in .archived or .error and are older than 30 mins. Currently I have: Code: find /opt/edi/incoming -type f ! ( -name "*.archived" -name "*.error" ) -cmin 30 But I keep returning files that end in those extensions and I'm not sure if I'm using -cmin correcty? If there is a better way to do this (perl, etc) I'm open to options, this is for a nagios check.
View 2 Replies View RelatedI'm new to scripting and I have a trouble with if statement syntax. The code is: Code: #there is a diff command here, and it does what i want but#i wanna see 1 if the exit value of diff is 0, and otherwise i wanna see 0.#the problem is here: (syntax error near unexpected token "then")
if["$?"==0];
then
echo 1
[code].....
I have this project which I've been working on essentially nonstop for the past three days and due to work I am running low on time. I'm new to Linux/Unix and my Teacher has assigned us a scripting project, due for Monday. I have All the functions for the project in a separate file which run as a daemon process when I log in. It has no syntax errors but my Script can not run the functions (I'm not sure where they go before or after the body) and I have one function I'd like you guys to take a look at. It has a Second menu leading to a case statement but it does not run after the Search. I'm Kinda tired of looking at the CLI but I have to finish this.
phoneEdi() {
directory=~/phonepro/directory
loop="y"
clear
tput cup 4 4; echo "Record Editor" .....
I have a data in a column.
Code:
I want to calculate average and standard deviation. As first step I want to calculate average for the data than calculate (del=data - avg) for all the data.
I suppose get
Code:
For this I use AWK and the code goes like this
Code:
But I get different answers.
Code:
Why the answers are so different? since this is wrong I can not continue calculating the standard deviation.
I do not understand bash' syntax regarding the use of ((<arithmetic expression>)). $((<arithmetic expression>)) is tokenised to a single word. OK.
Code:
In isolation
Code:
It may not be used where a word is expected. This generates a syntax error. Why?
Code:
I am unable to understand the highlighted code/syntax here and what do variable names starting with an underscore represent?
Code:
#include <iostream>
template <class Class, typename ReturnType, typename Parameter>
[code]....
I need to write a wrapper function around the mvprintw function, like so:
int smvprintw( ? )
{
// Do various checks/modifications on the first two arguments (int y,
int x) first,
// and then
return mvprintw ( ? );
}
How should I write the args for smvprintw so that I can pass all the data correctly to mvprintw, and also do my checks on the first two args (for example, to modify them)? I'm confused by the prototype of mvprintw: This is mvprintw as listed in the man pages:
int mvprintw(int y, int x, const char *fmt, ...);
And this is how I saw it in ncurses.h:
extern NCURSES_EXPORT(int) mvprintw (int,int, const char *,...)
I believe the "..." refers to the unknown number of items after const char * fmt. Will it suffice to do something like "int smvprintw(int y, int x, const char * fmt, void * etc)" and then "mvprintw(y, x, fmt, etc)" inside the function?