Saving Python code in Anaconda - save

I am having problems saving the Python code in Anaconda. I write code, Go to File Save as the file is saved but when I open it is empty, no code. I read that IDLE does not save code, it erases it when I close Anaconda.
I have searched in books, youtube tutorials and nothing. I could not find this topic. I can find advanced topics, but this one no.
Thank you for your help!
Best,
Tiberiu

This somewhat depends on what OS you are on. I can speak from my experience. I would highly recommend using PyCharm as an IDE.
But more fundamentally than that, lets talk about saving files. On Mac OS X or Ubuntu 14.04 (or the like), lets say you want to create a python file. One way is to do the following in a terminal:
nano hello.py
This opens up a text editor whose instructions for use are on the bottom of the screen. On Windows you could do:
notepad hello.py
In both cases you then write your code. Lets say the content was:
#content of hello.py
print "Hello World!"
Then you need to save the file and execute it with Python.
Which brings us to the Python issue.
Once you have installed Anaconda, and assuming that there are no other Python installations on your computer. The Anaconda Python should be the active Python on system.
Suffice to say that there are other ways of saving files rather than using IDLE. Personally I have found PyCharm to be a much better IDE for writing Python code.
To address the IDLE issue more directly once you type in the terminal/command prompt idle to launch an IDLE session, likely the IDLE Shell will open up. Perhaps you are trying to save this, in which case you will only save the Shell session.
So go to File - New - Save. This should work without any problem (it does on my system). Good luck! Hope this helps.

Related

Can a LyX/LaTeX file be too large to create a PDF?

I've been working on my bachelors thesis in LyX for about a month without encountering any problems and today, all of a sudden, when creating a PDF LyX just loads indefinitely and even asks me at some point if I want to stop the PDF creating since it takes such a long time. Am I doing something wrong? I have about 100 pages and the PDFs I created lately have been around 100 mb large since they hold very high res images and a lot of them.
In case anyone is struggling with the "convert" functionality usage in Lyx, this is some additional info:
Initially I struggled to make eps to load and be displayed on screen as well as to get it exported to PDF file. I saw that the Lyx latest install had already all "convert blah-blah $$ii $$o" commands predefined and it was still not working.
Here is what worked for me:
sudo mv /etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xmlout
Here there are two parts -
a) imagemagick needs to be installed on the machine as it provides most of the converters. Following command on terminal would check if imagemagick is installed or not on your system.
identify -version
b) Imagemagick tools should be "allowed" to run - "convert" being one of those. You need to relax some default security policies for that. That is what the above renaming of the policy file does. Detailed information is given in answer to this question on ubuntu forum.
Note - This security policy relaxation is not recommended for web-server machines. Only desktop users may take the risk.

Erlang Shell Working Directory

I am configuring Ideaj to open an Erlang REPL by setting it up as and external tool, however the working directory param is ignored. Is there a way once the REPL is open to switch the working directory?
Within the shell use the command cd("some/path") and it will work pretty much the same way you would expect from an ordinary shell.
This means you can move around your project directories and run c(module_name) and be in the local loading path as well -- which can be pretty convenient when hand-tweaking/testing things.
As an aside... most folks don't use an IDE with Erlang, because the shell has so much stuff already built into it, and your OS itself already has whatever other tools you usually want. I've yet to see someone start with an IDE and stick with it in Erlang (usually wind up becoming either Emacs users or go the vim + coreutils route).
Also, pwd() and ls() work as you'd expect.
Regarding IDEs- I find the Erlang Intellij plugin (http://ignatov.github.io/intellij-erlang/) very usable, and when doing more than relatively short one-offs in vim (with Erlang plugin) the code completion and Find Usages kinds of IDE functionality to be useful.
Give it a shot - YMMV.

chromebook crouton install raring with cli-extra, so no pdf view in emacs?

Total newbie questions, here. But I installed raring with cli-extra options. Then installed emacs24. I installed texlive. Now with C-c C-c command I can compile .tex documents in emacs. But I don't get a view of it.
My question is, is this because I never installed an X interface? Or is because I am accessing emacs through SecureShell in the ChromeOS?
Thanks so much, please correct any misunderstandings I have. Anyone have suggestions where I can look to find out?
Without a desktop environment there isn't anything that will be able to display images (the pdf).
An example of this is when you have images like pngs in your .emacs.desktop and you open it in no window mode (-nw), emacs gives an error as linux terminals don't support images.
If you want this functionality I'd recommend either loading a desktop manager like xfce, or open the pdf in chrome os, and hopefully it will update automatically when the pdf is re-rendered, otherwise you should just be able to refresh to update it.

WAMP show logs in realtime in console

I'am using the WAMPServer, and it's located in d:/wamp/. Is there a way to show logging window or console in realtime as I'am crawling on my server web ?
On unix/linux boxes I tend to use the tail command to watch logs as I browse for debugging. Of course, Windows has no equivalent, but there are a few options. The one I settled with was mTAIL. It's a standalone app and not a command line program, but it does exactly what you'd expect:
I was going to suggest using unxtools, a suite of ported GNU tools that can be used on the command line, but it's out of date and trying it on more recent versions of Windows I had problems. You can download them from sourceforge if you want to take a look. Also tail for Windows, is another Windows app that unfortunately doesn't seem to work on later versions, but included here in case it saves anyone the time looking.
Of course, you may find that if you prefer the command line you want to look at getting cygwin installed, which contains a host of commands you could use for the task you have.

not enough space for environment appears when executing ".exe" file

I am trying to use an application called CLUT.exe which is an old application for MS-DOS that can be used to reindex NTX files for DBF databases.
(This is not the main topic, but I am just writing this if someone wants to test the app and don't trust at all about the content).
The problem starts when trying to run the command line version through console (cmd.exe) and this error appears:
C:\>CLUT.exe [arg1] [arg2] [arg3]
run-time error R6009
- not enough space for environment
So, according to what I've searched, this could be a possible solution:
http://support.microsoft.com/default.aspx?scid=kb;en-us;230205
but it doesn't work and every alternative that I found to solve this over the internet is the same.
Another alternative could be to make right-click in the .exe file, go to Properties then Memory tab and increase the Initial environment memory from Auto to the max value but it doesn't work too.
Well, I am stuck and no "possible" solution is working for me. If someone is interested, knows more about this issue and want to test, you can download the application from here (click "Free Download" green button):
http://www.filebasket.com/free/Development-Clipper-programming-language/clut-exe/13996.html
or directly from my DropBox:
https://dl.dropbox.com/u/15208254/stackoverflow/clut_214.rar
Just to know, I am using Windows 7 and the CLUT.exe application is a Clipper based app (old programming language) that may run under windows console (cmd.exe).
Wikipedia does mention other dos emulators but, oddly, doesn't mention BOCHS.
Reindexing NTX files is not a difficult thing to do, and can be done with tools other than CLUT. For example, many of the utilities listed on this part of Download32 could be used. Otherwise, you could write your own using Harbour Project or xHarbour. Or contact me off list and I'll cook up something in Clipper 5.3.
LATER
If I read the README correctly for CLUT, it's a replacement for the DBU utility that comes with Clipper 5.x. I can supply you with a build of that if you're unsuccessful with other approaches.

Resources