473,586 Members | 2,682 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to change settings directory to run gnuplot on linux [solved?]

1 New Member
Hi, I'm a chemist trying to use the python script GaussSum.py with gnuplot for creating dataplots, and need some help. Whenever I try to produce a plot from the GaussSum GUI I get the error

sh: line 1: /Users/kristine/Desktop/GaussSum-1.0.5/gnuplot400/bin/wgnuplot.exe: No such file or directory

in my terminal. At the moment, I have gnuplot in the path /usr/local/bin instead. So I need to know how to change the settings directory to enable GaussSum to call gnuplot. Can anyone advise me on what or where to edit in the script please? I've pasted a section of the GaussSum.py where I'm guessing should be editted.

Thanks in advance!

Expand|Select|Wrap|Line Numbers
  1.     def preferences(self):
  2.         # The Preferences Dialog Box
  3.         oldsettings=copy.deepcopy(self.settings) # Remember the old settings
  4.         d=PreferencesPopupBox(root,self.settings,title="Settings")
  5.         if self.settings!=oldsettings: # if there are any changes
  6.             self.saveprefs()
  7.  
  8.     def saveprefs(self):
  9.         # Save the settings
  10.         appdata=os.getenv("HOME")
  11.         settingsfile=os.path.join(appdata,".GaussSum1.0","GaussSum.ini")
  12.         writeoutconfigfile(self.settings,settingsfile)
  13.  
  14.  
  15.     def readprefs(self):
  16.         # Check for GaussSum.ini in $HOME/GaussSum1.0 (XP)
  17.         #                        or $HOME/.gausssum1.0 (Linux)
  18.  
  19.         appdata=os.getenv("HOME")
  20.         self.settings={}
  21.  
  22.         if appdata==None: # Must not be a Windows machine!!
  23.             self.screen.write("Environmental variable HOME is not defined!\n\
  24.                                I cannot continue, as I need HOME to know\
  25.                                where to store GaussSum settings.\n")
  26.         else: # If everything is normal so far
  27.             settingsdir=os.path.join(appdata,".GaussSum1.0")
  28.             settingsfile=os.path.join(settingsdir,"GaussSum.ini")
  29.  
  30.             if os.path.isfile(settingsfile): # Check for settings file
  31.                 # Found it! - so read it in.
  32.                 self.settings=readinconfigfile(settingsfile)
  33.  
  34.             else: # Initialise the settings file (and directory)
  35.                 if not os.path.isdir(settingsdir):
  36.                     os.mkdir(settingsdir)
  37.                 self.settings={'global settings.filetype':'Gaussian',
  38.                                'global settings.gnuplot':os.path.join(sys.path[0],"gnuplot400","bin","wgnuplot.exe"),
  39.                                'find.text1':'SCF Done',
  40.                                'find.text2':'k 501%k502',
  41.                                'find.text3':'imaginary',
  42.                                'find.text4':'Framework',
  43.                                'ir_raman.start':'0',
  44.                                'ir_raman.end':'4000',
  45.                                'ir_raman.numpoints':'500',
  46.                                'ir_raman.fwhm':'3',
  47.                                'mo.start':'-20',
  48.                                'mo.end':'0',
  49.                                'mo.fwhm':'0.3',
  50.                                'uvvis.start':'300',
  51.                                'uvvis.end':'800',
  52.                                'uvvis.numpoints':'500',
  53.                                'uvvis.fwhm':'3000',
  54.                                'uvvis.sigma':'0.2',
  55.                                'eddm.cubman':'C:\\Gaussian\\cubman.exe',
  56.                                'eddm.formchk':'C:\\Gaussian\\formchk.exe',
  57.                                'eddm.cubegen':'C:\\Gaussian\\cubegen.exe',
  58.                                'nmr.data':os.path.join(settingsdir,"nmrdata.txt")
  59.                                }
  60.                 self.saveprefs() # Save the inital settings file
Oct 24 '06 #1
2 5355
bvdet
2,851 Recognized Expert Moderator Specialist
I guess sometimes when having problems with Python stuff, so I will guess here. Have you tried to determine your current value of 'sys.path[0]? If it is '/Users/kristine/Desktop/GaussSum-1.0.5', you may try substituting your path here:
Expand|Select|Wrap|Line Numbers
  1.  else: # Initialise the settings file (and directory)
  2.                 if not os.path.isdir(settingsdir):
  3.                     os.mkdir(settingsdir)
  4.                 self.settings={'global settings.filetype':'Gaussian',
  5.                                'global settings.gnuplot':os.path.join('usr', 'local', 'bin'),
  6.                                .......
  7.  
Sometimes I get lucky, but not usually the first time.
Oct 24 '06 #2
bartonc
6,596 Recognized Expert Expert
Looks like the key is here:

Expand|Select|Wrap|Line Numbers
  1.     def readprefs(self):
  2.         # Check for GaussSum.ini in $HOME/GaussSum1.0 (XP)
  3.         # or $HOME/.gausssum1.0 (Linux)
  4.  
  5.         appdata=os.getenv("HOME")
  6.  
My guess is that the since $HOME is /Users/kristine/Desktop/, you need the /GaussSum-1.0.5 directory there with /gnuplot400/bin/wgnuplot.exe in it.
If you don't want the directory there, look in the .gausssum1.0 file and change the path if it's in there.
Good luck,
Barton
Oct 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4747
by: Rama Calaga | last post by:
Hi, I use both python and gnuplot a lot, but I am unable to find a way to embed gnuplot "window/canvas" into tkinter. BLT option in PMW is not so powerful and not so great, any suggestions ?? thanks ram
7
3002
by: Jive | last post by:
Here's my sitch: I use gnuplot.py at work, platform Win32. I want to upgrade to Python 2.4. Gnuplot.py uses extension module Numeric. Numeric is now "unsupported." The documentation says "If you are new to Numerical Python, please use Numarray.". It's not that easy, dangit. The download page for numpy does not contain a 2.4 version of...
0
1062
by: Cousin Stanley | last post by:
Experimenting with the gnuplot package under Debian Linux, I've found that the -reverse option when used to start gnuplot from the command-line will produce plots that are color-reversed and render with white text on a black background .... However, I'm too dense to see how to easily achieve the same effect when using the python-gnuplot...
9
4703
by: syd | last post by:
I don't even know where to begin. This is just bizarre. I just picked up the Gnuplot.py module (a light interface to gnuplot commands) and was messing around with it today. I've got a tiny script, but it only works from the command line about half the time! In the python interpreter, 100%. Ipython, 100%. I'm not kidding. #!/bin/env...
6
10693
by: Joseph Suprenant | last post by:
Hello all, I have a C++ program, it does some calculations on things and then prints out a file in the format in which GNUPLOT can use. So my question is how would i call GNUPLOT from my C++ program. I know in some operating systems you can do system("gnuplot"); But not with red hat 7.3. So could some kind soul help me out? After it...
0
1489
by: Kamil Grymuza | last post by:
Can anyone help me controlling gnuplot from my program? I can't use any 3rd party libraries or so. I found on the net, that i can be done via pipes, but i don't know how to use them. All i need to do i to plot some data, maybe replot and then close the gnuplot window. Thanks Kamil
2
2123
by: Titi Anggono | last post by:
Hi all, I have some questions: 1. Can we use Tkinter for web application such as Java ? 2. I use gnuplot.py module for interfacing with gnuplot in linux. Can we make the plot result shown in web ? I tried using cgi, and it didn't work.
1
3354
by: Nicola Kaiser | last post by:
Hi, I´m using Gnuplot via gnuplot.py and I´m looking for a way to get the plotting output (terminal set to png in my case) piped in a string instead of to stdout or a file. Is there any method in gnuplot.py that does this for me? If not, I tried something like:
11
26557
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package and PEAR is in c:\wamp\php\pear I modified php.ini in the c:\wamp\php directory to reflect the actual path, but even stopping and restarting my...
0
7912
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7839
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3837
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3865
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1449
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.