Get language variants of C:\Program Files [closed] - python

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I am about to distribute an app, and I am creating an installer. I know that apps in windows go to C:\Program Files but I am also aware that the folder changes its name depending on the language, for example, in spanish it is C:\Archivos de Programa
This is quite tricky because I do not want to have to detect the language of windows and then having to create a different variable for each path in a different language. Is there any way I can get the name of that folder from python so I can just use that to create a single path?

Use the PROGRAMFILES environment variable:
>>> from os import environ
>>> environ['PROGRAMFILES']
'C:\Archivos de Programa'

Related

How to convert python script to pascal script? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I have app that need Inno Setup to pack it. And aslo i need to write some Pascal code in [Code] section.The problem is that i am very familiar with python but not familiar with Pascal,So i want to know it's there have any tool covert python code to pascal code, or some other methods, thanks.
Unfortunately you won't be able to directly convert python code to pascal
Python is a dynamically typed interpreted language, whereas Pascal is a statically typed compiled language. This means that any converter would need to know the type of every variable used in your python script, which can change throughout a script.
Providing you know the typings of your python code your easiest solution if the Pascal is 100% required would be to go through your python line by line and re-write in Pascal using online resources to find the equivalant syntaxes.
Some things won't convert cleanly due to changing of types mid script, these will need to be corrected.

translate language of text locally [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Does anyone know of anyway to translate text in a given language to another language at a linux/unix command line? At the moment I'm most interested in western languages.
I'd prefer not to send anything external to a service such as google translate or babelfish due to volume and firewall constraints.
For me tools close at hand are python, nltk, java/jvm stack, wordpress, (locally), pretty much anything hadoop or open source.
Although I'd hate to attempt to write something to do this, I'm considering maybe just mapping two dictionaries together and then using that to look up tokens singularly. This obviously wouldn't be the best "translation" but might give me some data I could work with in the desired language... the caveats being words that don't exist verbatim in the desired language, etc.
I think what I may have been looking for was apertium. It seems to have packages for install for various linux distributions, and should be accessible through the command line.
http://wiki.apertium.org/wiki/Main_Page
You could install the dictd server and whatever dictionaries you would like to install. Example of command line syntax to translate English to French after installing dictd would be:
dict -d fd-eng-fra "This is a test of the software"

File wiped when raspberry pi shut down [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I was editing a .py file and I had saved it. The power cable was then pulled out of the pi, about 30 seconds after. When I restarted the pi, the file was still there, but the contents was empty (0 bytes). Is there a way to recover this file?
in linux if you used GEdit and you havent disabled the backup function, then there must be a hidden file with name similar to your file but with ~ appended to it. So if your file name is somefile.txt then look for somefile.txt~ in the same directory. This is the backup file and will give you your files state before last save.
also in linux this is a question like this that had been answered ! https://askubuntu.com/questions/50678/how-i-can-recover-a-previous-version-of-a-file
and for windows you can see this : https://superuser.com/questions/515906/is-there-any-way-to-restore-recover-a-file-that-was-saved-over-to-its-last-versi

What is special about prn.csv? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I am using Windows 7.
I am trying make a file called PRN.csv. But get a "The specified device name is invalid" error.
I can make a file called PR.csv or PRN_.csv.
What is so special about PRN.csv?
N.B. I discovered the problem while using Pandas / Python to save a dataframe to csv. So it is relevant to this site. Apologies for not making it clear at the beginning.
This is a holdover from the DOS days. There are a number of special file names that are reserved, such as PRN (referring to the default printer), CON (the console), COM1–COM4, etc.
This is purely a backwards-compatible effort in the upper layers of the system, though. If you use the right APIs, you can create such a file because the file system doesn't care at all:
This was created in Far Manager which bypasses a few of such restrictions.

Python Virtual Machine architecture diagrams/references [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
Someone could point out sites/books where I can find introductory documentation about the architecture of the Python VM?
I'm interested in the C version, but if there are easy-to-follow references about other implementations it could be helpful too.
I'm trying to find any kind of resources of higher level than plain source code (however, UML diagrams or something like that would be nice) And also, information about the design decisions involved, including tradeoffs between the different factors (performance, stability, simplicity).
You should be able to find the information you need at https://github.com/python/cpython/blob/HEAD/Python/ceval.c
If that's too low level for you, try
http://www.python.org/dev/peps/pep-0339/
http://codespeak.net/pypy/dist/pypy/doc/interpreter.html
http://thermalnoise.wordpress.com/2007/12/30/exploring-python-bytecode/
https://docs.python.org/library/dis.html#python-bytecode-instructions
http://wiki.python.org/moin/ByteplayDoc
http://peak.telecommunity.com/DevCenter/BytecodeAssembler
http://nedbatchelder.com/blog/200804/wicked_hack_python_bytecode_tracing.html
https://jasonleaster.github.io/2016/02/21/architecture-of-python-virtual-machine/
Inside The Python Virtual Machine by Obi Ike-Nwosu.

Categories