Keymaps in Light Table are not working - python

I just started learning Python with "A Byte of Python". I'm currently learning Light Table, the editor that the tutorial suggested.
This may be very amateurish but I have no experience whatsoever and this is all new to me.
I want to open console with cmd-shift-c so this is what my keymap looks like:
{:+ {:app {"cmd-shift-t" [:workspace.show]
"cmd-shift-c" [:toggle-console]}
I click ctrl+shift+c and nothing happens, even after I save my keymaps file.
My editor commands work, though, when I unindent a line.

Since you said you clicked ctrl+shift+c I'm going to guess you're not on a Mac and should probably change your settings. I just tried the same thing as you have on my machine and it doesn't work.
However, changing it to {"ctrl-shift-c" [:toggle-console]} worked fine for me.

Related

PyCharm - can't type in the console

I'm a beginner so I suppose this might be a silly question to you guys but I've tried everything and I'm feeling desperate. In PyCharm, I'm trying to input("Enter string:") and the "Enter string" statement shows up in the console, but I can't type in anything. Would you have any idea what this might be ?
I didn't change any of the detailed configurations
Silly thought, but are you clicking in the window to put your cursor where you need to type?
It should be there by default when you run your application in PyCharm, but I've occasionally been clicking elsewhere.

What does it mean to "restart" a program (in my case IDLE)?

This answer on Stack Overflow offers a solution I am trying to implement. In particular, see the sections "Installation Instructions" and "How to Use".
Can anyone tell me the steps required to "restart" IDLE?
New Information:
Just as people have suggested I thought this simply meant closing the program and opening it back up again...but I already tried that.
The other twist to my situation is that I'm working on a virtual machine so I was unable to do the installation of IDLE2HTML.py myself. My work's Help Desk had to do it so I cannot speak for the accuracy of their work. For now I'm assuming they did it correctly, but when I go to the "Options" menu there is no option to "Save as HTML".
My only guess at this point is that I still need to "restart IDLE".
Just wanted to double check if there was something else I could do before going back to my Help Desk department.
IDLE reads the idlelib/config-xyz.def files, including config-extensions.def, just once, when it starts. So any changes to config-extensions.def only takes effect the next time you start IDLE.
If you do not see 'Save as HTML' after starting IDLE, the extension is not installed properly.
It means you need to close the IDLE so that any changes made by the script can affect the IDLE
Simply close the IDLE either via the X, Ctrl+Q or File>Exit, then open the IDLE again.
If you are using idlelib module from a Python program then close your program and run it again.

windows warning starting chrome with Selenium Python

I've just started coding in python with selenium, but here is my problem :
When I start Chrome with selenium,I ve a warning message from windows (my computer is in french, but it ask if I want to reset my setting). And I would like to close that tab, to make my program continue on another tab.
But it seems impossible to close it. I tried :
the Alert class of selenium, did nothing, the code just go through it
Moving mouse to the cross, or to "dismiss" (with selenium obviously) just the same
Switching tab, and close it (with selenium's control command), it doesnt change anything
Open Chrome with my usual settings (still from selenium), with that mode i can t open my url anymore, but i dont have the warning message too ...
I would be so grateful if someone had an idea, or have already had that problem. In fact, i would just want to dismiss it, to make my program run, without having to close the window at the start.
Apologize me for my english, that's not my native language, but I swear that I do my best :/
Thank you very much to all, feel free to ask me more informations :)
AR
Edit: I can't forbid you to put a -1, but try to explain me in which way it deserves it, then, I'll try to correct me, or to give more details.
Here the solution, even if I would prefer a patch from Selenium, because to my mind, that is a trouble comming from Selenium/python + windows + chrome combination : I ve created a new profile on chrome, add the X.add_argument("user-data-dir=...) It doesn't open my profile (I've maybe done a mistake in the path to the folder) BUT the warning message disappears with that line, all I wanted, then thank you very much Bill Bell ;)

How to copy text from IDLE?

Is there a way to copy text out of Python IDLE on a Mac? When I highlight text and copy then past into a text editor, I get the same text pasted. It is some of the first text I start with in IDLE. None of the other text will copy out.
From The Things I Hate About IDLE That I Wish Someone Would Fix (from 2011):
1.2) NEW FEATURE: Auto-Copy-On-Highlight
Once we get rid of being able to move the cursor off the last line, that opens a new opportunity to implement an automatic copy-on-highlight feature that many terminal and IRC client programs implement. Since this text is read-only, the only reason a person has for highlighting it is to copy it (they can’t delete it.) As soon as the user highlights text in the shell window, it is copied to the clipboard.
Looks like the best you can do is save as a .py file. Open that in a text editor and continue working in IDLE. With each save, the text editor will refresh with all updates, including errors. At least TextWrangler will.
Sometimes in things like a linux terminal you can't do a normal copy and paste, try holding Command/Control + Shift + C after highlighting things and seeing if that works, since you're on mac i'm not sure if it would be the Command or Control key so try both
EDIT: There is an apple discussion about the exact same thing. They discuss going into the options menu, then into configuration and navigating to the keys section. Then you use a built in key-set, their suggestion is using IDLE Classic Mac.
I cannot tell from your description exactly what you did and what happened. But I can recommend that you upgrade to 3.4.4 or 3.5.1 (or 2.7.11 for 2.7 users). Among other improvements, they all contain a patch to make right-click for context menu work on Mac Aqua. This was issue 24801 on the CPython bug tracker.
If there is still an actual problem on Mac, I would like to know so it can be fixed.

Unable to modify python script in Windows

I'm currently using PyCharm and Sublime Text in Window to develop some Python script, but this morning something quite strange happens.
I am changing my code and testing it by running my code over test input. It is supposed to change the output text quite a lot. The output text at the end did not change at all. Then I try commenting out my output function, simply pass through the reading script. I thought "Now it should print nothing". But it prints the same output as yesterday, as if I never modified it today.
Any suggestion?
It turns out it's because my colleague has pushed an unexpected change up to repo last night...I always pulled before I end the day. The text output was forced by his logger:)
Mystery solved! Thanks for reading guys.
I've had exactly the same thing happen with Sublime. In my case I had moved / renamed the file after closing sublime. I reopened sublime some time later which reopened the old version of the file because I had left the file open when I last closed down sublime.
Have you tried closing the file and then opening it again from windows i.e. right-click => open with Sublime Text, to make sure you're editing the correct version?

Categories