Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Get Current Directory From ShortCut.
Post: Get Current Directory From ShortCut.

Hi, My question is regarding file Directories in Windows based Systems: Suppose I have a Directory : D:\PyProj\ In that Directory I have: ---- A Text file : D:\PyProj\Assets\Data.txt ---- A Python fil...
Oshadha General Coding Help 1 955 Jul-30-2022, 12:56 PM
    Thread: search a list or tuple for a specific type ot class
Post: RE: search a list or tuple for a specific type ot ...

(Jul-19-2022, 10:07 PM)Skaperen Wrote: i already did something like that. i was hoping for something with more done internally for a chance to be faster in some implementation(s) of Python. Nice! B...
Oshadha General Coding Help 8 1,918 Jul-21-2022, 05:03 AM
    Thread: search a list or tuple for a specific type ot class
Post: RE: search a list or tuple for a specific type ot ...

I don't think that there is a Built-in function for that, but you can create the following loop using Isinstance: myList = [2, 5.6, "Some string"] def find_with_type(type): # Specify Which Type to s...
Oshadha General Coding Help 8 1,918 Jul-19-2022, 08:34 AM
    Thread: Why my function is returning None?
Post: RE: Why my function is returning None?

(Jul-16-2022, 12:57 AM)PauloDAS Wrote: Hello, Someone can explain why my function is returning None, please? I know that, if I add a "return(word)" in the last line of the "else" block, the output...
Oshadha General Coding Help 6 1,754 Jul-16-2022, 03:10 AM
    Thread: Opening CMD from Python
Post: Opening CMD from Python

I want to open a cmd terminal at a specific directory, and run a command, then get the output to a variable in python. I searched the internet but could not find a suitable solution. Thanks...
Oshadha General Coding Help 2 1,272 Jul-16-2022, 02:54 AM
    Thread: Byte Error when working with APIs
Post: Byte Error when working with APIs

I was working with an API: Returns Json array of Tags r = requests.get('https://cataas.com/api/tags') if r.status_code == 200: with open(f'{log_Dir}Cat tags.json', 'w') as file: ...
Oshadha General Coding Help 2 1,008 Jul-05-2022, 02:16 AM
    Thread: Excel file in use from Python
Post: RE: Excel file in use from Python

(Jun-30-2022, 01:21 PM)Mark17 Wrote: (Jun-29-2022, 01:42 PM)Oshadha Wrote: Without using filename = open(filename, 'w') Try to use With: with open(filename, 'w') as file: file.write('text')T...
Oshadha General Coding Help 7 1,926 Jul-03-2022, 05:45 AM
    Thread: GUI Style
Post: GUI Style

Tkinter is very easy to learn and master. But it keeps looking old (Windows 7ish). Am I missing a part where it looks new? If not what other modules are recommended to give a new look (Windows 10 lik...
Oshadha GUI 3 1,433 Jun-29-2022, 02:03 PM
    Thread: Excel file in use from Python
Post: RE: Excel file in use from Python

Without using filename = open(filename, 'w') Try to use With: with open(filename, 'w') as file: file.write('text')This way you don't have to filename.close(). This way is more efficient and auto...
Oshadha General Coding Help 7 1,926 Jun-29-2022, 01:42 PM
    Thread: Data Science
Post: Data Science

Python is famous for data science. But what is Data Science. I never understood the concept. Is it finding data and presenting it? I consider myself an Intermediate Python Programmer. Should I study D...
Oshadha Data Science 2 1,257 Jun-29-2022, 01:35 PM
    Thread: OSERROR When mkdir
Post: OSERROR When mkdir

Error:OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'D:\\1. Oshadha\\2. Code\\Python\\11. Discord Bot\\Logs\\1 Session 22/06/29 - 10:34:05.txt'def time_now...
Oshadha General Coding Help 4 1,699 Jun-29-2022, 05:10 AM
    Thread: Creating Shortcuts with python
Post: RE: Creating Shortcuts with python

(Jun-22-2022, 12:13 PM)snippsat Wrote: Both pywin32 and winshell shortcut can do this. Can do quick test with to see in work with newest Python 3.10.5 as winshell is old. import os, sys import wins...
Oshadha General Coding Help 2 1,834 Jun-23-2022, 08:07 AM
    Thread: Creating Shortcuts with python
Post: Creating Shortcuts with python

Is there a way for me to create a shortcut (.lnk) file using python. I searched everywhere, but found no answer that works :(
Oshadha General Coding Help 2 1,834 Jun-22-2022, 11:03 AM
    Thread: How do the variables work?
Post: RE: How do the variables work?

(Apr-08-2022, 06:40 AM)buran Wrote: (Apr-08-2022, 05:57 AM)Oshadha Wrote: You return the value from the function, and assign it again out of the function.that is the better approach, pass argument...
Oshadha General Coding Help 4 1,320 Apr-08-2022, 12:41 PM
    Thread: How do the variables work?
Post: RE: How do the variables work?

Hi, its me again, I found out the error. You return the value from the function, and assign it again out of the function. Thanks...
Oshadha General Coding Help 4 1,320 Apr-08-2022, 05:57 AM
    Thread: How do the variables work?
Post: How do the variables work?

Here's the snippet; oneday = [20.00, 12.00, 16.00, 60.00, 15.00] twoday = [30.00, 18.00, 24.00, 90.00, 22.50] vdays = 1 ttype = 0 global ticket_cost ticket_cost = 0 def func_adult_tic(): adult ...
Oshadha General Coding Help 4 1,320 Apr-08-2022, 05:47 AM
    Thread: Error when plotting a graph.
Post: RE: Error when plotting a graph.

(Mar-14-2022, 04:06 PM)deanhystad Wrote: _x is a numpy array. _y is a single number. Do you want to evaluate m_val*x_val+c_val for each value in _x? import numpy as np import matplotlib.pyplot as p...
Oshadha General Coding Help 3 3,637 Mar-14-2022, 04:53 PM
    Thread: Make the code shorter
Post: RE: Make the code shorter

This is actually a very long code. If you cant shorten it, then create a separate python file to add the function. Then import the function from the file to your main project. Using import
Oshadha General Coding Help 2 1,505 Mar-14-2022, 04:01 PM
  Exclamation Thread: Error when plotting a graph.
Post: Error when plotting a graph.

I have been trying to make a python program that will get the values : m, x, c. And plot a graph using the equation y = mx+c. Im also adding a gui to this. I'm using matplotlib, tkinter and numpy to a...
Oshadha General Coding Help 3 3,637 Mar-14-2022, 03:48 PM
    Thread: Physics Simulation
Post: RE: Physics Simulation

(Mar-16-2021, 10:58 PM)HokagePikachu Wrote: Hello! I am trying to simulate a 3D car that drive off road. Especially, I want to see the movement of car suspensions. What technologies, libraries, engi...
Oshadha GUI 1 2,243 Mar-17-2021, 11:48 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020