No Python Folder in " Documents "? - python-3.x

im trying to learn python from a video. The first step is to install and to go to Documents/Python where he has a bunch of files. I do not however have that folder. Cant find it on google so far either. Any help would be appreciated. Thank you so much.
https://youtu.be/myFD0np9eys?t=219 <-- Video

You don't have that folder because that's a folder he created to put all of his python programs (that he has already made) into. Please watch further into the video and/or watch the video more closely. He is simply showing you how to navigate your computer using the Command Prompt by using the cd command.

In the video, he changes the current working directory using cd. In his case, all of the python files that show up are the ones he has personally created in his Documents folder. You simply just have to navigate to wherever you save the python files you want to run. For example, if you have a folder on your desktop called "PythonProjects" and within that folder you have a python script titled "foo.py," you would type in the command prompt / terminal:
cd Desktop/PythonProjects
Then to run the file:
python foo.py

Maybe you can try searching for cmd commands to search for the folder, plus there's not really any reason to open the Python folder as you can save all your work in a new folder in the desktop if you make one

In the video he has put all of his python programs and modules in a folder called Documents , hence he is getting the list of files , not necessary that you would have those files in the first place as he has downloaded a lot of packages , you might have a default location which is generally.
C:\Users\username\Appdata\Local\programs\python\python38-32
And not one more thing the python38-32 in the location i specifeid is my python version (python 3.8) if urs is python 3.7 you may want to enter python37-32 instead . Hope this answer helps you .

Related

Can someone help me figure out why terminal (MacOS) will no longer find python files I have saved?

So I'm new to learning python. I have python 3.8.2 installed on my MacBook Pro. It was working fine for a week, and I was creating code in atom, saving as .py files to a folder on my desktop. Terminal was locating and running those files easy. However, now when I go into terminal it does not see that any of my files are in the folder, just a hello.py which prints "Hello World" but I do not have any such file in that folder.
For more background, I believe the source of the error is from my earlier command. I was unsure of how to quickly navigate terminal, and as I was in a folder in a folder and wanted to leave the second folder, I thought it was similar to those old command games were you tell them to do something. So in my dumb head I typed "MacBook-Pro:FolderName user$ exit foldername" then clicked return. After this I got a message that I didn't save so I don't remember it but it was a few more lines and I believe it said it exited. I could no longer type in terminal. I closed the shell and opened a new one and thats what lead to my current issue and why I am here seeking help.
I have included a photo of my atom code, what terminal says now and my folder of files terminal can't find.
Edit: I cannot include pictures yet due to reputation being low so it has been changed to a link photo of issue here
EDIT: To add to this, I created a new save folder, moved one of the old files over to the new folder, and it ran normally. This leads me to believe that I used terminal to somehow ignore or forget that initial save folder and all its content. Is that a thing that can happen?
Based on your picture, it looks like the misconception is about how directories work in MacOS. In your terminal, you type cd ~/py4e; in Unix systems, ~ is your home directory, so you’re navigating to the py4e subdirectory under your home directory.
Then, however, you type cd ~/ex_04 (or something), which means you’re trying to navigate to the ex_04 subdirectory under your home directory. This isn’t what you want; you want to navigate to ex_04 under the py4e directory.
In the Terminal, when you’re working in a current folder, you can change to another folder within that current directory by just typing the name of that subdirectory, i.e. cd ex_04 once you have run cd ~/py4e.
If you’re just starting out with the command line in MacOS, I would definitely recommend looking up some beginner tutorials online so you can get a better feel of navigating and working in the Terminal.

getting a spec file instead of a exe with pyinstaller [duplicate]

I am completely new to python and trying to create an application (or .exe) file for python using pyinstaller. I ran the command pyinstaller -[DIRECTORY].py and it saved it to an output directory "C:\Windows\System32\Dist\Foo", however when i tried to locate the directory it did not seem to exist (Dist).
NOTE: i'm trying to convert a .py file to .exe file in Python 3.5
Thanks for any help :)
If you set your command directory to the .py script location and run pyinstaller yourscript.py, it will generate folders in the same location as your script. The folder named dist/ will contain the .exe file.
Could you please try easily the command:
`pyinstaller yourscript.py`
You will get your output folder anyway if everything is correct with your software/module.
Second you can have no rights into System32 folder, so you could try a different folder.
Third you might have inconsistency with the path \ or /.
Hope those three suggestions will lead you to the correct solution :-)
Have a nice day.

NodeJS archive manager

I need to get the content of archives and then I want to uncompress the selected one - but I dont want to uncompress the archives to know what's in it. I'd like to list and uncompress at least zip and rar, but (if that's possible) I don't want to be limited to only these two.
Can you advise good npm modules or other projects to achieve this?
Here's what I came up with:
zip
I found node-zip can only unzip files, but not list archive content.
rar
The best solution seems node-rar, but I can't install it on Windows.
node-uncompress This does what it says: It's an "Command-line wrapper for uncompressing various file types." So there is again no possibility to list archive content.
Currently I try to get node-uncompress to list files and hopefully it must never run cross-platform.
Solution:
I am now using 7zip with the node module node-7z instead of trying to get every archive working on its own. The corresponding site is: https://www.npmjs.com/package/node-7z
This library uses the OS independent archive manager 7zip. On Windows 7za is used. "7za.exe (a = alone) is a standalone version of 7-Zip". I've tested it on Windows and Ubuntu and it works great.
Update:
At Windows: Somehow I just got it working by adding 7za to the Path variables - not by adding 7za.exe to the "the same directory of your package.json file." like the description says.
Update 2:
On Windows 7za, that's referred in the node-7z post, cannot handle .rar-archives. So I'm using the "casual" 7-zip instead of 7za.exe. I just renamed the commanline 7z.exe to 7za.exe and added the 7-zip folder to the Path Variables.

I cannot Uninstall Tcl from my linux system

I installed tcl to learn it, however, I installed all the files in the wrong location. I am trying to uninstall it, But the uninstall file does not work. I am trying to carry out the instructions form their website:
To uninstall ActiveTcl, run the "uninstall.tcl" script that is located in the directory where you extracted the ActiveTcl archive. Note that you must use the "wish" in the distribution you wish to uninstall. For example:
% /path/Tcl/bin/wish /path/Tcl/lib/ppm/log/ActiveTcl/uninstall_ActiveTcl.tcl
stored, by default, in the directory /lib/ppm/log/ActiveTcl. You must use the wish interpreter from the distribution you wish to uninstall. Ensure that you do not run the uninstall script from a directory that will be removed during the uninstallation.
For example:
% /path/Tcl/bin/wish /path/Tcl/lib/ppm/log/ActiveTcl/uninstall_ActiveTcl.tcl
Note: if you are uninstalling both ActiveTcl and Tcl Dev Kit, uninstall Tcl Dev Kit before uninstalling ActiveTcl.
There is no uninstall_ActiveTcl.tcl. I do see an "uninstall" file but it does not have an extension, and I do not know how to run it.
Any help is appreciated
Thank you
Try editing the file to a uninstall.tcl file and see if that works. Take a back-up first though. Because we might need that file later
I re-installed it in a new location, compared the files that were installed between the old and the new location and deleted the file sin the old location. Unfortunately I could not delete many of the hidden files, as I did not know if they were there originally or if they belonged to Tcl. I am really surprised and disappointed there is no easy way to uninstall tcl properly.
I strongly suspect that you should uninstall ActiveTcl as follows:
Open a command prompt
Change directory to where you found the install file - e.g.
$ cd path_to_Tcl_installation/bin
Run the file
$ ./uninstall
On linux systems, you don't need any particular file extension in order to be able to run a file.
I don't know CentOS but a little googling led me to a forum thread that describes how to open a command prompt.
Good luck

How to install packages in Tcl?

I am trying to install critlib on my machine (http://equi4.com/critlib/), so that I can create zip files dynamically in Tcl.
The issue is that I have no idea how to install Tcl packages. Is there a certain place you put the folders? Is there a command like yum I can use?
I've skimmed the various Tcl beginners guides and read the sections about packages, but every source always seems to be assuming knowledge I lack.
Yes, there are some directories. To list them, execute tclsh and enter
join $auto_path \n
In each of that directory and its subdir (but not the sub-sub-dir) tcl looks for a file called pkgIndex.tcl.
So if you got an archive, extract it, look where the pkgIndex.tcl is, and copy the directory where this file is in to one of the paths $auto_path. The problem is only to select the appropiate path from the output of step 1.
If you are not sure what the appropiate directory is, I suggest editing the output from the first step into your question.
If you are using vscode and made virtual environment then you can do it as follows
"pipenv install tcl"

Resources