Programming :: Python "QFileDialog" Code Not Working?

Feb 3, 2010

I have this one last task for this app I've been working on (should have picked something easier for my first project)

It has working "def sav_scr_vars" and "def AddEntry" but these save to a fixed filename when save as defults or ok button is clicked. This is fine but I want to be able to save via the same proccess to a named ~/bin/settings/xxx.set file what I did is clone the to above def's and try to edit them I got the "read file" to work fine from a saved file in this manner. but I can't seem to get the save to filename to work without errors. The cloned def's are "save_as" and inmain.py "write_config2"

the camm2.defaults file goes in ~/.hpgl

copy and paste this to ~/.hpgl/camm2.conf
~/.hpgl/camm2.defaults

The file is always to have a .set extension and only read and write to ~/bin/settings

View 1 Replies


ADVERTISEMENT

Programming :: Black Jack Code In Python?

Dec 16, 2008

i have attached a word doucment with black jack code, i want to know what things are wrong with it, and why it does not run, in python, as it keeps displying error messages such as "invalid syntax"

View 14 Replies View Related

Programming :: Stop Reading Process Without Be Hanged At The Code In Python?

Dec 11, 2010

I have a Python program looks like this one :

Code: import os
import time
process = os.popen("top").readlines()

[code]...

View 2 Replies View Related

Programming :: Python Gconf Not Working When Ran As Root?

Jan 23, 2010

This is the case. I run openSUSE 11.2 with GNOME. I want my desktop wallpaper to automatically cycle on a fixed interval. So I found this script (change-background.py), edited it to match my needs, and put it in my home bin directory. The script runs fine.

change-background.py

Code:
#!/usr/bin/env python
#
# change-background.py
#
#

[Code]....

View 6 Replies View Related

Programming :: Regular Expression Working Fine In JavaScript But Not In Python?

Jun 22, 2010

I have this regular expression

Code:

(@description ").*(";)

I want to match anything in between the quotes its working fine in JavaScript but its not working in my python program:

Code:

#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
import re

[code]....

View 3 Replies View Related

Programming :: Simple Perl Log Code Not Working?

May 25, 2010

I just upgraded servers, and I'm now on 'perl v5.8.8 built for i386-linux-thread-multi' and a simple log script doesn't work. I got it changed to

Code:
#!/usr/bin/perl
use strict;

[code]....

View 4 Replies View Related

Programming :: FORTRAN77 Code Not Working - Showing No Error

May 17, 2010

I have written FORTRAN77 code,also a makefile. But is not working at all. how to start looking for errors?

View 9 Replies View Related

Programming :: Code That Doesn't Seem To Be Working Right With Gcc Compilers, But They Do Compile?

Dec 11, 2010

I actually thought there was something wrong with my programming skills.ut after I compiled the same code using Visual Studio, it worked. So here's the code that doesn't seem to be working right with gcc compilers, but they do compile. Note I'm using the Cygwin 3.4.4 version of gcc and 4.5.1 version of gcc from MinGW.

Code: #include <stdio.h>
#include <math.h>
int main()

[code]...

View 5 Replies View Related

Programming :: Array In Shell Script - Code Not Working

Oct 16, 2010

I am passing an array in function. I want to read the first content again and again until it is empty so

function calltoarray
{
read $1[0]
while [ ! -n "$1[0]" ]
do
echo empty
read $1[0]
done
}

But the code is not working. If we just press enter without value at read $1[0]. It do not get into while loop.

View 2 Replies View Related

Programming :: Calculations - High Resolution Mandelbrot - Working Code

Feb 25, 2010

I am piecing a Mandelbrot generator up, I have one working to produce a 1,500 x 1,500 picture (which is fairly accurate).

I would like to increase the resolution over 100,000 x 100,000 + (into the millions x millions).

How I can achieve this? What kind of buffer sizes do I need?

(note this code doesnt have any memory allocations yet)

Here is my code so far:

The program outputs the Mandelbrot as a .tga file. I calculated the image on fixed axis of -2 to 2 (on the x and y axis). Image produced: [url]

View 12 Replies View Related

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

Ubuntu :: Execute Python Code Before Shutdown

Dec 2, 2010

I have written a backup script backing up the data I have worked during the day with rsync and sends me a log in my email. now it works perfect but i want to execute it each time i shutdown my computer in the evening not during reboot or logout.It seems that i can not run it by putting it in init.d and softlinking in rc0.d as K00backup. I think it is because script uses many services like python or smtplib, gnome-keyrings that in that time might have been already shutdown.

View 2 Replies View Related

Ubuntu :: Changing Fortran Code To Python?

Aug 19, 2011

I have a big fortran code for FE analysis. I want to change the code to python. I am curious to know, whether I will get any advantage over speed, If not at least the speed should not be less than what fortran gives. Should I go for it.

View 2 Replies View Related

Software :: Compile Python Source Code With 64 Bit?

Jun 28, 2010

I've taken the source code for Zlib1.2.3, built and installed in a 64 Bit linux machine. Then when i downloaded Python 2.5.4 source and tried to build(make), i got the following error

gcc -pthread -shared build/temp.linux-x86_64-2.5/opt/cinecert/Python-2.5.4/Modules/zlibmodule.o -L/usr/local/lib -lz -o build/lib.linux-x86_64-2.5/zlib.so /usr/bin/ld: /usr/local/lib/libz.a(adler32.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libz.a: could not read symbols: Bad value collect2: ld returned 1 exit status

View 3 Replies View Related

Debian :: Python-pkg-resources Returns Error Code

Apr 9, 2010

The system is Debian Squeeze/Sid with apt.conf set to Squeeze as the default. Most packages are from Squeeze.

I ran apt-get upgrade and it returned an error-code.

It might be it is this bug: Bug#574153: python-pkg-resources: Missing file leaves it unconfigured

I tried aptitude install -f, to hold it and to remove the package python-pkg-resources, but i am getting told the package would be in a very bad stage, and i should re-install it. That doesn't work.

View 1 Replies View Related

Fedora :: Commenting Out Block Of Code In EMacs In Python Mode

Jan 13, 2010

I usually develop python code with emacs, emacs being in python code. On my desktop a version is installed and/or configured that way, so I easily can choose a region in the code and simply click on a menu option to comment out this block of code (i.e. at the begin of each line in the selected code two '##' are put). That is very convenient.

However, on my Laptop, running F12 and emacs 23.1.1, this menu option is missing! I searched within google and found the hint that by pressing 'C-c #' I also can comment out a selected region. But on my emacs it says: 'C-c # is undefined'. Am I missing something? Anyone any idea how to fix/install/update/solve this problem, so I can easily choose a couple of python lines and comment them out?

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 :: Selenium Java Code Into Equivalent Php Code?

Mar 30, 2011

I need to rewrite the selenium java code into its equivalent php code.

View 5 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

Fedora :: Python 2.5 On 12 Not Working

Feb 15, 2010

I've got Fedora 12 and I need to install python 2.5. Without trhis version of python, very important program to me will not work - is it possible?

View 6 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 :: 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

Ubuntu :: Python Based Programs Not Working

Apr 8, 2010

I've been using Ubuntu 9.10 fairly regularly on my home computer for a week or two now, dual-booting it with Windows 7. So far I've been quite happy with it, but yesterday something odd happened. I decided to copy all the music I had stored on the Windows partition over to the Ubuntu file system so that I could listen to it there. I have about 16 gigs of music mostly in .mp3 format, so I put the folder on an external hard drive, then logged into Ubuntu and copied it back from the external drive to my Music file.

Once the transfer was done, I opened the Music file and double-clicked on one of the .mp3s at random to play it. When I did this, a window popped up and the first half-second or so of the track played, and then the window closed and it stopped. This happened once or twice more with different .mp3s. The window didn't last long enough for me to get a good idea of what program it was for, but I assume it was Totem, which I hadn't yet run since installing Ubuntu, because according to the Properties->Open With tab of any .mp3 file, that's the default program to use to open .mp3s.

Attempting to run Totem from the Applications menu gives the same result, I later found. Attempting to run Totem from a terminal gave the following error:

andrew@Lovelace-Linux:~$ totem
** (totem:2323): WARNING **: Could not import pygtk
ImportError: No module named pygtk
Segmentation fault

Then, several other programs began having similar issues immediately after I first tried to play a .mp3 yesterday. Specifically, Rhythmbox - which I also hadn't used before, and next tried to use to play the music - will not start at all. Running it from the terminal gives:

andrew@Lovelace-Linux:~$ rhythmbox
** (rhythmbox:2338): CRITICAL **: atk_object_set_name: assertion `name != NULL' failed
** (rhythmbox:2338): CRITICAL **: atk_object_set_name: assertion `name != NULL' failed
(rhythmbox:2338): Rhythmbox-WARNING **: Could not import pygtk
ImportError: No module named pygtk
Segmentation fault

Note that pygtk is again referenced. The weirdest part is that other program that's having this issue, an IM client called emesene, is one that I had been using just fine, without issue, for several sessions previous. Since trying to play that .mp3, it now won't run at all. I tried removing and re-installing emesene, to no avail. Running it from the Terminal gives:

andrew@Lovelace-Linux:~$ emesene
Traceback (most recent call last):
File "/usr/share/emesene/Controller.py", line 21, in <module>
import gtk
ImportError: No module named gtk

This time the missing module is gtk, but I know that emesene is written in Python, which the earlier "pygtk" is perhaps a reference to. Thus, the connecting thread between all these programs, as near as I can tell, is Python.

View 9 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 :: 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 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







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