Python

Room rules: sopython.com/chatroom Code formatting guide: tinyu...
Apr 11, 2021 10:54
Good sunday everyone ^^
Jul 9, 2020 07:36
Thanks that much for your detailed explication. That means I have to avoid using a print statements in a file which I want to import later. And I need just to write the Functions witout calling them in this file. The call will be done later in the new file, where the functions need to be called. In this way the stored reference value in sys.module will not have a big size in the computer's RAM. Did I understand it well?
Jul 9, 2020 06:51
I import a function "kreisfläche" from an existed python file1 in new python file2 with:

```from Aufgabe_10_1 import kreisfläche```

The problem is: In the new file2 python imports not only the function Kreisfläche. It import and executes also the other print commands from the file 1
Could some please explain me why python does import the whole commands of file 1 and not only the function which actually I need?
May 24, 2020 00:26
Thiefmaster You mean by identifiers the variable names like Rechenart?
May 24, 2020 00:00
Clever idea to search the character in String than a tuple.
The exercice is about one single charactec for doing math calculation. So it will work too
May 23, 2020 23:52
It works now. Thanks for pointing me out to the right link andras

     while Rechenart not in ("+","*", "-", "/"):
        print("Bitte Ihre Eingabe überprüfen")
        Eingabe()
May 23, 2020 23:42
 while (Rechenart != "+") or (Rechenart != "-") or (Rechenart != "*") or (Rechenart != "/"):
    print("Bitte Ihre Eingabe überprüfen")
    Eingabe()

How can I make this code shorter. I didn't find accurate answer in linked link
Jan 5, 2020 19:30
What is the easy way to open online cloud Doc "Text" with python? like on google drive or one drive?
Nov 15, 2019 14:01
Okay I understand. Thanks that much
Nov 15, 2019 13:52
Could you accept my request to /python-ouroboros-the-rotating-knives please
Nov 25, 2018 14:18
thank you
Nov 25, 2018 14:18
nice
Nov 25, 2018 14:15
just to store it as a json file
Nov 25, 2018 14:15
yes I want a list with one dict inside
Nov 25, 2018 14:13
What is the best way to delete the brackets from list of dicts:
fuel_price= [{diesel:1.25}, {super95:1.30}, {gas:0.50}]
fuel_price= [{diesel:1.25, super95:1.30, gas: 0.50}] I want it like this
Nov 20, 2018 19:49
I'm older than Kevin by one year.
Nov 20, 2018 19:15
if some is facing the same problem, this is the solution. :)
I fixed out. I Just changed the file end name from test.pptx to test.zip and decompress it then I found the video in media file.
Nov 20, 2018 18:43
The video is still in there and I can play it but there is no option to download it or copypaste it
Nov 20, 2018 18:41
I found a video on Youtube where the guy can just save the video with right click button, but when i try to do the same thing, I don't find the option to save it as a video. I just have the option to save it as image file
Nov 20, 2018 18:39
Yes
Nov 20, 2018 18:37
I want to extract a video of my powerpoint presentation because i lost it.
How can I find the path of the video in the power point presentation.
PS: I'm using Microsoft Office 2010
Nov 20, 2018 18:33
I have a question off-Toppic
Can I ask it please
Nov 19, 2018 21:28
Andras Deak this message was in dec 2017 hahaha. I forgot the code formating
Nov 19, 2018 21:23
@ex080 I'm using raspberry pi for controlling
Nov 19, 2018 21:22
Yes I just saw kevin's answer. I have to read more about subprocess because I have never used it before.
Nov 19, 2018 21:19
I have Raspbian debian version for Raspberry pi and it has Terminal "Shell". But I don't want to use terminal because i want to automate all inputdata using python to display it on RGB LED MATRIX
Nov 19, 2018 21:16
What do you mean please MisterMiyagi ?
Nov 19, 2018 21:03
No I only see my text on RGB LED MATRIX which is connected to Raspberry pi. So There is no need for Terminal When I use Python
Nov 19, 2018 20:56
It asks me to enter my input just in Terminal
Nov 19, 2018 20:55
I tried \n and input() as well but python script stops in this line
cmd2= "sudo ./text-example --led-no-hardware-pulse --led-cols=64 -f ../fonts/4x6.bdf -y 10"
Nov 19, 2018 20:50
How can I press enter using python?
Nov 19, 2018 20:47
hello I try to automate this command from terminal into python script.
When I write the command, terminal ask me to enter my text and press enter.
When I do the same command using python os.system(cmd1), python doesnt go to the next step to take the text
Nov 19, 2018 20:43
````
pi@raspberrypi:~/Documents/rpi-rgb-led-matrix-master/examples-api-use $ sudo ./text-example --led-no-hardware-pulse --led-cols=64 -f ../fonts/4x6.bdf -y 10
Enter lines. Full screen or empty line clears screen.
Supports UTF-8. CTRL-D for exit.
````
Nov 15, 2018 22:58
Sublime has the same problem like thonny editor on Raspberry pi.
the editor start reading the string from links to right.
In this video you can see "mess of alphabets" which i meant
https://www.youtube.com/watch?v=BDq6i5KKj3o
Nov 15, 2018 22:35
i had the same problem on windows and i fix it with installing AR package
Nov 15, 2018 22:34
I think because i need to install arabic package of raspbian
Nov 15, 2018 22:33
I don't understand that. It look good when i print it here on the chat explorer using raspbian but not on the python editor
Nov 15, 2018 22:31
print("لسلام عليكم")
لسلام عليكم
Nov 15, 2018 22:29
I will print the same text on Raspbian and show you the output
Nov 15, 2018 22:26
I'm using Python3
Nov 15, 2018 22:26
it was successfull
Nov 15, 2018 22:26
i tried that as well u'string'
Nov 15, 2018 22:24
i need to send a picture to show you how the mess looks like
Nov 15, 2018 22:24
I tried many ways to encode it right but it was not succesfull
Nov 15, 2018 22:22
Hmmm you are right.I have just tried it on my mac and it works.
That means the problem is on the editor which I'm using in raspberry pi
Nov 15, 2018 22:15
@AndrasDeak
 

 Python Ouroboros - The Rotating Knives

Messages from the Python room that didn't meet our standards o...
May 23, 2020 23:14
hello friends,
Short question:
How can I code in python a lot of while conditions in one shot way.
I tried this code but it doesn't work as expected.
`````
while Rechenart != ("+" or "-" or "*" or "/"):
print("Bitte Ihre Eingabe überprüfen")
Eingabe()
````
Nov 15, 2019 13:05
Yes I know. I just asked here because this is my favorite room
Nov 15, 2019 13:04
could someone explain me why the for loop is runing just one time insead of times
Nov 15, 2019 13:01
Hello, I have a question about Makecode for LEGO MINDSORMS.

I wrote this code

````

for (let i = 0; i < 2; i++) {
music.playSoundEffect(sounds.informationTouch)
}
motors.largeBC.tank(-100, -100, 10, MoveUnit.Seconds)
}
````

I dont understand the way how this code runs by repeating the sound only one time.

It should repeat the sound 2 times for (let i = 0; i < 2; i++)