TCL/TK Wish can't find file in the same directory - visual-studio-code

I am trying to write a TCL/TK Script that accesses an INI File with the command [::ini::open DBW.ini]. I am using the inifile package for this and am trying to run on wish for the gui.
However, wish answers with "couldn't open "DBW.ini": no such file or directory". The odd thing about this is, that I can run this Code in the VSCode extension "Code Runner".
Code Runner is configured to access the same wish Compiler that I'm trying to run on my Windows System.
Why would I be able to run this Code through VSCode, but when im using the wish Compiler directly it throws an error message.
Thank you in advance

Most likely your Tcl code is not being executed in the same directory as where the DBW.ini file is. The Tcl command pwd will return the directory where the code is executing. If this is not where the ini file is, a simple fix would be to specify the whole path to the file when you try to open it, something like:
[::ini::open C:/some/where/DBW.ini]

Related

How do you fix "google-chrome" is not recognized in VS Code?

I'm trying to run HTML for the first time in VS code, but when I run it, it says
"google-chrome" is not recognized as an internal or external
command,operable program or batch file.
A screenshot of my problem has been attached below.
How can this be fixed?
You have to save that file with the name that browser can recognize, it should look something like 'filename.html'. Then you can open it with a web server application like xampp, or just open it on your file explorer.
The issue is that google-chrome is not a recognized command in Windows (it is in Linux distros).
The easiest way to make it work is saving the ".html" file with a proper name (something.html) and then use the command cd "C:\Users\LGU BATO\Desktop\html\" && something.html.
An explanation of this command is:
First, it will cd into the directory, as listed on the screenshot. This changes the directory of the command prompt window.
It will then open the file with your default browser.

An error in the running of kotline in vscode

enter image description here
Can anyone say how to debug it
It seems like your kotlin directory is not added to your PATH variable thus the extension/terminal may not know what to execute, when trying to execute kotlinc.
The easiest way to resolve this issue is by adding the path to your kotlin directory (path/to/your/kotlin/bin) to your PATH variable
(see here), if you are on windows, or here, if you are on a linux system.
You can check, if it works by opening a command line window and trying to execute
kotlinc -version
However, as it seems like you are using Code-Runner extension in vscode, you can also update your settings.json file:
reference here.

Swift on Ubuntu 20.04- Need to add a path every time

I am simply trying to install swift on linux
I have downloaded the files from swift.org, extracted .tar files and used export command to include the path after that when I use swift --version it correctly shows the version 5.3.3 but when I close the terminal and try to open the swift command terminal it says command not found.
What is happening here? I need to include the path every time I open the terminal.
The export command just adds the value to path for the current session. When you log out and in again, it will reset.
You need to add this to your shell resource file so that it gets added to the path every time you log in. The file you need to edit will be called .zshrc or .bash_profile or something similar. You should start by opening the command line on your computer and verifying what shell you are running by typing:
echo $SHELL
This will return something like /bin/ksh or /bin/bash or similar. Then do a little internet searching to find out what the resource file is called for that shell. Then edit your resource file to add the Swift path to your $PATH.

How to NOT open Visual Studio Code from the command line

I see a lot of posts asking how to open VScode from the command line; I have the opposite problem!
When a type a file name from the CMD terminal, VSCode is launched with the file contents...why is that? I don't want that to happen! Any ideas on how to stop this from happening?
Maybe you should check your environment variables and find path for VScode, then delete it
Also maybe in your file properties VScode is set to default opening app , so it open files by default
For example (In my case Intellij IDEA) it looks something like this:
this mean you should go to properties and change "opens with" options
Thanks for the hints; they both helped on solving the problem.
The one particular file that I wanted to execute and NOT open with vscode is a bash script file with extension " .sh ".
I checked the file manager and it is not associated with vscode; instead, it says "SH Source File".
Then, I followed the link to thisdavej and after seeing the proposed registry entries, I went ahead and looked into my own registry...found that the .sh extension had an "OpenWithProgids/VSCode.sh", deleting that solved my problem. Now, when I type the name of the shell script, it actually executes.
Thanks.

Using Scrapy with Windows Powershell

I'm unable to use scrapy commands via the Windows Powershell however I can use it via python using execute from scrapy.cmdline.
When I type anything beginning with scrapy, the 'open with' dialogue window pops up asking which program I'd like to use to open the file 'scrapy', which contains the following:
#!C:\Users\User\AppData\Local\Enthought\Canopy32\User\Scripts\python.exe
from scrapy.cmdline import execute
execute()
I've tried:
adding a . ahead of scrapy as suggested here
adding python ahead of commands suggested here
all of the above in cmd instead of PS
When I use scrapy through the Python interpreter everything functions correctly, does anybody have any suggestions as to what I'm doing wrong? Thanks.
I'm using PS version 2.0, Python 2.7.6 on Windows 7.
I'm guessing you have c:\Python27\Scripts\ folder in your PATH environment variable ($env:PATH to find out) - depends on your Python version, of course, it may be in that Enthought Canopy folder path, for instance.
When you type scrapy, Windows is finding the scrapy file (which you don't know exists, and that's why you say "there aren't any files") and trying to run it, but can't because it has no extension.
You are prompted to open it in a program, and you choose a text editor, and see the content (because there is a file). Instead you could choose to open it with Python - e.g. browsing to the C:\Users\User\AppData\Local\Enthought\Canopy32\User\Scripts\python.exe file and choosing that. Or c:\python27\python.exe if you have that.
To fix it without having to choose a file, you need to specify both where the Python interpreter is and where the scrapy file is, e.g.
python scrapy startproject myproject has to become something like
C:\Python27\python.exe C:\Python27\Scripts\scrapy startproject C:\Users\username\Documents\projects\myproject
(You will have to find out where Python.exe and scrapy are on your system. I am deliberately ignoring the Enthought path you show because I don't know anything about how it installs, and what folders it uses).
Edit: I suggest not changing the PATH because it might unintentionally break other things, and instead creating a wrapper for the scrapy launcher:
Rename Scripts\scrapy to Scripts\scrapy-helper
Create a file named Scripts\scrapy.bat with the content
C:\Python27\python.exe c:\Python27\Scripts\scrapy-helper %*
With the correct paths for your system. When you type scrapy at the command prompt, Windows/PowerShell will find it, run it as a batch file, call the right Python to run the right scrapy script, and pass any parameters you used through to Python.